Links between Sales Channel Module and Other Modules

This document showcases the module links defined between the Sales Channel Module and other commerce modules.

Summary#

The Sales Channel Module has the following links to other modules:

TipRead-only links are used to query data across modules, but the relations aren't stored in a pivot table in the database.

API Key Module#

A publishable API key allows you to easily specify the sales channel scope in a client request.

Medusa defines a link between the ApiKey and the SalesChannel data models.

A diagram showcasing an example of how resources from the Sales Channel and API Key modules are linked

Retrieve with Query#

To retrieve the API keys associated with a sales channel with Query, pass publishable_api_keys.* in fields:

To manage the sales channels of an API key, use Link:


Cart Module#

Medusa defines a read-only link between the SalesChannel data model and the Cart Module's SalesChannel data model. This means you can retrieve the details of a sales channel's carts, but you don't manage the links in a pivot table in the database. The sales channel of a cart is determined by the sales_channel_id property of the Cart data model.

Retrieve with Query#

To retrieve the carts of a sales channel with Query, pass carts.* in fields:


Order Module#

Medusa defines a read-only link between the SalesChannel data model and the Order Module's Order data model. This means you can retrieve the details of a sales channel's orders, but you don't manage the links in a pivot table in the database. The sales channel of an order is determined by the sales_channel_id property of the Order data model.

Retrieve with Query#

To retrieve the orders of a sales channel with Query, pass orders.* in fields:


Product Module#

A product has different availability for different sales channels. Medusa defines a link between the Product and the SalesChannel data models.

A diagram showcasing an example of how resources from the Sales Channel and Product modules are linked

A product can be available in more than one sales channel. You can retrieve only the products of a sales channel.

Retrieve with Query#

To retrieve the products of a sales channel with Query, pass products.* in fields:

To manage the sales channels of a product, use Link:


Stock Location Module#

A stock location is associated with a sales channel. This scopes inventory quantities associated with that stock location by the associated sales channel.

Medusa defines a link between the SalesChannel and StockLocation data models.

A diagram showcasing an example of how resources from the Sales Channel and Stock Location modules are linked

Retrieve with Query#

To retrieve the stock locations of a sales channel with Query, pass stock_locations.* in fields:

To manage the stock locations of a sales channel, use Link:

Was this page helpful?
Edit this page