createRuleTypes - Pricing Module Reference
BetaThis documentation provides a reference to the createRuleTypes
method. This belongs to the Pricing Module.
This method is used to create new rule types.
Example
import {
initialize as initializePricingModule,
} from "@medusajs/pricing"
async function createRuleTypes () {
const pricingService = await initializePricingModule()
const ruleTypes = await pricingService.createRuleTypes([
{
name: "Region",
rule_attribute: "region_id"
}
])
// do something with the rule types or return them
}
Parameters
The rule types to create.
sharedContext
ContextA context used to share resources, such as transaction manager, between the application and the module.
sharedContext
ContextReturns
The list of created rule types.
Was this section helpful?