Yep Platform logo
REST API · Yep Platform Technical documentation for certified integrations

Multi-inventory

Multi-inventory endpoints exposed under the Yep REST /api2 standard. They list active store warehouses, query and update stock distributed by warehouse (with automatic aggregation of the total) and read the warehouse breakdown inside order items.

REST JSON Bearer Token New in 2026

Overview

When the multi-inventory feature is active on the store, Yep distributes each product's stock across multiple warehouses (physical store, main depot, distribution centers etc.). This page covers the four related REST API surfaces: Warehouses (warehouse registry), Stockitems (per-warehouse stock with automatic aggregation), Products (with stock_data.warehouses) and the impact on Orders (warehouses per order item).

4
ResourcesWarehouses, stockitems, products and order items with warehouses.
auto
Aggregated totalTotal quantity recalculated automatically.
BatchBatch updates for high-volume sync.
2
Accepted formatsMap {code: qty} or list [{code, qty}].

General rules

Conventions shared by every multi-inventory endpoint. Base URL in examples: /api2. Protected endpoints require Authorization: Bearer {{token}} and Content-Type: application/json on POST/PATCH verbs.

  • These endpoints are part of the multi-inventory feature and inherit OAuth authentication, deterministic pagination and the Yep REST response shape.
  • Listings accept page, limit, include_pagination and filters via query string or JSON body.
  • The warehouses field accepts two shapes: map {code: qty} (compact shortcut) or list [{code, qty}] (more explicit; useful when the integration works with arrays).
  • When warehouses is sent, the product's aggregated total stock is recalculated automatically by the module's model. There is no need to send qty separately.

Warehouses

Store warehouse registry. By default, lists active warehouses only; use include_inactive=true for auditing or for integrations that need to see all of them.

GET/api2/warehouses

List warehouses.

ListingFilters
page, limit, include_pagination Optional
Standard pagination.
include_inactive Optional
When true, includes inactive warehouses. Default: active only.
store_id Optional
Filters warehouses linked to the store.
warehouse_id / id Optional
Returns a specific warehouse (singular response).
code Optional
Returns a specific warehouse by code (singular response).

Paginated listing

GET /api2/warehouses?page=1&limit=50&include_pagination=1
Authorization: Bearer {{token}}

By code

GET /api2/warehouses?code=main_depot
Authorization: Bearer {{token}}

Sample response — single warehouse

{
  "success": true,
  "warehouse": {
    "warehouse_id": 1,
    "code": "main_depot",
    "name": "Main depot",
    "status": 1
  }
}

Sample response — listing

{
  "success": true,
  "page": 1,
  "limit": 50,
  "total": 4,
  "last_page": 1,
  "has_next": false,
  "warehouses": [
    {"warehouse_id": 1, "code": "main_depot", "name": "Main depot",  "status": 1},
    {"warehouse_id": 2, "code": "store_sp",   "name": "São Paulo",   "status": 1},
    {"warehouse_id": 3, "code": "store_rj",   "name": "Rio store",   "status": 1},
    {"warehouse_id": 4, "code": "dc_north",   "name": "DC North",    "status": 0}
  ]
}
List responses use the warehouses key. Lookup by id or single code uses the warehouse key.

Stockitems

Query and update stock per warehouse. The response always includes a warehouses field with the breakdown per warehouse and the aggregated total qty.

GET/api2/stockitems

List stock per warehouse.

ListingMulti-SKU
page, limit, include_pagination Optional
Standard pagination.
id / item_id / stock_item_id Optional
Stock item ID. Accepts a single value, CSV or array.
product_id Optional
Product ID. Accepts a single value, CSV or array.
sku Optional
Product SKU. Accepts a single value, CSV or array.

Paginated listing

GET /api2/stockitems?page=1&limit=50&include_pagination=1
Authorization: Bearer {{token}}

By stock item ID

GET /api2/stockitems?id=456
Authorization: Bearer {{token}}

By product ID

GET /api2/stockitems?product_id=123
Authorization: Bearer {{token}}

By single SKU

GET /api2/stockitems?sku=PRODUCT-001
Authorization: Bearer {{token}}

By multiple SKUs (JSON body)

{
  "sku": ["PRODUCT-001", "PRODUCT-002"],
  "include_pagination": true
}

Sample response — single item

{
  "success": true,
  "stockitem": {
    "item_id": 456,
    "stock_item_id": 456,
    "stock_id": 1,
    "product_id": 123,
    "sku": "PRODUCT-001",
    "name": "Product 001",
    "qty": 15,
    "is_in_stock": 1,
    "manage_stock": 1,
    "use_config_manage_stock": 1,
    "backorders": 0,
    "min_qty": 0,
    "min_sale_qty": 1,
    "warehouses": {
      "main_depot": 10,
      "store_sp": 5
    }
  }
}
List responses use the stockitems key; single lookups use stockitem. The qty field is the sum of per-warehouse quantities — recalculated automatically. The item_id and stock_item_id point to the same record and can be used interchangeably in queries and updates.
PATCH/api2/stockitems

Update per-warehouse stock. Identify the stock item with id, item_id or stock_item_id; or identify by product with product_id or sku. The endpoint also accepts POST for integrations that cannot send PATCH.

PATCH/POSTTotal recalculated

By stock item ID

PATCH /api2/stockitems
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "id": 456,
  "warehouses": {
    "main_depot": 10,
    "store_sp": 5
  }
}

