- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Links between Promotion Module and Other Modules
This document showcases the module links defined between the Promotion Module and other commerce modules.
Summary#
The Promotion Module has the following links to other modules:
Cart
data model of the Cart Module <>Promotion
data model.LineItemAdjustment
data model of the Cart Module <>Promotion
data model. (Read-only).Order
data model of the Order Module <>Promotion
data model.
Cart Module#
A promotion can be applied on line items and shipping methods of a cart. Medusa defines a link between the Cart
and Promotion
data models.
Medusa also defines a read-only link between the Promotion
data model and the Cart Module's LineItemAdjustment
data model. This means you can retrieve the details of the promotion applied on a line item, but you don't manage the links in a pivot table in the database. The promotion of a line item is determined by the promotion_id
property of the LineItemAdjustment
data model.
Retrieve with Query#
To retrieve the carts that a promotion is applied on with Query, pass carts.*
in fields
:
line_item_adjustments.*
in fields
.Manage with Link#
To manage the promotions of a cart, use Link:
Order Module#
An order is associated with the promotion applied on it. Medusa defines a link between the Order
and Promotion
data models.
Retrieve with Query#
To retrieve the orders a promotion is applied on with Query, pass orders.*
in fields
:
Manage with Link#
To manage the promotion of an order, use Link: