updateTaxRates - Tax Module Reference

This documentation provides a reference to the updateTaxRates method. This belongs to the Tax Module.

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

updateTaxRates(taxRateId, data, sharedContext?): Promise<TaxRateDTO>#

This method updates an existing tax rate.

Example#

Code
1const taxRate = await taxModuleService.updateTaxRates("txr_123", {2  rate: 10,3})

Parameters#

taxRateIdstring
The tax rate's ID.
The attributes to update in the tax rate.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<TaxRateDTO>
The updated tax rate.

updateTaxRates(taxRateIds, data, sharedContext?): Promise<TaxRateDTO[]>#

This method updates existing tax rates.

Example#

Code
1const taxRates = await taxModuleService.updateTaxRates(2  ["txr_123", "txr_321"],3  {4    rate: 10,5  }6)

Parameters#

taxRateIdsstring[]
The IDs of tax rates to update.
The attributes to update in the tax rate.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<TaxRateDTO[]>
The updated tax rates.

updateTaxRates(selector, data, sharedContext?): Promise<TaxRateDTO[]>#

This method updates existing tax rates matching the specified filters.

Example#

Code
1const taxRates = await taxModuleService.updateTaxRates(2  {3    id: ["txr_123", "txr_321"],4  },5  {6    rate: 10,7  }8)

Parameters#

The filters specifying which tax rates to update.
The attributes to update in the tax rate.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<TaxRateDTO[]>
The updated tax rates.
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