createTaxRatesWorkflow - Medusa Core Workflows Reference

This documentation provides a reference to the createTaxRatesWorkflow. It belongs to the @medusajs/medusa/core-flows package.

This workflow creates one or more tax rates. It's used by the Create Tax Rates Admin API Route.

You can use this workflow within your own customizations or custom workflows, allowing you to create tax rates in your custom flows.

Source Code

Examples#

Steps#

Workflow Hook

Step conditioned by when

Input#

CreateTaxRatesWorkflowInputCreateTaxRatesWorkflowInput
The tax rates to create.
tax_region_idstring
The associated tax region's ID.
namestring
The name of the tax rate.
ratenull | numberOptional
The rate to charge.
codenull | stringOptional
The code of the tax rate.
rulesOmit<CreateTaxRateRuleDTO, "tax_rate_id">[]Optional
The rules of the tax rate.
is_defaultbooleanOptional
Whether the tax rate is default.
created_bystringOptional
Who created the tax rate. For example, the ID of the user that created the tax rate.
metadataMetadataTypeOptional
Holds custom data in key-value pairs.

Output#

CreateTaxRatesWorkflowOutputCreateTaxRatesWorkflowOutput
The created tax rates.
idstring
The ID of the tax rate.
ratenull | number
The rate to charge.
codenull | string
The code the tax rate is identified by.
namestring
The name of the Tax Rate.
metadatanull | Record<string, unknown>
Holds custom data in key-value pairs.
tax_region_idstring
The ID of the associated tax region.
is_combinableboolean
Whether the tax rate should be combined with parent rates. Learn more here.
is_defaultboolean
Whether the tax rate is the default rate for the region.
created_atstring | Date
The creation date of the tax rate.
updated_atstring | Date
The update date of the tax rate.
deleted_atnull | Date
The deletion date of the tax rate.
created_bynull | string
Who created the tax rate. For example, the ID of the user that created the tax rate.
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