How inventories work

Inventory management includes tracking of inventory levels, orders, and sales across channels and locations. The Zettle Inventory service keeps track of the stock level for product variants.
Through the Zettle Inventory API, client applications can list current stock levels and update product balances.
The service automatically decreases the stock when a purchase is made within the POS system.

Tracking

The Inventory service provides handling and tracking of items in the product library. Sales through the POS system will automatically be tracked and the inventory is updated accordingly.
You must first enable tracking of products, in order for the inventory system to automatically keep the balance updated as a result ongoing purchases. Product tracking can be enabled/disabled at any time.

Inventory flow

The Inventory service keeps track of inventory balances by moving product items between so-called inventories.
By default, the Inventory API provides a STORE, a SUPPLIER, a BIN, and a SOLD inventory. These inventories are created automatically by the service when tracking is enabled for a product. Optionally, using the Inventory API, you can create more inventories.
An inventory can be seen as a bucket containing individual balances for product variants. In a typical setup, a merchant has a single main physical store room or warehouse. This inventory corresponds to the STORE type in the Inventory service. This represents the inventory of the current available stock for a product variant.
The system also has a number of virtual Inventory types that are used for bookkeeping:
  • SOLD. Sold items all are moved to this Inventory type.
  • BIN. Items that have been discarded are moved to this Inventory type. Also used for emptying an inventory.
  • SUPPLIER. Restocked items are pulled from this Inventory type. This holds infinite stock.
Stock balance flow from SUPPLIER to STORE and either BIN or SOLD

Inventory UUIDs

When a merchant is authenticated to use your integration, the Inventory service creates an inventory with a corresponding identifier UUID associated with the merchant's organisation. This inventory UUID is then used to perform various inventory operations.

Updating inventory balances

A product's inventory balance is updated by transferring an inventory amount for a product variant from one inventory to another. Multiple updates can be made with a single request.
  • Purchase. Move from STORE to SOLD.
  • Re-stock. Move from SUPPLIER to STORE.
  • Empty inventory. Move from STORE to BIN.
Example: Purchase of a specific product.
1
POST /movements
The request body contains the parameters for the inventory flow. For a purchase product item, the item is moved from from STORE to SOLD inventories.
1
{
2
"movements": [
3
{
4
"productUuid": "{{product_uuid}}",
5
"variantUuid": "{{product_variant_uuid}}",
6
"change": 20000000,
7
"from": "{{store_location_uuid}}",
8
"to": "{{sold_location_uuid}}"
9
}
10
]
11
}

Event notifications

Inventory balance updates can be the result of either a purchase event, or an explicit API update request. Such a request will trigger webhook event notifications for balance updates similar to purchase events.

Setting inventory balances

To set an absolute stock value of a variant, fetch the current variant balance and calculate the difference between it and the wanted value. Then send the difference to the server.
Example: A white small size T-shirt is a product variant you sell. It has a stock value of 30 in the STORE inventory. Now you want to set that to 20.
To do this, you move 10 stock to the SOLD, BIN or SUPPLIER inventory, depending on the reason for the stock change. Always move positive numbers.
1
POST /movements
1
{
2
"movements": [
3
{
4
"productUuid": "{{product_uuid}}",
5
"variantUuid": "{{product_variant_uuid}}",
6
"change": 10,
7
"from": "{{store_location_uuid}}",
8
"to": "{{sold_location_uuid}}"
9
}
10
]
11
}
Example: You have 30 in stock and want to set to 40. You then move 10 stock from SUPPLIER to STORE.
1
POST /movements
1
{
2
"movements": [
3
{
4
"productUuid": "{{product_uuid}}",
5
"variantUuid": "{{product_variant_uuid}}",
6
"change": 10,
7
"from": "{{supplier_location_uuid}}",
8
"to": "{{store_location_uuid}}"
9
}
10
]
11
}

Retrieving inventory balances

Stock levels can be accessed per product, as list of all items for the inventory or as a list of all items of type STORE.
Example: Retrieve stock levels for a given inventory UUID.
1
GET /stock/{inventoryUuid}
The response will contain the all the available data for product variants that are available.
See Fetch inventory stock levels for more details.

Low stock management

A low stock threshold level is a quantity you can set to help merchants manage the inventory. It is the minimum amount of inventory a merchant wants to have on hand.
When a low stock threshold is set, the merchant will receive an indication in the Go app that replenishment is needed for a specific product and location.