Links between Store Credit Module and Other Modules
This document showcases the module links defined between the Store Credit Module and other Commerce Modules.
Summary#
The Store Credit Module has the following links to other modules:
First Data Model | Second Data Model | Type | Description |
|---|---|---|---|
|
| Read-only | |
|
| Stored - many-to-one |
Customer Module#
Medusa defines a read-only link between the StoreCreditAccount data model and the Customer Module's Customer data model. This means you can retrieve the customer associated with a store credit account, but you don't manage the links in a pivot table in the database. The customer of a store credit account is determined by the customer_id property of the StoreCreditAccount data model.
Retrieve with Query#
To retrieve the customer of a store credit account with Query, pass customer.* in fields:
Loyalty Module#
Medusa defines a link between the GiftCard in the Loyalty Module and StoreCreditAccount data models. This link is created when a gift card is created (alongside its store credit account) or when a gift card is redeemed.
This allows you to retrieve the store credit account associated with a gift card.
Retrieve with Query#
To retrieve the store credit account of a gift card with Query, pass store_credit_account.* in fields:
Manage with Link#
To manage the store credit account of a gift card, use Link: