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:
| Field | Description |
|---|---|
| barcode | The barcode of the physical product |
| warehouse | The name of the warehouse (logistics partner) holding the stock. null if not known |
| product_id | The 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_id | The ID of the Product Variation this barcode belongs to. null if the barcode belongs to the Product itself, or is not assigned |
| quantity | The current available quantity, as reported by the logistics partner |
| updated_at | The date and time of the last stock update, in ISO8601 format |