Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.89 KB

inventory.adoc

File metadata and controls

56 lines (40 loc) · 1.89 KB

Inventory Service API

Service Description

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.

API Documentation


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.

Example 1:

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

Example 2:

PUT /organizations/{organizationUuid}/inventory

I have 30 in stock and want to set to 40, then we move 10 stock from SUPPLIER to STORE

  "productUuid": <uuid>
  "variantUuid": <uuid>,
  "fromLocationUuid": <SUPPLIER_location_uuid>,
  "toLocationUuid": “<STORE_location_uuid>,
  "change": 10