docs: avalara integration tutorial (#13808)

* docs: avalara integration tutorial

* fix getTaxLines method

* fixes

* fix broken link

* fix build error

* fix vale errors
This commit is contained in:
Shahed Nasser
2025-10-23 13:07:27 +03:00
committed by GitHub
parent 90162ebeac
commit 356dcc94ce
9 changed files with 3399 additions and 10 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,5 @@
import { CardList } from "docs-ui"
export const metadata = {
title: `Tax Module Provider`,
}
@@ -20,9 +22,7 @@ The Medusa application uses the Tax Module Provider whenever it needs to calcula
![Diagram showcasing the communication between Medusa the Tax Module Provider, and the third-party tax provider.](https://res.cloudinary.com/dza7lstvk/image/upload/v1746790996/Medusa%20Resources/tax-provider-service_kcgpne.jpg)
---
## Default Tax Provider
### Default Tax Provider
The Tax Module provides a `system` tax provider that acts as a placeholder tax provider. It performs basic tax calculation, as you can see in the [Create Tax Module Provider](/references/tax/provider#gettaxlines) guide.
@@ -34,6 +34,22 @@ The identifier of the system tax provider is `tp_system`.
</Note>
### Other Tax Providers
<CardList
items={[
{
href: "/integrations/guides/avalara",
title: "Avalara",
badge: {
variant: "blue",
children: "Tutorial"
}
}
]}
className="mb-1"
/>
---
## How to Create a Custom Tax Provider?

File diff suppressed because it is too large Load Diff

View File

@@ -301,3 +301,23 @@ Integrate a search engine to index and search products or other types of data in
]}
className="mb-1"
/>
---
## Tax
Integrate a third-party tax calculation service to handle tax rates and rules in your Medusa application.
<CardList
items={[
{
href: "/integrations/guides/avalara",
title: "Avalara",
badge: {
variant: "blue",
children: "Tutorial"
}
}
]}
className="mb-1"
/>

View File

@@ -103,7 +103,7 @@ export const generatedEditDates = {
"app/deployment/admin/vercel/page.mdx": "2024-10-16T08:10:29.377Z",
"app/deployment/storefront/vercel/page.mdx": "2025-05-20T07:51:40.712Z",
"app/deployment/page.mdx": "2025-09-29T10:23:47.833Z",
"app/integrations/page.mdx": "2025-09-17T08:08:37.954Z",
"app/integrations/page.mdx": "2025-10-22T07:14:23.467Z",
"app/medusa-cli/page.mdx": "2024-08-28T11:25:32.382Z",
"app/medusa-container-resources/page.mdx": "2025-07-31T13:24:15.786Z",
"app/medusa-workflows-reference/page.mdx": "2025-01-20T08:21:29.962Z",
@@ -6476,7 +6476,7 @@ export const generatedEditDates = {
"references/types/interfaces/types.IPaymentProvider/page.mdx": "2025-10-21T08:10:48.134Z",
"references/types/interfaces/types.WebhookActionResult/page.mdx": "2025-05-20T07:51:41.086Z",
"references/types/interfaces/types.WebhookActionData/page.mdx": "2025-05-20T07:51:41.086Z",
"app/commerce-modules/tax/tax-provider/page.mdx": "2025-05-20T07:51:40.711Z",
"app/commerce-modules/tax/tax-provider/page.mdx": "2025-10-22T07:14:23.461Z",
"app/recipes/bundled-products/examples/standard/page.mdx": "2025-06-26T11:52:18.819Z",
"app/recipes/bundled-products/page.mdx": "2025-05-20T07:51:40.718Z",
"app/infrastructure-modules/analytics/local/page.mdx": "2025-08-21T05:30:26.867Z",
@@ -6683,5 +6683,6 @@ export const generatedEditDates = {
"references/types/types/types.ListShippingOptionsForCartWorkflowInput/page.mdx": "2025-10-21T08:10:45.503Z",
"references/utils/Fulfillment/variables/utils.Fulfillment.ShippingOptionTypeWorkflowEvents/page.mdx": "2025-10-21T08:10:52.748Z",
"references/utils/PromotionUtils/enums/utils.PromotionUtils.ApplicationMethodAllocation/page.mdx": "2025-10-21T08:10:52.665Z",
"references/utils/PromotionUtils/enums/utils.PromotionUtils.CampaignBudgetType/page.mdx": "2025-10-21T08:10:52.672Z"
"references/utils/PromotionUtils/enums/utils.PromotionUtils.CampaignBudgetType/page.mdx": "2025-10-21T08:10:52.672Z",
"app/integrations/guides/avalara/page.mdx": "2025-10-22T09:56:11.929Z"
}

View File

@@ -935,6 +935,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/integrations/guides/algolia/page.mdx",
"pathname": "/integrations/guides/algolia"
},
{
"filePath": "/www/apps/resources/app/integrations/guides/avalara/page.mdx",
"pathname": "/integrations/guides/avalara"
},
{
"filePath": "/www/apps/resources/app/integrations/guides/contentful/page.mdx",
"pathname": "/integrations/guides/contentful"

View File

@@ -271,6 +271,23 @@ const generatedgeneratedIntegrationsSidebarSidebar = {
"children": []
}
]
},
{
"loaded": true,
"isPathHref": true,
"type": "category",
"title": "Tax",
"initialOpen": true,
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/integrations/guides/avalara",
"title": "Avalara",
"children": []
}
]
}
]
}

View File

@@ -185,4 +185,16 @@ export const integrationsSidebar = [
},
],
},
{
type: "category",
title: "Tax",
initialOpen: true,
children: [
{
type: "link",
path: "/integrations/guides/avalara",
title: "Avalara",
},
],
},
]

View File

@@ -23,9 +23,14 @@ const taxProviderOptions: FormattingOptionsType = {
`## Overview
A Tax Module Provider is used to retrieve the tax lines in a provided context. The Tax Module provides a default \`system\` provider. You can create your own Tax Module Provider, either in a plugin, in a module provider, or directly in your Medusa application's codebase, then use it in any tax region.`,
`## Implementation Example
As you implement your Tax Module Provider, it can be useful to refer to an existing provider and how it's implemeted.
If you need to refer to an existing implementation as an example, check the [Avalara Tax Module Provider tutorial](https://docs.medusajs.com/resources/integrations/guides/avalara).`,
`## Understanding Tax Module Provider Implementation
The Tax Module Provider handles calculating taxes with a third-party provirder. However, it's not responsible for managing tax concepts within Medusa, such as creating a tax region. The Tax Module uses your Tax Module Provider within core operations.
The Tax Module Provider handles calculating taxes with a third-party provider. However, it's not responsible for managing tax concepts within Medusa, such as creating a tax region. The Tax Module uses your Tax Module Provider within core operations.
For example, during checkout, the Tax Module Provider of the tax region that the customer is in is used to calculate the tax for the cart and order. So, you only have to implement the third-party tax calculation logic in your Tax Module Provider.`,
`## 1. Create Module Provider Directory