Audits
Create & Update Audit
Create Audit
The only property required to create an audit is location_id. When the audit is created, the system will inspect the inventory levels at that location and automatically generate one audit_task per item/layout combination that has a non-zero quantity. You can narrow the scope of the audit by supplying item_ids and/or layout_ids.
The system will generate one audit_task per eligible item/layout combination at the location. If no items are eligible for counting at the location (e.g., all levels are at 0 quantity), the request will fail with a 400 error. Audits are also capped at 100 tasks per audit; if more tasks would be generated, the request will fail and you should narrow the scope using item_ids and/or layout_ids.
If you supply a number that already exists for the location in your organization, the request will fail.
Update Audit
Audits are updated through the same endpoint used to submit task counts, transition status, and add review feedback.
Updating Audit Tasks
To submit counts and reason codes for the tasks in an audit, supply a tasks array. Each entry in the array must include the id of an existing audit task. The item_id and layout_id for a task cannot be changed once created.
To increment the existing counted quantity rather than overwriting it, pass counted_qty as a single-element array:
Status Transitions
When you submit task counts and move the audit to in_review, the system locks in total_qty for each task and validates that any tasks whose discrepancy exceeds the organization's audit approval threshold have a reason_code_id. If all in-review tasks fall within the threshold, the audit is automatically transitioned from in_review to approved.
When the audit is approved with update_inventory set to true, the system applies the difference between counted_qty and total_qty to the corresponding inventory level's available_qty, and stamps last_audited_at on the impacted items, layouts, and location. If applying a discrepancy would cause available_qty to drop below 0, the request will fail.