You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: www/apps/book/public/llms-full.txt
+145Lines changed: 145 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27808,6 +27808,14 @@ A region’s price preference’s `is_tax_inclusive`'s value takes higher preced
27808
27808
- the selected price belongs to the region;
27809
27809
- and the region has a price preference
27810
27810
27811
+
***
27812
+
27813
+
## Tax-Inclusive Pricing with Promotions
27814
+
27815
+
When you enable tax-inclusive prices for regions or currencies, this can impact how promotions are applied to the cart. So, it's recommended to enable tax-inclusiveness for promotions as well.
27816
+
27817
+
Learn more in the [Tax-Inclusive Promotions](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/promotion/promotion-taxes/index.html.md) guide.
@@ -29613,6 +29622,142 @@ Learn more about workflows in [this documentation](https://docs.medusajs.com/doc
29613
29622
***
29614
29623
29615
29624
29625
+
# Tax-Inclusive Promotions
29626
+
29627
+
In this guide, you’ll learn how taxes are applied to promotions in a cart.
29628
+
29629
+
This feature is available from [Medusa v2.8.5](https://github.com/medusajs/medusa/releases/tag/v2.8.5).
29630
+
29631
+
## What are Tax-Inclusive Promotions?
29632
+
29633
+
By default, promotions are tax-exclusive, meaning that the discount amount is applied as-is to the cart before taxes are calculated and applied to the cart total.
29634
+
29635
+
A tax-inclusive promotion is a promotion for which taxes are calculated from the discount amount entered by the merchant.
29636
+
29637
+
When a promotion is tax-inclusive, the discount amount is reduced by the calculated tax amount based on the [tax region's rate](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/tax/tax-region/index.html.md). The reduced discount amount is then applied to the cart total.
29638
+
29639
+
Tax-inclusiveness doesn't apply to Buy X Get Y promotions.
29640
+
29641
+
### When to Use Tax-Inclusive Promotions
29642
+
29643
+
Tax-inclusive promotions are most useful when using [tax-inclusive prices](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/pricing/tax-inclusive-pricing/index.html.md) for items in the cart.
29644
+
29645
+
In this scenario, Medusa applies taxes consistently across the cart, ensuring that the total price reflects the taxes and promotions correctly.
29646
+
29647
+
You can see this in action in the [examples below](#tax-inclusiveness-examples).
29648
+
29649
+
***
29650
+
29651
+
## What Makes a Promotion Tax-Inclusive?
29652
+
29653
+
The [Promotion data model](https://docs.medusajs.com/references/promotion/models/Promotion/index.html.md) has an `is_tax_inclusive` property that determines whether the promotion is tax-inclusive.
29654
+
29655
+
If `is_tax_inclusive` is disabled (which is the default), the promotion's discount amount will be applied as-is to the cart, before taxes are calculated. See an example in the [Tax-Exclusive Promotion Example](#tax-exclusive-promotion-example) section.
29656
+
29657
+
If `is_tax_inclusive` is enabled, the promotion's discount amount will first be reduced by the calculated tax amount (based on the [tax region's rate](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/tax/tax-region/index.html.md)). The reduced discount amount is then applied to the cart total. See an example in the [Tax-Inclusive Promotion Example](#tax-inclusive-promotion-example) section.
29658
+
29659
+
***
29660
+
29661
+
## How to Set a Promotion as Tax-Inclusive
29662
+
29663
+
You can enable tax-inclusiveness for a promotion when [creating it in the Medusa Admin](https://docs.medusajs.com/user-guide/promotions/create/index.html.md).
29664
+
29665
+
You can set the `is_tax_inclusive` property when creating a promotion by using either the [Promotion workflows](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/promotion/workflows/index.html.md) or the [Promotion Module's service](https://docs.medusajs.com/references/promotion/index.html.md).
29666
+
29667
+
For most use cases, it's recommended to use [workflows](https://docs.medusajs.com/docs/learn/fundamentals/workflows/index.html.md) instead of directly using the module's service, as they implement the necessary rollback mechanisms in case of errors.
29668
+
29669
+
For example, if you're creating a promotion with the [createPromotionsWorkflow](https://docs.medusajs.com/references/medusa-workflows/createPromotionsWorkflow/index.html.md) in an API route:
29670
+
29671
+
```ts highlights={[["17"]]}
29672
+
import type {
29673
+
MedusaRequest,
29674
+
MedusaResponse,
29675
+
} from "@medusajs/framework/http"
29676
+
import { createPromotionsWorkflow } from "@medusajs/medusa/core-flows"
29677
+
29678
+
export async function POST(
29679
+
req: MedusaRequest,
29680
+
res: MedusaResponse
29681
+
) {
29682
+
const { result } = await createPromotionsWorkflow(req.scope)
29683
+
.run({
29684
+
input: {
29685
+
promotionsData: [{
29686
+
code: "10OFF",
29687
+
// ...
29688
+
is_tax_inclusive: true,
29689
+
}],
29690
+
}
29691
+
})
29692
+
29693
+
res.send(result)
29694
+
}
29695
+
```
29696
+
29697
+
In the above example, you set the `is_tax_inclusive` property to `true` when creating the promotion, making it tax-inclusive.
29698
+
29699
+
### Updating a Promotion's Tax-Inclusiveness
29700
+
29701
+
A promotion's tax-inclusiveness cannot be updated after it has been created. If you need to change a promotion's tax-inclusiveness, you must delete the existing promotion and create a new one with the desired `is_tax_inclusive` value.
29702
+
29703
+
***
29704
+
29705
+
## Tax-Inclusiveness Examples
29706
+
29707
+
The following sections provide examples of how tax-inclusive promotions work in different scenarios, including both tax-exclusive and tax-inclusive promotions.
29708
+
29709
+
These examples will help you understand how tax-inclusive promotions affect the cart total, allowing you to decide when to use them effectively.
29710
+
29711
+
### Tax-Exclusive Promotion Example
29712
+
29713
+
Consider the following scenario:
29714
+
29715
+
- A tax-exclusive promotion gives a `$10` discount on the cart's total.
29716
+
- The cart's tax region has a `25%` tax rate.
29717
+
- The cart total before applying the promotion is `$100`.
29718
+
- [The prices in the cart's tax region are tax-exclusive](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/pricing/tax-inclusive-pricing/index.html.md).
2. Calculate tax on discounted total: `$90` x `25%` = `$22.50`
29724
+
3. Final total: `$90` + `$22.50` = `$112.50`
29725
+
29726
+
### Tax-Inclusive Promotion Example
29727
+
29728
+
Consider the following scenario:
29729
+
29730
+
- A tax-inclusive promotion gives a `$10` discount on the cart's total.
29731
+
- The cart's tax region has a `25%` tax rate.
29732
+
- The cart total before applying the promotion is `$100`.
29733
+
- [The prices in the cart's tax region are tax-exclusive](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/pricing/tax-inclusive-pricing/index.html.md).
3. Calculate tax on discounted total: `$92` x `25%` = `$23`
29740
+
4. Final total: `$92` + `$23` = `$115`
29741
+
29742
+
### Tax-Inclusive Promotions with Tax-Inclusive Prices
29743
+
29744
+
Consider the following scenario:
29745
+
29746
+
- A tax-inclusive promotion gives a `$10` discount on the cart's total.
29747
+
- The cart's tax region has a `25%` tax rate.
29748
+
- The cart total before applying the promotion is `$100`.
29749
+
- [The prices in the cart's tax region are tax-inclusive](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/pricing/tax-inclusive-pricing/index.html.md).
Copy file name to clipboardExpand all lines: www/apps/resources/app/commerce-modules/pricing/tax-inclusive-pricing/page.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,3 +76,11 @@ A region’s price preference’s `is_tax_inclusive`'s value takes higher preced
76
76
- both the `region_id` and `currency_code` are provided in the calculation context;
77
77
- the selected price belongs to the region;
78
78
- and the region has a price preference
79
+
80
+
---
81
+
82
+
## Tax-Inclusive Pricing with Promotions
83
+
84
+
When you enable tax-inclusive prices for regions or currencies, this can impact how promotions are applied to the cart. So, it's recommended to enable tax-inclusiveness for promotions as well.
85
+
86
+
Learn more in the [Tax-Inclusive Promotions](../../promotion/promotion-taxes/page.mdx) guide.
In this guide, you’ll learn how taxes are applied to promotions in a cart.
16
+
17
+
<Note>
18
+
19
+
This feature is available from [Medusa v2.8.5](https://github.com/medusajs/medusa/releases/tag/v2.8.5).
20
+
21
+
</Note>
22
+
23
+
## What are Tax-Inclusive Promotions?
24
+
25
+
By default, promotions are tax-exclusive, meaning that the discount amount is applied as-is to the cart before taxes are calculated and applied to the cart total.
26
+
27
+
A tax-inclusive promotion is a promotion for which taxes are calculated from the discount amount entered by the merchant.
28
+
29
+
When a promotion is tax-inclusive, the discount amount is reduced by the calculated tax amount based on the [tax region's rate](../../tax/tax-region/page.mdx). The reduced discount amount is then applied to the cart total.
30
+
31
+
<Note>
32
+
33
+
Tax-inclusiveness doesn't apply to Buy X Get Y promotions.
34
+
35
+
</Note>
36
+
37
+
### When to Use Tax-Inclusive Promotions
38
+
39
+
Tax-inclusive promotions are most useful when using [tax-inclusive prices](../../pricing/tax-inclusive-pricing/page.mdx) for items in the cart.
40
+
41
+
In this scenario, Medusa applies taxes consistently across the cart, ensuring that the total price reflects the taxes and promotions correctly.
42
+
43
+
You can see this in action in the [examples below](#tax-inclusiveness-examples).
44
+
45
+
---
46
+
47
+
## What Makes a Promotion Tax-Inclusive?
48
+
49
+
The [Promotion data model](/references/promotion/models/Promotion) has an `is_tax_inclusive` property that determines whether the promotion is tax-inclusive.
50
+
51
+
If `is_tax_inclusive` is disabled (which is the default), the promotion's discount amount will be applied as-is to the cart, before taxes are calculated. See an example in the [Tax-Exclusive Promotion Example](#tax-exclusive-promotion-example) section.
52
+
53
+
If `is_tax_inclusive` is enabled, the promotion's discount amount will first be reduced by the calculated tax amount (based on the [tax region's rate](../../tax/tax-region/page.mdx)). The reduced discount amount is then applied to the cart total. See an example in the [Tax-Inclusive Promotion Example](#tax-inclusive-promotion-example) section.
54
+
55
+
---
56
+
57
+
## How to Set a Promotion as Tax-Inclusive
58
+
59
+
<Notetitle="Looking for no-code approach?">
60
+
61
+
You can enable tax-inclusiveness for a promotion when [creating it in the Medusa Admin](!user-guide!/promotions/create).
62
+
63
+
</Note>
64
+
65
+
You can set the `is_tax_inclusive` property when creating a promotion by using either the [Promotion workflows](../workflows/page.mdx) or the [Promotion Module's service](/references/promotion).
66
+
67
+
<Note>
68
+
69
+
For most use cases, it's recommended to use [workflows](!docs!/learn/fundamentals/workflows) instead of directly using the module's service, as they implement the necessary rollback mechanisms in case of errors.
70
+
71
+
</Note>
72
+
73
+
For example, if you're creating a promotion with the [createPromotionsWorkflow](/references/medusa-workflows/createPromotionsWorkflow) in an API route:
const { result } =awaitcreatePromotionsWorkflow(req.scope)
87
+
.run({
88
+
input: {
89
+
promotionsData: [{
90
+
code: "10OFF",
91
+
// ...
92
+
is_tax_inclusive: true,
93
+
}],
94
+
}
95
+
})
96
+
97
+
res.send(result)
98
+
}
99
+
```
100
+
101
+
In the above example, you set the `is_tax_inclusive` property to `true` when creating the promotion, making it tax-inclusive.
102
+
103
+
### Updating a Promotion's Tax-Inclusiveness
104
+
105
+
A promotion's tax-inclusiveness cannot be updated after it has been created. If you need to change a promotion's tax-inclusiveness, you must delete the existing promotion and create a new one with the desired `is_tax_inclusive` value.
106
+
107
+
---
108
+
109
+
## Tax-Inclusiveness Examples
110
+
111
+
The following sections provide examples of how tax-inclusive promotions work in different scenarios, including both tax-exclusive and tax-inclusive promotions.
112
+
113
+
These examples will help you understand how tax-inclusive promotions affect the cart total, allowing you to decide when to use them effectively.
114
+
115
+
### Tax-Exclusive Promotion Example
116
+
117
+
Consider the following scenario:
118
+
119
+
- A tax-exclusive promotion gives a `$10` discount on the cart's total.
120
+
- The cart's tax region has a `25%` tax rate.
121
+
- The cart total before applying the promotion is `$100`.
122
+
-[The prices in the cart's tax region are tax-exclusive](../../pricing/tax-inclusive-pricing/page.mdx).
0 commit comments