Skip to content

Stock API

What is in stock, and goods set aside for someone who said yes.

The same operations are in the interactive API reference, and the whole contract is in the OpenAPI document.

GET/v1/stock/{item}

Get the stock of an item

The believed quantity, how much of it is held for others, how much can be promised now and how far the figure can be trusted. Needs stock:read.

Scope stock:read. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
itempathstringYes
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/stock/{item}/holds

Set goods aside

Sets quantity of the item aside for a requester who said yes, for as long as the term allows. Asking again with the same idempotency_key returns the first hold. When the figure cannot be trusted the answer is checking and a person is asked to count. Needs stock:write.

Scope stock:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
itempathstringYes
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.

POST/v1/stock/{item}/holds/{hold}/release

Give goods back

The requester said no or went quiet: the goods are free again. A hold of another item is not found. Needs stock:write.

Scope stock:write. Accepts: API key or personal access token. Open in the API reference

ParameterInTypeRequiredDescription
itempathstringYes
holdpathstringYes
AirFone-VersionheaderstringNoThe API version to use, as a date. Defaults to the version the account was pinned to.