Region Module

The Region Module provides region-related features in your Medusa and Node.js applications.

How to Use Region Module's Service#

You can use the Region Module's main service by resolving from the Medusa container the resource Modules.REGION imported from @medusajs/framework/utils.

For example:


What is a Region?#

A region represents the area you sell products in. Each region can cover multiple countries, but uses a single currency.


Features#

Region Management#

You can manage your regions to create, update, retrieve, or delete them.

Code
1const region = await regionModuleService.createRegions({2  name: "Europe",3  currency_code: "eur",4})

Multi-Currency Support#

As each region has a currency, you can support multiple currencies in your store by creating multiple regions.

Code
1const regions = await regionModuleService.createRegions([2  {3    name: "Europe",4    currency_code: "eur",5  },6  {7    name: "United States of America",8    currency_code: "usd",9  },10])

Different Settings Per Region#

Each region has its own settings, such as what countries belong to a region or its tax settings. Each region has different tax rates, payment providers, and more provided by other commerce modules.

Code
1const regions = await regionModuleService.createRegions([2  {3    name: "Europe",4    currency_code: "eur",5    countries: ["dk", "de", "fr", "it", "pt"],6    automatic_taxes: true,7  },8  {9    name: "United States of America",10    currency_code: "usd",11    countries: ["us"],12    payment_providers: ["stripe"],13  },14])
Was this page helpful?
Edit this page