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:

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

First Data Model

Second Data Model

Type

Description

Cart in Cart Module

Region

Read-only - has one

Learn more

Order in Order Module

Region

Read-only - has one

Learn more

Region

PaymentProvider in Payment Module

Stored - many-to-many

Learn more


Cart Module#

Medusa defines a read-only link between the Cart Module's Cart data model and the Region data model. Because the link is read-only from the Cart's side, you can only retrieve the region of a cart, and not the other way around.

Retrieve with Query#

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


Order Module#

Medusa defines a read-only link between the Order Module's Order data model and the Region data model. Because the link is read-only from the Order's side, you can only retrieve the region of an order, and not the other way around.

Retrieve with Query#

To retrieve the region of an order with Query, pass region.* 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?
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