Download OpenAPI specification:
Inventory related service API
Retrieves inventory for a list of skus provided based on site and optionally delivery country. You can also specify whether to avoid the cache when retrieving inventory information.
Note that although this is a POST request, nothing is created on the server. The POST verb is used because the request body is large and the GET verb has a limit on the size of the request body.
The payload schema describes the information required to retrieve inventory.
required | Array of objects List of skus to retrieve inventory information for. |
| siteKey required | string The id of the site to retrieve sku inventory for e.g. specsavers-gb |
| deliveryCountryCode | string The code of the country the sku will be delivered to. e.g. FR |
| live required | boolean If true, retrieve inventory from source system, otherwise check for a cached value first |
{- "items": [
- {
- "sku": "123",
- "fulfilmentCountryCode": "GB"
}
], - "siteKey": "specsavers-gb",
- "deliveryCountryCode": "GB",
- "live": true
}{- "data": { }
}Retrieves inventory for all skus. Optionally filtered by the query parameters siteKey or
fulfilmentCountryCode
Results can be paged using the query parameter limit along with a cursor using before or after query parameter.
| siteKey required | string The site key |
| limit | number [ 1 .. 500 ] The maximum number of results to return. 0 defaults to the maximum of 500 |
| before | string <= 10000 Cursor to retrieve results before. |
| after | string Cursor to retrieve results after. |
| fulfilmentCountryCode required | string The code of the country the sku will be fulfilled from. e.g. GB |
{- "data": {
- "items": [
- {
- "sku": "string",
- "inventory": {
- "quantity": 0,
- "inStock": true,
- "stockLevelLow": true,
- "fallback": true
}
}
], - "pageInfo": {
- "hasPreviousPage": true,
- "hasNextPage": true,
- "startCursor": "string",
- "endCursor": "string"
}, - "totalCount": 0
}
}Retrieves inventory for a single sku provided based on specified parameters. You can also specify whether to avoid the cache when retrieving inventory information.
| sku required | string The id of the sku to retrieve inventory information for. |
| siteKey required | string The site key |
| fulfilmentCountryCode required | string The code of the country the sku will be fulfilled from. e.g. GB |
| deliveryCountryCode | string The code of the country the sku will be delivered to. e.g. FR |
| live required | boolean If true, retrieve inventory from source system, otherwise check for a cached value first |
{- "data": { }
}The health endpoint.
{- "data": {
- "status": "pass",
- "version": "1.0",
- "releaseId": "1234567890",
- "service": "inventory",
- "details": {
- "time": "2023-11-15T12:19:05.737Z",
- "env": "dev",
- "commitId": "368de0fbdff3a5634895d69f8b17cbdfd5e77bfb"
}
}
}