SKUs
The SKU object and the allowed CRUD operations on the related resource endpoint
SKUs describe specific product variations that are being sold. A unique code
identifies each SKU, which can be either the EAN code, the UPC, or any other code format.
The SKU name
, description
, and image_url
are best suited for internal usage (Commerce Layer is not a CMS).
By marking an SKU with the do_not_ship
and do_not_track
combinable flags, is possible to manage different scenarios, such as intangible products which generate no shipments, or products with a virtually infinite stock.
When creating an SKU you need to specify its shipping category, unless the SKU is marked as do_not_ship
, in which case the relationship with the shipping category is optional.
Inventory information
For performance reasons the inventory
attribute is returned when retrieving a single SKU only.
The related aggregated information about the SKU's inventory considers the active markets in scope only.
Field | Type | Description |
---|---|---|
inventory.available |
| The SKU availability, based on the stock items associated with the stock location in scope — |
inventory.quantity |
| The sum of the SKU's stock item quantities in the stock locations in scope (net of the related reserved stock quantities). |
inventory.levels |
| Aggregated information by stock location, including stock item quantity and available delivery lead times (ordered by shipping method cost, ascending). |
Checking real-time stock availability
You can fetch via API a list of SKUs and include the stock_items.reserved_stock
relationships, but in order to get the real-time stock availability you need to perform some additional computation on your side, based on the response payload:
Cycle the
included
payload for each SKU to get the sums ofstock_items
andreserved_stocks
quantities.Subtract the latter from the former to get the cross-stock availability for each SKU (you can also do distinct subtractions to get the per-stock SKU availability).
Last updated