createTaxRateRules - Tax Module Reference

This documentation provides a reference to the createTaxRateRules 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.

createTaxRateRules(data, sharedContext?): Promise<TaxRateRuleDTO>#

This method creates a tax rate rule.

Example#

Code
1const taxRateRule = await taxModuleService.createTaxRateRules(2  {3    reference: "product_type",4    reference_id: "ptyp_123",5    tax_rate_id: "txr_123",6  }7)

Parameters#

The tax rate rule to be created.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<TaxRateRuleDTO>
The created tax rate rule.

createTaxRateRules(data, sharedContext?): Promise<TaxRateRuleDTO[]>#

This method creates tax rate rules.

Example#

Code
1const taxRateRules =2  await taxModuleService.createTaxRateRules([3    {4      reference: "product_type",5      reference_id: "ptyp_123",6      tax_rate_id: "txr_123",7    },8    {9      reference: "product",10      reference_id: "prod_123",11      tax_rate_id: "txr_321",12    },13  ])

Parameters#

The tax rate rules to be created.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<TaxRateRuleDTO[]>
The created tax rate rules.
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