Post a cycle count session
Transitions a session from pending_review to posted.
This is the one endpoint in the cycle count surface with real financial/inventory blast radius. It creates a genuine inventory adjustment and mutates on-hand stock and cost layers, via the same posting path as the UI. There is no dry-run mode and the result is not reversible through this API. Get explicit security/product sign-off before enabling this route for a live, automated (e.g. MCP-driven) caller in production.
Requires an explicit {"confirm": true} body as an external-only safety gate (the UI’s equivalent is an interactive confirmation dialog). Additionally returns 403 if the session’s batch is scope_type: item and the tenant is not currently flagged for CS_8871_CYCLE_COUNT_LOCATION_SCOPE.
Locked against concurrent calls. The pending-review status check runs against a lockForUpdate() read of the session row inside the posting transaction, so two near-simultaneous requests for the same session serialize — the second blocks until the first commits, then sees posted and returns 422 instead of also creating an adjustment.
Authorizations
Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.
Path Parameters
Body
Must be true. Explicit external-only acknowledgment that this posts a real, irreversible inventory adjustment.
true Response
The posted session, with status=posted and adjustmentId set.
A per-warehouse cycle count session. Every batch produces one session per warehouse in scope. This is the CS-8871 response shape returned by the lifecycle endpoints (start, submit-review, reopen, post, cancel, reset-counts) and by the batch endpoints where sessions are nested.
draft, in_progress, pending_review, posted, cancelled Number of distinct SKUs in the session.
Number of SKUs that have been counted so far.
System (book) value of the stock in scope, at post time.
Populated once the session reaches pending_review.
Populated once the session reaches pending_review.
Populated once the session reaches pending_review.
Id of the inventory adjustment created when the session is posted. Set once status is posted.