Stock
Stock updates with processing queue, atomic claim and relative reindex — designed for high-volume scenarios.
Overview
The stock endpoint has been reinforced for higher robustness in high-volume scenarios, with queue-based processing and relative reindex. The update accepts identification by SKU or by ID depending on the type field.
The same route now also serves a read-only lookup of a product's stock configuration, including its effective salability.
Product stock lookup New
Read-only operation: it does not change stock, does not enqueue anything, does not save the product and does not trigger reindexing.
Fetch the stock configuration of a product by SKU or ID.
GET /api2/stock?id=3291&type=sku
Authorization: Bearer {access_token}
GET /api2/stock?id=2074&type=id
Authorization: Bearer {access_token}
GET /api2/stock?id=3291&type=sku&store_id=1&customer_group_id=0
Authorization: Bearer {access_token}
Parameters
type.id is interpreted: id or sku.0.Response example
{
"success": true,
"product_id": 2074,
"sku": "3291",
"type": "simple",
"context": {
"store_id": 1,
"website_id": 1,
"customer_group_id": 0,
"store": {"id": 1, "code": "default", "name": "Português (Brasil)"},
"website": {"id": 1, "code": "cafe", "name": "Main Website"},
"customer_group": {"id": 0, "name": "Guest"}
},
"inventory": {
"inventory_manage_stock": true,
"inventory_use_config_manage_stock": true,
"inventory_qty": "38.0000",
"inventory_min_qty": "0.0000",
"inventory_use_config_min_qty": true,
"inventory_min_sale_qty": null,
"inventory_use_config_min_sale_qty": true,
"inventory_max_sale_qty": "10000.0000",
"inventory_use_config_max_sale_qty": true,
"inventory_is_qty_decimal": false,
"inventory_backorders": "none",
"inventory_use_config_backorders": true,
"inventory_notify_stock_qty": "1.0000",
"inventory_use_config_notify_stock_qty": true,
"inventory_enable_qty_increments": false,
"inventory_use_config_enable_qty_increments": true,
"inventory_qty_increments": null,
"inventory_use_config_qty_increments": true,
"inventory_stock_availability": "in_stock",
"inventory_stock_availability_label": "In Stock",
"inventory_is_salable": true
}
}
Mapping to the Yep Platform
| Field in the Yep Platform | REST field |
|---|---|
| Manage Stock | inventory_manage_stock |
| Qty | inventory_qty |
| Out-of-Stock Threshold | inventory_min_qty |
| Minimum Qty Allowed in Cart | inventory_min_sale_qty |
| Maximum Qty Allowed in Cart | inventory_max_sale_qty |
| Qty Uses Decimals | inventory_is_qty_decimal |
| Backorders | inventory_backorders |
| Notify for Quantity Below | inventory_notify_stock_qty |
| Enable Qty Increments | inventory_enable_qty_increments |
| Qty Increments | inventory_qty_increments |
| Stock Availability | inventory_stock_availability |
| Effective salability | inventory_is_salable |
inventory_use_config_* indicates whether the value is inherited from the global configuration. When use_config is active, the main field represents the value effectively used by the Yep Platform.Availability: an important distinction
in_stock and out_of_stock, paired with inventory_stock_availability_label (In Stock or Out of Stock).none, allow_below_zero and allow_below_zero_and_notify.These two fields are not synonyms
You may receive inventory_stock_availability: "in_stock" together with inventory_is_salable: false. This is not an inconsistency: the first field represents the configured stock state; the second represents the platform's effective decision.
Configurable products
For configurable products, inventory_qty: null is a valid and expected result — the API does not sum the quantities of the associated products. To determine effective availability, use inventory_is_salable.
null values
Some inherited values may return null when there is no effective configuration applicable in that context.
{
"inventory_min_sale_qty": null,
"inventory_use_config_min_sale_qty": true
}
HTTP responses
| Scenario | Status |
|---|---|
| Success | 200 |
| Invalid parameters | 400 |
| Missing authentication or invalid token | 401 |
| Not allowed | 403 |
| Product not found | 404 |
| Internal failure | 500 |
Update or set stock by SKU or ID.
{
"type": "sku",
"sku": "novo_produto",
"qty": 27,
"stock_id": 1
}
type.Parameters
sku or id.type=sku.