Fetch inventory balance
You can retrieve balance for an entire
STORE
inventory or for specific products within that inventory.- Make sure that authorisation is set up with the following OAuth scope using OAuth API:
READ:PRODUCT
- Make sure that inventory tracking is enabled. See Enable and disable inventory tracking.
When fetching inventory balance for all stores, the balance data can be big. If the response includes the
Link
header, that means the response contains more than one page.To fetch the subsequent pages to get a complete inventory balance data for all stores, you need to call the URL that is specified in the
Link
header until the response does not include that header.- Send a request to start fetching inventory balance for all stores. Check whether the response includes the
Link
header.Example: The following example response includes theLink
header. That means you need to fetch the subsequent pages to get a complete inventory balance data for all stores, as there is more than one page for inventory balance for all stores.Response headerLINK: <https://inventory.izettle.com/v3/stock?cursor=81f69e53-e25a-11ec-bb66-2bc1878b8583&limit=100>; rel="next"
Response body - If the previous response includes the
Link
header, send a request to the URL in theLink
header. - Repeat step 2 until the response does not include the
Link
header. That means inventory balance for all stores are fetched.
When fetching inventory balance of a
STORE
inventory, you fetch the total stock of all product variants in that inventory.- Send a request to start fetching inventory balance. Check whether the response includes the
Link
header.Example: This call retrieves stock for the inventoryUuid6e5e8d52-5ce0-11ec-bf63-0242ac130002
.RequestResponse headerLINK: <https://inventory.izettle.com/v3/stock/fd4a39a0-e2ef-11e6-ba64-85247ae2a737?cursor=81f69e53-e25a-11ec-bb66-2bc1878b8583&limit=100>; rel="next"
Response body - If the previous response includes the
Link
header, send a request to the URL in the header. - Repeat step 2 until the response does not include the
Link
header. That means all the inventory balance is fetched.
If you want to fetch balances of a few products instead of all products in a
STORE
inventory, specify UUIDs of those products and separate them with a comma in the request body.Example: This example retrieves the balances for products
b9675342-5ce0-11ec-bf63-0242ac130002
and 24977020-5ce1-11ec-bf63-0242ac130002
in the inventory 6e5e8d52-5ce0-11ec-bf63-0242ac130002
.Request
Request body
Response
This request returns inventory balance of a specific product in a
STORE
inventory.Example: This call fetches balance of the product with
productUuid
as b9675342-5ce0-11ec-bf63-0242ac130002
in an inventory with inventoryUuid
as 6e5e8d52-5ce0-11ec-bf63-0242ac130002
.Request
Response
By specifying a timestamp in the request, you can fetch balance updates that are made since the time for all
STORE
inventories. Balances with timestamps newer than or equal to the provided timestamp will be returned.Example: Fetch balance updates of all
STORE
inventories since 1 January, 2021.Request
Response
To find deleted product or product variants, do one of the following:
- Fetch the inventory balance for all stores regularly and compare newer and older versions. See Fetch inventory balance for all stores.
- Fetch all products by calling the Product Library API and find when a product or variant is removed.