stocktakes

Stock variance measured from posted counts, attributed to each variant's default supplier

Reads system_quantity against counted_quantity on POSTED counts only, and puts each counted line to the variant's default supplier. Open counts are never read: an unfinished count is not a measurement.

Losses and gains are served separately and never netted, so there is no net field to reach for. A location that loses 500 and finds 480 has a counting problem, not a variance of 20. Nothing here is a shrink figure either, counting short can be theft, damage, a mis-shipment, a receiving error or a miscount, and counting long is found stock.

Every counted line lands in exactly one buckets entry, default_supplier, no_default_supplier or no_supplier_on_file, so the buckets sum to totals on every unit and line figure. The two unattributed buckets carry attribution_reason instead of a supplier and are never folded into one. On an attributed bucket, multi_supplier_line_count says how many of its lines came from variants carrying more than one supplier.

loss_cost and gain_cost are null, never 0, where there is nothing priceable, and cost_reason says why; *_units_unpriced says how many units the money leaves out even when it is populated. currency is null unless one denomination covers the lot.

A supplier with no posted count is not a supplier with clean stock: it is counted in measurement.suppliers_with_no_reading rather than served as a zero row. For the lines behind one count, use get_stocktake_lines_table.

Scope: stocktakes:read.

get/api/v1/stocktakes/variance/by-supplier

Request

  • Base URL: https://api.app.tightly.io
  • URL: https://api.app.tightly.io/api/v1/stocktakes/variance/by-supplier
  • Auth: HTTP bearer

Query parameters

counted_fromstring date
Example:2026-01-01

Include only counts whose counted_on is on or after this date. Omit both dates to read every posted count on file; measurement.window_source reports which was used.

counted_tostring date
Example:2026-06-30

Include only counts whose counted_on is on or before this date. A counted_from after counted_to is refused 400.

location_idstring
Example:loc1,loc2

Limit the read to these locations. Repeatable (?location_id=a&location_id=b), bracket-repeatable (?location_id[]=a&location_id[]=b) or comma-separated. Omit for every location.

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.

Response

What was measured, the totals over every counted line, and one bucket per attribution. The buckets sum to the totals.

messageobject

severity, service and desc.

Changes

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