Regions API Routes
Regions are different countries or geographical regions that the commerce store serves customers in.
These API routes allow admin users to manage regions, their providers, and more.
GET /admin/regions#
List Regions
Retrieve a list of regions. The regions can be filtered by fields such as id. The regions can also be sorted or paginated.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ 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.offsetnumberOptionallimitnumberOptionalorderstringOptional-.qstringOptionalidstring | string[]Optionalnamestring | string[]Optionalcreated_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptional$andobject[]Optional$orobject[]Optionalcurrency_codestring | string[]Optionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberregionsobject[]The list of regions.
regionsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/regions#
Create Region
Create a region.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ 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)
namestringcurrency_codestringusdcountriesstring[]Optionalautomatic_taxesbooleanOptionalis_tax_inclusivebooleanOptionalpayment_providersstring[]OptionalmetadataobjectOptionalRequest examples
Responses
200 OK
regionobjectThe region's details.
regionobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
region.created: Emitted when regions are created.
GET /admin/regions/{id}#
Get a Region
Retrieve a region by its ID. You can expand the region's relations or select the fields that should be returned.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ 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
regionobjectThe region's details.
regionobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/regions/{id}#
Update a Region
Update a region's details.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ 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)
namestringOptionalcurrency_codestringOptionalcountriesstring[]Optionalautomatic_taxesbooleanOptionalpayment_providersstring[]OptionalmetadataobjectOptionalis_tax_inclusivebooleanOptionalRequest examples
Responses
200 OK
regionobjectThe region's details.
regionobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
region.updated: Emitted when regions are updated.
DELETE /admin/regions/{id}#
Delete a Region
Delete a region.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "region"
deletedboolean400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
region.deleted: Emitted when regions are deleted.