updatePriceSets - Pricing Module Reference

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

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

updatePriceSets(id, data, sharedContext?): Promise<PriceSetDTO>#

This method is used to update a price set.

Example#

Code
1const priceSet = await pricingModuleService.updatePriceSets(2  "pset_123",3  {4     prices: [{ amount: 100, currency_code: "USD" }],5  }6)

Parameters#

idstring
The ID of the price set to be updated.
The attributes of the price set to be updated
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<PriceSetDTO>
The updated price set.

updatePriceSets(selector, data, sharedContext?): Promise<PriceSetDTO[]>#

This method is used to update a list of price sets determined by the selector filters.

Example#

Code
1const priceSets = await pricingModuleService.updatePriceSets(2  {3    id: ["pset_123", "pset_321"],4  },5  {6    prices: [{ amount: 100, currency_code: "USD" }],7  }8)

Parameters#

The filters that will determine which price sets will be updated.
The attributes to be updated on the selected price sets
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<PriceSetDTO[]>
The updated price sets.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break