The Inventory Service keeps track of the stock level for variants within products. The API clients can list current stock levels and update balance for products. The service automatically decrease the stock when a purchase is made within the iZettle POS application.
For inventory we use a concept of transactions, where we always move stock between so called Locations
.
Locations are created automatically when tracking is enabled on any product. The locations that currently exists and the natural flow of stock balance is shown below:
> BIN
SUPPLIER > STORE
> SOLD
SUPPLIER
is an abstraction of a supplier and holds infinite stock.
STORE
is the location of the current stock for a variant.
BIN & SOLD
are abstractions for when a product is sold or discarded.
An important note is that you cannot directly set a stock balance for a variant. If you want to set an absolute value of a variant you need to calculate the change needed to reach that stock value.
PUT /organizations/{organizationUuid}/inventory
I have 30 stock in STORE
and I want to set that to 20. Then I move 10 stock to SOLD
, BIN
or SUPPLIER
location (depending on the reason for the stock change), note that we always move positive numbers.
"productUuid": <uuid>
"variantUuid": <uuid>,
"fromLocationUuid": <STORE_location_uuid>,
"toLocationUuid": “<SOLD_location_uuid>,
"change": 10