Preview Closed Stock Takes
POST/api/inbound-shipments/receive/preview-closed-stock-takes
Dry-run check of whether a receipt is dated before a closed stock take. This endpoint only reads data: it does not create a receipt or move any stock.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Send the same payload you would post to Receive Shipment. The response lists every closed full count of the default condition, dated on a later day than received_at, that covered a product this receipt adds at the warehouse it lands in. An empty data means Receive Shipment will not refuse the receipt for this reason.
Fields:
- purchase_order_id (optional): Purchase order being received. Used to infer the warehouse when warehouse_id is omitted.
- warehouse_id (optional): Warehouse the stock is received into.
- received_at (required): Date of the hypothetical receipt.
- receipt_lines (optional): Lines being received. Lines with a negative quantity are ignored. When omitted, every outstanding line on the purchase order is checked.
- unexpected_items (optional): Unexpected products being received.
Response:
- data[].stock_take_id: The closed stock take
- data[].date_count: The day it was counted, in the tenant's timezone
- data[].warehouse_id, data[].warehouse_name: Where it was counted
- data[].skus: The receipt's products that the count covered
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.