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.
Returns
The list of created rule types.
Was this section helpful?