Skip to main content
Skip to main content

createPriceSetMoneyAmountRules - Pricing Module Reference

Beta

This documentation provides a reference to the createPriceSetMoneyAmountRules method. This belongs to the Pricing Module.

This method is used to create new price set money amount rules. A price set money amount rule creates an association between a price set money amount and a rule type.

Example

import {
initialize as initializePricingModule,
} from "@medusajs/pricing"

async function createPriceSetMoneyAmountRules (priceSetMoneyAmountId: string, ruleTypeId: string, value: string) {
const pricingService = await initializePricingModule()

const priceSetMoneyAmountRules = await pricingService.createPriceSetMoneyAmountRules([
{
price_set_money_amount: priceSetMoneyAmountId,
rule_type: ruleTypeId,
value
}
])

// do something with the price set money amount rules or return them
}

Parameters

The price set money amount rules to create.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<PriceSetMoneyAmountRulesDTO[]>Required
The list of created price set money amount rules.
Was this section helpful?