stocktakes

Set counted quantities on the lines of an open count

Writes counted quantities onto lines of an open count. The body is counts, a non-empty array of {variant_id, location_id, counted_quantity}; the pair addresses the line, so a variant counted at two locations is two entries.

A counted_quantity of null clears a line back to uncounted, which is not the same as counting zero: a zero is a reading that says the shelf is empty, and a null says nobody has looked. A negative quantity is refused 400.

Partial by design, send only the lines that were counted, as often as needed, and the rest stay as they were. Repeating a pair inside one body keeps the last entry rather than refusing, which is what a grid posting edits in order expects. A pair that is not in the count's scope is ignored rather than created: the scope is fixed when the count is opened.

Refused 400 once the count is posted. A posted count is frozen, and a correction is a new count. Answers 204 with no body; read the count back with get_stocktake for the new totals. To apply a whole file of counts instead of naming lines, use import_stocktake_counts.

Scope: stocktakes:write, which includes stocktakes:read.

patch/api/v1/stocktakes/{stocktake_id}/counts

Request

  • Base URL: https://api.app.tightly.io
  • URL: https://api.app.tightly.io/api/v1/stocktakes/{stocktake_id}/counts
  • Auth: HTTP bearer

Path parameters

stocktake_idinteger required
Example:1

The open count whose lines to write.

Headers

Tightly-Versionstring
Example:2026-11

The date train to answer on. One train exists today, 2026-11, the one this reference describes and the one every key is minted on, so the call answers on it with or without this header. Send it anyway, so a client built now names its train from the start.

Idempotency-Keystring
Example:b8f1c0d2-6a4e-4f39-9c21-0d5f2e7a1b44

A string of your own, up to 255 characters, that makes this write safe to retry. Send the same key twice and the second request is answered with the first one's status and body instead of writing again, so a client that retried after a timeout ends holding the record's id rather than creating a second one. Reusing a key with a different body, or while the first request is still running, is refused 409. A write that failed releases its key. Keys answer for 24 hours and belong to the API key that used them. A key longer than 255 characters is ignored and the write goes ahead without the guarantee.

Request body

Response

The counts were applied. No body; read the count back for its new totals.

Changes

No recorded changes to this operation across all 1 revision of this API.