Preview Inventory Debt Settlement
POST/api/inventory/debt/claims/settle-preview
Read-only preview of what settling the selected inventory debt claims would consume, without consuming it.
inventory:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Walks the same date-eligible, non-consignment stock layers in the same order the settlement itself does, so the preview cannot promise one thing and the settlement do another. Each source layer also carries the positive inventory event that created it (the receipt, stock take or transfer), so the origin of the stock is traceable.
Nothing is written. Call Settle Inventory Debt Claims to commit.
Request body:
- claim_ids (array of integer, required, 1-200) - the claims to preview
Response 200:
- data.coverable_units (number) - units that would be repaid now
- data.shortfall_units (number) - units that would stay outstanding
- data.repayable_claims (integer) - claims with at least one covering layer
- data.total_claims (integer) - outstanding claims in the selection
- data.estimated_variance (number) - total cost variance that would post
- data.claims[] (array) - per-claim breakdown
- claim_id (integer)
- product_id (integer)
- sku (string, nullable)
- warehouse_id (integer)
- warehouse_name (string, nullable)
- owed (number) - units still owed
- covered (number) - units this preview would repay
- estimated_unit_cost (number) - provisional cost carried until settlement
- sources[] (array) - the stock layers that would be consumed
- fifo_layer_id (integer)
- received_at (string, nullable, Y-m-d)
- quantity (number)
- unit_cost (number) - actual cost of the layer
- variance_per_unit (number) - actual minus estimate
- origin (object, nullable) - the positive inventory event that created the layer
- link_type (string, nullable)
- link_id (integer, nullable)
- name (string, nullable)
- parent_link_id (integer, nullable)
- detail_link_id (integer, nullable)
- reference (string, nullable)
- data.claims[].product_id (integer) and data.claims[].warehouse_id (integer) - so the caller can link the claim's product and warehouse
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.