Skip to main content
Skip to main content

updatePriceRules - Pricing Module Reference

Beta

This 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

dataUpdatePriceRuleDTO[]Required
The price rules to update, each having attributes that should be updated in a price rule.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<PriceRuleDTO[]>Required
The list of updated price rules.
Was this section helpful?