Inventory Items API Routes
An inventory item is a stock-kept product whose inventory is managed.
These API routes allow admin users to manage inventory items.
GET /admin/inventory-items#
List Inventory Items
Retrieve a list of inventory items. The inventory items can be filtered by fields such as id. The inventory items 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[]Optionalskustring | string[]Optionalorigin_countrystring | string[]Optionalmid_codestring | string[]Optionalhs_codestring | string[]Optionalmaterialstring | string[]Optionalrequires_shippingbooleanOptionalweightobjectOptionallengthobjectOptionalheightobjectOptionalwidthobjectOptionallocation_levelsobjectOptionalFilter by the inventory item's associated location IDs.
location_levelsobjectOptional$andobject[]Optional$orobject[]Optionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberinventory_itemsobject[]The inventory item's inventory items.
inventory_itemsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/inventory-items#
Create Inventory Item
Create an inventory item.
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)
skustringOptionalhs_codestringOptionalweightnumberOptionallengthnumberOptionalheightnumberOptionalwidthnumberOptionalorigin_countrystringOptionalmid_codestringOptionalmaterialstringOptionaltitlestringOptionaldescriptionstringOptionalrequires_shippingbooleanOptionalthumbnailstringOptionalmetadataobjectOptionallocation_levelsobject[]OptionalThe inventory item's location levels.
location_levelsobject[]Optionalunit_of_measurestringOptionalkgRequest examples
Responses
200 OK
inventory_itemobjectThe inventory item's details.
inventory_itemobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
inventory-item.created: Emitted when inventory items are created.inventory-level.created: Emitted when inventory levels are created.
POST /admin/inventory-items/export#
Export Inventory Items
Start an inventory items export process to retrieve a CSV of exported inventory items.
You'll receive in the response the transaction ID of the workflow generating the CSV file. To check the status of the execution, send a GET request to /admin/workflows-executions/export-inventory-items/:transaction-id.
Once the execution finishes successfully, a notification is created for the export. You can retrieve the notifications using the /admin/notification API route to retrieve the file's download URL.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
idstring | string[]OptionalqstringOptionalskustring | string[]Optionalorigin_countrystring | string[]Optionalmid_codestring | string[]Optionalhs_codestring | string[]Optionalmaterialstring | string[]Optionalrequires_shippingbooleanOptionalweightnumber | objectOptionallengthnumber | objectOptionalheightnumber | objectOptionalwidthnumber | objectOptionallocation_levelsobjectOptionalFilter by the inventory item's location levels.
location_levelsobjectOptionallimitnumberOptionaloffsetnumberOptionalorderstringOptional-.with_deletedbooleanOptionalfieldsstringOptional+ 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.$andobject[]Optional$orobject[]OptionalRequest examples
Responses
202 OK
transaction_idstring/admin/workflows-executions/export-inventory-items/:transaction-id400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/inventory-items/location-levels/batch#
Manage Inventory Levels
Manage inventory levels to create, update, or delete them.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Request body (application/json)
createobject[]OptionalThe inventory levels to create.
createobject[]Optionalupdateobject[]OptionalThe inventory levels to update.
updateobject[]Optionaldeletestring[]OptionalforcebooleanOptionalRequest examples
Responses
200 OK
createdobject[]OptionalThe created inventory levels.
createdobject[]Optionalupdatedobject[]OptionalThe updated inventory levels.
updatedobject[]Optionaldeletedstring[]Optional400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
inventory-level.created: Emitted when inventory levels are created.inventory-level.updated: Emitted when inventory levels are updated. This includes adjustments to the stocked or reserved quantity, such as during order fulfillment.inventory-level.deleted: Emitted when inventory levels are deleted.
GET /admin/inventory-items/{id}#
Get a Inventory Item
Retrieve a inventory item by its ID. You can expand the inventory item'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
inventory_itemobjectThe inventory item's details.
inventory_itemobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/inventory-items/{id}#
Update an Inventory Item
Update an inventory item'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)
skustringOptionalhs_codestringOptionalweightnumberOptionallengthnumberOptionalheightnumberOptionalwidthnumberOptionalorigin_countrystringOptionalmid_codestringOptionalmaterialstringOptionaltitlestringOptionaldescriptionstringOptionalrequires_shippingbooleanOptionalthumbnailstringOptionalmetadataobjectOptionalunit_of_measurestringOptionalkgRequest examples
Responses
200 OK
inventory_itemobjectThe inventory item's details.
inventory_itemobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
inventory-item.updated: Emitted when inventory items are updated.
DELETE /admin/inventory-items/{id}#
Delete Inventory Item
Delete an inventory item.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "inventory_item"
deletedboolean400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
inventory-item.deleted: Emitted when inventory items are deleted.
GET /admin/inventory-items/{id}/location-levels#
List Inventory Levels
Retrieve a list of inventory levels associated with an inventory item. The inventory levels can be filtered by fields like location_id. The inventory levels can also be paginated.
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.offsetnumberOptionallimitnumberOptionalorderstringOptional-.with_deletedbooleanOptionallocation_idstring | string[]OptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberinventory_levelsobject[]The inventory item's inventory levels.
inventory_levelsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/inventory-items/{id}/location-levels#
Create Inventory Level for Inventory Item
Create an inventory level for an inventory item.
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)
location_idstringstocked_quantitynumberOptionalincoming_quantitynumberOptionalRequest examples
Responses
200 OK
inventory_itemobjectThe inventory item's details.
inventory_itemobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
inventory-level.created: Emitted when inventory levels are created.
POST /admin/inventory-items/{id}/location-levels/batch#
Manage Inventory Levels of Inventory Item
Manage the inventory levels of an inventory item to create or delete them.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
createobject[]OptionalThe inventory levels to create.
createobject[]Optionalupdateobject[]OptionalThe inventory levels to update.
updateobject[]Optionaldeletestring[]OptionalforcebooleanOptionalRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
inventory-level.created: Emitted when inventory levels are created.inventory-level.updated: Emitted when inventory levels are updated. This includes adjustments to the stocked or reserved quantity, such as during order fulfillment.inventory-level.deleted: Emitted when inventory levels are deleted.
POST /admin/inventory-items/{id}/location-levels/{location_id}#
Update an Inventory Level of an Inventory Item
Updates the details of an inventory item's inventory level using its associated location ID.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringlocation_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)
stocked_quantitynumberOptionalincoming_quantitynumberOptionalRequest examples
Responses
200 OK
inventory_itemobjectThe inventory item's details.
inventory_itemobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
inventory-level.updated: Emitted when inventory levels are updated. This includes adjustments to the stocked or reserved quantity, such as during order fulfillment.
DELETE /admin/inventory-items/{id}/location-levels/{location_id}#
Remove Inventory Level of Inventory Item
Remove the inventory level of an inventory item.
If the inventory level has reserved quantity greater than 0, an error is thrown.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringlocation_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
idstringobjectstringdeletedbooleanparentobjectOptionalThe inventory item's details.
parentobjectOptional400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
inventory-level.deleted: Emitted when inventory levels are deleted.