Stores API Routes

A store holds the main configuration and information of your commerce store, such as supported currencies or default sales channel.

By default, the MedusaGo application has one default store. There are no API routes to create more stores. Instead, you'd have to handle that customization manually.

These API routes allow admin users to manage their store.

GET /admin/stores#

List Stores

Retrieve a list of stores. The stores can be filtered by fields such as id. The stores can also be sorted or paginated.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
offsetnumberOptional
The number of items to skip when retrieving a list.
limitnumberOptional
Limit the number of items returned in the list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
qstringOptional
Search term to filter the store's searchable properties.
idstring | string[]Optional
Filter by a store ID.
namestring | string[]Optional
Filter by a store name.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
with_deletedbooleanOptional
Whether to include deleted records in the result.

Request examples

Responses

200 OK

limitnumber
The maximum number of items returned.
offsetnumber
The number of items skipped before retrieving the returned items.
countnumber
The total number of items.
storesobject[]
The list of stores.
estimate_countnumberOptional
The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.

400, 401, 404, 409, 422, 500: an error response is returned.


GET /admin/stores/{id}#

Get a Store

Retrieve a store by its ID. You can expand the store's relations or select the fields that should be returned.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The store's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request examples

Responses

200 OK

storeobject
The store's details.

400, 401, 404, 409, 422, 500: an error response is returned.


POST /admin/stores/{id}#

Update a Store

Update a store's details.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The store's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request body (application/json)

namestringOptional
The store's name.
supported_currenciesobject[]Optional
The store's supported currencies.
default_sales_channel_idstringOptional
The ID of the default sales channel in the store.
default_region_idstringOptional
The ID of the default region in the store.
default_location_idstringOptional
The ID of the default stock location in the store.
metadataobjectOptional
The store's metadata, can hold custom key-value pairs. Learn more in the Manage Metadata section.
supported_localesobject[]Optional
The store's supported locales.

Request examples

Responses

200 OK

storeobject
The store's details.

400, 401, 404, 409, 422, 500: an error response is returned.

Found a problem with this page?Report Issue
Edited Nov 14·Edit this page