Stock Locations API Routes

A stock location is where stock-kept items (products) are kept.

Stock locations are linked to fulfillment providers used to fulfill items from this location.

A stock location is also link to a fulfillment set, indicating where an item is fulfilled from when an order is placed.

These API routes allow admin users to manage stock locations and their linked data.

GET /admin/stock-locations#

List Stock Locations

Retrieve a list of stock locations. The stock locations can be filtered by fields such as id. The stock locations 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 stock location's searchable properties.
idstring | string[]Optional
Filter by a stock location ID.
namestring | string[]Optional
Filter by a stock location name.
address_idstring | string[]Optional
Filter by an address ID to retrieve its associated locations.
sales_channel_idstring | string[]Optional
Filter by a sales channel ID to retrieve its associated locations.
created_atobjectOptional
Filter by a stock location's creation date. Accepts the filter operators.
updated_atobjectOptional
Filter by a stock location's update date. Accepts the filter operators.
deleted_atobjectOptional
Filter by a stock location's deletion date. Accepts the filter operators.
$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.
stock_locationsobject[]
The list of stock locations.
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.


POST /admin/stock-locations#

Create Stock Location

Create a stock location.

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.

Request body (application/json)

namestring
The stock location's name.
address_idstringOptional
The ID of the stock location's address.
addressobjectOptional
The details of the stock location address to create.
metadataobjectOptional
The stock location's metadata, used to store custom key-value pairs. Learn more in the Manage Metadata section.

Request examples

Responses

200 OK

stock_locationobject
The stock location's details.

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


GET /admin/stock-locations/{id}#

Get a Stock Location

Retrieve a stock location by its ID. You can expand the stock location'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 stock location'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

stock_locationobject
The stock location's details.

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


POST /admin/stock-locations/{id}#

Update a Stock Location

Update a stock location's details.

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

Path parameters

idstring
The stock location'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 stock location's name.
addressobjectOptional
The details of the stock location address to create.
address_idstringOptional
The ID of an existing stock location address to associate the stock location with.
metadataobjectOptional
The stock location's metadata, can hold custom key-value pairs. Learn more in the Manage Metadata section.

Request examples

Responses

200 OK

stock_locationobject
The stock location's details.

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


DELETE /admin/stock-locations/{id}#

Delete a Stock Location

Delete a stock location.

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

Path parameters

idstring
The stock location's ID.

Request examples

Responses

200 OK

idstring
The stock location's ID.
objectstring
The name of the deleted object.

Default: "stock_location"

deletedboolean
Whether the stock location was deleted.

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


POST /admin/stock-locations/{id}/fulfillment-providers#

Manage Fulfillment Providers of a Stock Location

Manage the fulfillment providers to add or remove them from a stock location.

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

Path parameters

idstring
The stock location'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)

addstring[]Optional
The IDs of an entity to add to the other.
removestring[]Optional
The IDs of an entity to remove from the other.

Request examples

Responses

200 OK

stock_locationobject
The stock location's details.

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


POST /admin/stock-locations/{id}/fulfillment-sets#

Add Fulfillment Set to Stock Location

Create and add a fulfillment set to a stock location.

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

Path parameters

idstring
The stock location'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)

namestring
The fulfillment set's name.
typestring
The fulfillment set's type.

Request examples

Responses

200 OK

stock_locationobject
The stock location's details.

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


POST /admin/stock-locations/{id}/sales-channels#

Manage Sales Channels of a Stock Location

Manage the sales channels in a stock location by adding or removing them.

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

Path parameters

idstring
The stock location'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)

addstring[]Optional
The IDs of an entity to add to the other.
removestring[]Optional
The IDs of an entity to remove from the other.

Request examples

Responses

200 OK

stock_locationobject
The stock location'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