updatePriceRules - Pricing Module Reference
BetaThis documentation provides a reference to the updatePriceRules method. This belongs to the Pricing Module.
This method is used to update price rules, each with their provided data.
Example
import {
  initialize as initializePricingModule,
} from "@medusajs/pricing"
async function updatePriceRules (
  id: string,
  priceSetId: string,
) {
  const pricingService = await initializePricingModule()
  const priceRules = await pricingService.updatePriceRules([
    {
      id,
      price_set_id: priceSetId,
    }
  ])
  // do something with the price rules or return them
}
Parameters
The price rules to update, each having attributes that should be updated in a price rule.
sharedContextContextA context used to share resources, such as transaction manager, between the application and the module.
sharedContextContextReturns
The list of updated price rules.
Was this section helpful?