Get stock levels for products
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/product-stock/v1-misc-product-stock.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
POST/
Read-only: returns the shop stock you hold for each product you list. Nothing is reserved or moved. Stock adjustments, stock takes and transfers are not part of the public API.
For each product the answer has id, type and total: stock_on_hand, stock_incoming (on purchase orders not yet received), stock_not_usable and qty_need_ordering, as decimal strings with eight decimal places, such as "24.00000000" ("0" when no stock row or aggregate matches; parse them as decimals), summed over your warehouses or, with warehouse_id, for that warehouse only. inventories lists the stock rows behind the totals, one per warehouse.
Customer-owned stock and hidden or deleted stock rows are left out. custom items are skipped, so the answer can be shorter than the list you sent.
Type names differ by operation. Here and on Load a product for a sales order line, your own simple product is db_simple; on sales order lines the same product is user_simple. A variant is db_variant and a catalog product db_catalog everywhere.
Business rules
- Deleted simple products and variants are still answered; an id that does not exist fails the whole request with 404.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Request body
application/json, required.
- At least 1 item
warehouse_idstringA company location that holds stock. Leave it out to sum all of them.
Response
200Successful response.
Fields of each item (4)
Child fields (4)
How many sales orders need that stock does not cover. A decimal string, such as
"24.00000000"; parse it as a decimal ("0"when there is no aggregate).A decimal string, such as
"24.00000000"; parse it as a decimal.A decimal string, such as
"24.00000000"; parse it as a decimal.A decimal string, such as
"24.00000000"; parse it as a decimal ("0"when there is no stock row).
The line type:
db_simple,db_variantordb_catalog.inventoriesarray of objectsFields of each item (5)
idstringstock_incomingstring | nullA decimal string, such as
"24.00000000"; parse it as a decimal.stock_on_handstring | nullA decimal string, such as
"24.00000000"; parse it as a decimal.trashedbooleanwarehouse_idstring
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.- When
- An id does not exist for its
type. Nothing is returned for the others.error.codeis null anderror.messagenames the record type. - Fix
- Check each id and type.
422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
productis empty, atypeis not allowed, or anidis missing.error.codeisvalidation_failed.- Fix
- Fix each field named in
error.fields; its keys are field paths such ascontact.0.phone.
Notes
- This is your own stock. A supplier's stock comes from Get live supplier inventory.
Related
- POSTGet live supplier inventory for catalog products
/v1/ api/ store/ {team_slug}/ real_time_data_fetcher/ inventory - POSTLoad a product for a sales order line
/v1/ api/ store/ {team_slug}/ hydrate_product - GETList company locations
/v1/ api/ store/ {team_slug}/ setting/ location
