Export Expiry Report (async, POST + filter_groups)
POST/api/inventory-expiry/export
Starts an asynchronous CSV export of the expiry report (lot-detail or product-summary view).
reports:readGrant this scope to your token under Settings → Developer → Personal Access Tokens.
The export runs as a tray-tracked job: a full lot-detail export can run for minutes, and a synchronous response that long is terminated by the edge proxy (Cloudflare 524). The CSV is built off the request cycle, written to the model-exports disk, and surfaced as a download via the tracked job log endpoints.
Returns the tracked job log id; poll the tracked job log endpoints (or GET /api/export/download?file=...) for the finished file.
Authentication: Requires Bearer token (scope reports:read). Accepts the same filters as the report endpoint (view, warehouse_id, search, batch_number, bucket, brand_id, supplier_id, min_quantity, fba_only, near_expiry_only, and the advanced filter_groups tree on the POST variant).
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.