Skip to content

Inventory API notes

There is one API for the whole platform. There is no separate Inventory API and no separate host for it. For the path grammar, access endpoints, authentication, paging, response envelopes and error codes, see the developer integration path.

Integrate an external system →

The document types this module produces

Most of them are generic documents, reachable through the generic document endpoints by their server document type:

INTERNAL_OUTBOUND_STOCK_TRANSFER · INTERNAL_INBOUND_STOCK_TRANSFER · INTERNAL_STOCK_ADJUSTMENT · INTERNAL_STOCK_REQUISITION · INTERNAL_PURCHASE_CONSIGNMENT_GRN · INTERNAL_PURCHASE_CONSIGNMENT_GIN · INTERNAL_CUSTOMER_CONSIGNMENT_OUT · INTERNAL_CUSTOMER_CONSIGNMENT_IN · INTERNAL_GOODS_DELIVERY_NOTE

Each applet’s reference page names the four API permissions its document type needs.

Stock Conversion is not a generic document. It has its own tables, its own posting endpoint and its own pair of job processors, and its lines carry a literal string rather than an entry in the server document type enumeration. Nothing about it passes through the generic document engine, the knock-off queue or the journal.

Reading stock: three different questions, three different endpoints

You wantReadNote
What is physically on handthe current location and current company stock balance resourcesThis is a stored figure, the tip of the ledger chain
What can still be promisedthe stock availability serviceComputed at query time — balance plus the signed open documents. It is not stored anywhere, so there is no table to read it from
What happenedthe stock transaction line ledgerOne signed row per movement, with the document behind it
Do not synchronise an external system against availability. It is recomputed on every call from open documents, so two calls a second apart can legitimately differ with no movement in between. Synchronise against the balance, and apply your own open-order logic on top if you need it — which is exactly what the marketplace integration does, writing its derived figure to its own table rather than back into the balance.

Two things an integration must respect

The quantity signum is the server’s, not yours. A document type’s quantity and amount signums are fixed in the backend. The applet’s own copy is overwritten by the server on every save, so sending a signum through the API changes nothing. If you need a document to move stock, you need a different document type, not a different field value.

A balance changes asynchronously. Setting a document to FINAL queues the work; the stock processor writes the ledger line and a second processor applies it to the balance. An integration that finalises a document and immediately reads the balance can legitimately see the old figure. Poll, or subscribe to the webhook, rather than reading straight back.

Idempotency is already handled, on one path

Every ledger line applied to a balance is recorded in an applied-marker table, so a re-run of the balance processor skips a line it has already counted rather than counting it twice. That protects the processor — it does not protect you from posting the same document twice through the API. Use your own reference number on the document and check for it before posting.

Last updated on