By SKU (warehouses map)

PATCH /api2/stockitems
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "sku": "PRODUCT-001",
  "warehouses": {
    "main_depot": 10,
    "store_sp": 5
  }
}

Nested under stock_data with management flags

PATCH /api2/stockitems
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "product_id": 123,
  "stock_data": {
    "is_in_stock": 1,
    "manage_stock": 1,
    "warehouses": {
      "main_depot": 10
    }
  }
}

Total recalculated automatically

When warehouses is sent, the aggregated qty is recalculated by the module's model. Do not send qty manually — it will be overridden by the sum of per-warehouse quantities.

PATCH/api2/stockitems

Batch update — send an array of objects in the body. Each item follows the same rules as the simple PATCH. Accepts both warehouses shapes (map or list).

BatchMass sync
PATCH /api2/stockitems
Authorization: Bearer {{token}}
Content-Type: application/json

[
  {
    "sku": "PRODUCT-001",
    "warehouses": {
      "main_depot": 10
    }
  },
  {
    "sku": "PRODUCT-002",
    "warehouses": [
      {"code": "main_depot", "qty": 3},
      {"code": "store_sp", "qty": 2}
    ]
  }
]
The list shape ([{code, qty}]) is especially useful for integrations that serialize data from a relational database (one row per warehouse).

Warehouses inside Products

When the multi-inventory feature is active, the Products endpoints start including stock_data.warehouses in the responses, preserving compatibility with the stock_data semantics already consumed by catalog integrations.

GET /api2/products?type=sku&id=PRODUCT-001
Authorization: Bearer {{token}}
GET /api2/products?page=1&limit=50&include_pagination=1
Authorization: Bearer {{token}}
{
  "success": true,
  "product": {
    "product_id": 123,
    "sku": "PRODUCT-001",
    "name": "Product 001",
    "stock_data": {
      "qty": 15,
      "is_in_stock": 1,
      "warehouses": {
        "main_depot": 10,
        "store_sp": 5
      }
    }
  }
}
When the multi-inventory feature is inactive, stock_data.warehouses simply does not appear in the response — existing integrations continue to work without changes.

Warehouses inside order items

When the multi-inventory feature is active, the Orders endpoints include a warehouses field inside each item of the response — indicating which warehouses fulfilled each quantity.

GET /api2/order?id=100
Authorization: Bearer {{token}}
{
  "success": true,
  "order": {
    "order_id": 100,
    "increment_id": "100000100",
    "items": [
      {
        "item_id": 10,
        "sku": "PRODUCT-001",
        "qty_ordered": 2,
        "warehouses": {
          "main_depot": 2
        }
      }
    ]
  }
}
Behavior is identical to the legacy /api/rest/orders in multi-inventory environments. When the module is inactive, the warehouses field simply does not appear in items.

Supported usage patterns

Tested and certified combinations for the multi-inventory API.

List active warehousesGET /api2/warehouses?include_pagination=1
Include inactive warehousesGET /api2/warehouses?include_inactive=true
Warehouse by codeGET /api2/warehouses?code=main_depot
Stock by stock item IDGET /api2/stockitems?id=456
Stock by SKUGET /api2/stockitems?sku=PRODUCT-001
Stock for multiple SKUsGET /api2/stockitems?sku=PRODUCT-001,PRODUCT-002
Update by stock item IDPATCH /api2/stockitems + id: 456
Update warehouses mapPATCH /api2/stockitems + warehouses: {code: qty}
Update warehouses listPATCH /api2/stockitems + warehouses: [{code, qty}]
Batch updatePATCH /api2/stockitems + array of objects
Product with warehousesGET /api2/products?type=sku&id=PRODUCT-001

Integration recommendations

Recommended

  • Cache the listing of /api2/warehouses — the registry rarely changes, and every stock call can reuse the list.
  • Use the list shape ([{code, qty}]) when the integration serializes data from a relational database; use the map shape ({code: qty}) when the data already arrives as a dictionary.
  • For high-volume syncs, prefer the batch PATCH — it minimizes auth and logging overhead.
  • Read warehouses from order items to feed your OMS/WMS with which warehouse fulfills each line.

Avoid

  • Sending the total qty together with warehouses — the total will be overridden by the module's recalculation.
  • Using non-ASCII characters in warehouse codes for environments that serialize URLs — prefer slugs (main_depot rather than Depósito Padrão).
  • Updating warehouses in a loop (1 PATCH per SKU) when the batch already covers it — generates contention on the aggregated stock.

Incremental sync

For periodic WMS syncs, combine GET /api2/warehouses (cached for 24h) + batch PATCH /api2/stockitems on each delta window. This pattern drastically reduces the number of calls and keeps the aggregated stock consistent.

Common errors

StatusSample bodyWhen it happens
400{"error": "Invalid warehouse code"}warehouses contains a code that does not exist in the registry.
400{"error": "Invalid quantity"}Non-numeric or negative quantity in some warehouse.
400{"error": "Module not active"}The multi-inventory feature is not enabled in the environment.
401{"error": "Unauthorized"}Missing Authorization or expired token.
404{"error": "Warehouse not found"}Unknown warehouse_id or code.
404{"error": "Product not found"}Unknown product_id or sku.
409{"error": "Conflict on save"}Duplicate or deadlock on concurrent writes.