Links between Region Module and Other Modules

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

Summary#

The Region 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.

Cart Module#

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

Retrieve with Query#

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


Order Module#

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

Retrieve with Query#

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


Payment Module#

You can specify for each region which payment providers are available for use.

Medusa defines a module link between the PaymentProvider and the Region data models.

A diagram showcasing an example of how resources from the Payment and Region modules are linked

Retrieve with Query#

To retrieve the payment providers of a region with Query, pass payment_providers.* in fields:

To manage the payment providers in a region, use Link:

Was this page helpful?
Edited Jan 6·Edit this page
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break