Skip to main content
Skip to main content

setPriceListRules - Pricing Module Reference

Beta

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

This method is used to set the rules of a price list.

Example

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

async function setPriceListRules (priceListId: string) {
const pricingService = await initializePricingModule()

const priceList = await pricingService.setPriceListRules({
priceListId,
rules: {
region_id: "US"
}
})

// do something with the price list or return it
}

Parameters

The rules to set for a price list.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<PriceListDTO>Required
The updated price lists.
Was this section helpful?