Recipe: stock and prices
Moving the product cards is the catalog sync recipe. This page is the next step: reading stock and prices correctly and not letting them go stale in your catalog.
Permissions needed: price, product_stock, warehouse.
1. Pick the warehouses and price list
GET /organization/get-allPOST /warehouse/get-all
{ "organization_id": "6712f0a9c4d1e87b3a0f9911", "status": "active" }GET /price/get-all?type=saleKeep in your settings which warehouses the storefront sells from and which price list it shows. A price list's currency is its currency_id.
2. Read stock
POST /product-warehouse/get-paging
{ "page": 1, "limit": 200, "organization_id": "6712f0a9c4d1e87b3a0f9911" }page and limit are required, limit up to 200. Page until page * limit >= data.total. Each row is a product × warehouse:
{
"_id": "6712f0a9c4d1e87b3a0f9944",
"product_id": "6712f0a9c4d1e87b3a0f9933",
"warehouse_id": "6712f0a9c4d1e87b3a0f9955",
"organization_id": "6712f0a9c4d1e87b3a0f9911",
"amount": 12,
"booked": 2,
"in_transit": 0,
"on_the_way": 50,
"in_trash": 1,
"updated_at": "2026-11-05T09:12:00.000Z"
}| Field | Meaning |
|---|---|
amount | Available to sell. This is what your storefront shows |
booked | Reserved |
in_transit | In a transfer: left the sending warehouse, not yet received |
on_the_way | Purchased, not yet received into stock |
in_trash | Written off as defective |
amount includes none of the other four — neither add nor subtract them. Filters: organization_id, product_ids (up to 500), updated_at. There is no warehouse filter — pick your warehouse_ids on your side. When there is no row for a product × warehouse, treat its stock as 0.
Two other sources are not for this job: organizations[].amount in product/get-paging is a summary refreshed in the background, and product-stock holds batch-level rows.
3. Read prices
POST /price/items/get-paging
{ "page": 1, "limit": 200, "organization_id": "6712f0a9c4d1e87b3a0f9911", "price_id": "6712f0a9c4d1e87b3a0f9966" }Send both organization_id and price_id — otherwise rows of other organizations or price lists are mixed into the response. Extra filters: product_id, search (name, SKU, barcode).
{
"_id": "6712f0a9c4d1e87b3a0f9977",
"price_id": "6712f0a9c4d1e87b3a0f9966",
"product": { "_id": "6712f0a9c4d1e87b3a0f9933", "name": "Espresso" },
"amount": 45000,
"min_price": 40000,
"max_price": 50000
}Here amount is the price, not stock. A product missing from the list has no price set in that price list.
4. Keep the external catalog in step
| What | How | How often |
|---|---|---|
| Stock, incremental | product-warehouse/get-paging + updated_at | Every 5–15 minutes |
| Stock, full | The same method unfiltered, replace your values | Once a day |
| Prices | All of price/items/get-paging: there is no updated_at filter | On a schedule |
- For
updated_at, store the time you started paging, not the time you finished: rows that changed while you were reading then come again next time. - Upsert rows by
product_id+warehouse_id: receiving a row twice changes nothing. - Do not track price changes with the
updated_atfilter ofproduct/get-paging: it filters the product record, and prices live in separate records.
5. Webhooks
- There is no event for stock (
product-warehouse) — poll it. productPrices.create,productPrices.updateandproductPrices.deletesay a price row changed. Theidin the message is the_idof aprice/items/get-pagingrow, not a product id. So keep an_id→product._idmap; when an unknownidarrives, re-read the list.
Webhook delivery is not guaranteed and bulk operations send none (webhooks) — you still need a scheduled full reconcile. An app that declares required_permissions cannot call the webhook/* methods — it can only poll.
Errors
| Response | Cause |
|---|---|
400 validation | page or limit is missing, an id is wrong, or limit is above 200 on product-warehouse |
403, code: 10003 | One of the permissions was not approved; data names it |
Methods
| Step | Method |
|---|---|
| Organization | GET /organization/get-all |
| Warehouses | POST /warehouse/get-all |
| Price lists | GET /price/get-all |
| Stock | POST /product-warehouse/get-paging |
| Prices | POST /price/items/get-paging |