Skip to content

Stock model

A Stock model represents the current stock level of one barcode (one physical product) in one warehouse of the site. Since a Product can have multiple barcodes, and a barcode can be stocked in multiple warehouses, a Product can appear in multiple Stock entries. To get the total stock of a barcode in the market, sum its entries across warehouses.

A Stock model has the following fields:

FieldDescription
barcodeThe barcode of the physical product
warehouseThe name of the warehouse (logistics partner) holding the stock. null if not known
product_idThe ID of the Product this barcode belongs to (the same ID as in the GET /product response). null if the barcode is not assigned to any Product
variation_idThe ID of the Product Variation this barcode belongs to. null if the barcode belongs to the Product itself, or is not assigned
quantityThe current available quantity, as reported by the logistics partner
updated_atThe date and time of the last stock update, in ISO8601 format