To retrieve inventory at specific locations, you use the getInventory
endpoint with the locationIds
query parameter. This parameter allows you to specify one or more location IDs as a comma-separated list. For example:
GET /ccadmin/v1/inventories/xsku5014?locationIds=Cambridge_MA,Waltham_MA HTTP 1.1
Authorization: Bearer <access_token>
The response includes a locationInventoryInfo
array in which each entry is the inventory for one of the locations specified in the URL. For example:
{ "locationInventoryInfo": [ { "preorderThreshold": 0, "stockThreshold": 20, "availabilityStatus": 1000, "backorderThreshold": 0, "availabilityStatusMsg": "inStock", "backorderLevel": 0, "locationId": "Cambridge_MA", "preorderLevel": 0, "skuNumber": null, "availableToPromise": null, "translations": null, "availabilityDate": null, "inventoryId": null, "displayName": null, "stockLevel": 200 }, { "preorderThreshold": 0, "stockThreshold": 5, "availabilityStatus": 1000, "backorderThreshold": 0, "availabilityStatusMsg": "inStock", "backorderLevel": 0, "locationId": "Waltham_MA", "preorderLevel": 0, "skuNumber": null, "availableToPromise": null, "translations": null, "availabilityDate": null, "inventoryId": null, "displayName": null, "stockLevel": 22 } ], "links": [ { "rel": "self", "href": "https://myserver.example.com:7002/ccadmin/v1/inventories/xsku5014? locationIds=Cambridge_MA,Waltham_MA" } ], "skuNumber": "xsku5014", "skuId": "xsku5014", "displayName": "Titanium Analog Watch" }
You can include inventory for the default (online-only) inventory location as well by setting the includeDefaultLocationInventory
query parameter to true
. For example, the following call returns inventory for the default location as well as the Cambridge_MA
location:
GET /ccadmin/v1/inventories/xsku5014?
locationIds=Cambridge_MA&includeDefaultLocationInventory=true HTTP 1.1
Authorization: Bearer <access_token>
Note that if you do not use the locationIds
parameter to specify a non-default location, inventory for the default location is returned. This is the case even if you do not set includeDefaultLocationInventory
to true
. If you do use locationIds
, however, inventory for the default location is omitted unless you explicitly set includeDefaultLocationInventory
to true
.