Skip to main content
Skip to main content

Relations between Sales Channel Module and Other Modules

When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules.

This document showcases the relation between the Sales Channel Module and other Commerce Modules.

Product Module

A product has different availability for different sales channels. The Medusa application forms a relation between the Product and the SalesChannel data models.

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

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


Cart Module

A cart is associated with the sales channel it's created in. The Medusa application forms a relation between the Cart and the SalesChannel data models.

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

For example, if a customer adds an item to the cart in a mobile app, the cart is associated with the mobile app's sales channel. However, if a customer adds an item to the cart in a web storefront, the cart is associated with the storefront's sales channel.


Order Module

An order is associated with the sales channel it's created in. The Medusa application forms a relation between the Order and the SalesChannel data models.

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

For example, if an order is created in a mobile app, it'll be associated with its sales channel. If another order is created through a POS system, it'll be associated with the POS's sales channel.


API Key Module

A publishable API key allows you to easily specify the sales channel scope in a client request. The Medusa application forms a relation 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

Using the API Key Module, you create a publishable key and associate it with a sales channel.

Instead of passing the sales channel's ID in every request either in the query or body parameters, you always pass the API key in the header of your requests. The Medusa application then infers the sales channel scope from it.

Was this section helpful?