- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Promotion Module
The Promotion Module provides promotion-related features in your Medusa and Node.js applications.
How to Use the Promotion Module's Service#
You can use the Promotion Module's main service by resolving from the Medusa container the resource Modules.PROMOTION
imported from @medusajs/framework/utils
.
For example:
Features#
Discount Functionalities#
A promotion discounts an amount or percentage of a cart's items, shipping methods, or the entire order.
The Promotion Module allows you to store and manage promotions.
Flexible Promotion Rules#
A promotion has rules that restricts when it's applied.
For example, you can create a promotion that's only applied to VIP customers.
1const promotion = await promotionModuleService.createPromotions({2 code: "10%OFF",3 type: "standard",4 application_method: {5 type: "percentage",6 target_type: "order",7 value: "10",8 currency_code: "usd",9 },10 rules: [11 {12 attribute: "customer_group_id",13 operator: "eq",14 values: ["VIP"],15 },16 ],17})
Campaign Management#
A campaign combines promotions under the same conditions, such as start and end dates.
A campaign can also have an identifier for tracking purposes, such as tracking through tools like Google Analytics.