Back to Medusa

{metadata.title}

www/apps/resources/app/commerce-modules/order/tax-lines/page.mdx

2.14.21.7 KB
Original Source

export const metadata = { title: Tax Lines in Order Module, }

{metadata.title}

In this document, you’ll learn about tax lines in an order.

What are Tax Lines?

A tax line indicates the tax rate of a line item or a shipping method.

The OrderLineItemTaxLine data model represents a line item’s tax line, and the OrderShippingMethodTaxLine data model represents a shipping method’s tax line.


Tax Inclusivity

By default, the tax amount is calculated by taking the tax rate from the line item or shipping method’s amount and then adding it to the item/method’s subtotal.

However, line items and shipping methods have an is_tax_inclusive property that, when enabled, indicates that the item or method’s price already includes taxes.

So, instead of calculating the tax rate and adding it to the item/method’s subtotal, it’s calculated as part of the subtotal.

<Note>

The following diagram is a simplified showcase of how a subtotal is calculated from the tax perspective.

</Note>

For example, if a line item's amount is 5000, the tax rate is 10, and is_tax_inclusive is enabled, the tax amount is 10% of 5000, which is 500. The item's unit price becomes 4500.