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:
First Data Model | Second Data Model | Type | Description |
---|---|---|---|
Cart in Cart Module | Stored - many-to-many | ||
Read-only - has one | |||
Stored - many-to-many |
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 Cart Module's LineItemAdjustment
data model and the Promotion
data model. Because the link is read-only from the LineItemAdjustment
's side, you can only retrieve the promotion applied on a line item, and not the other way around.
Retrieve with Query#
To retrieve the carts that a promotion is applied on with Query, pass carts.*
in fields
:
promotion.*
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: