Get Expiry Distribution (POST, Advanced Filters)
POST/api/inventory-expiry/distribution
POST variant of the bucket distribution — same response as the GET, with the product advanced-filter tree in the body.
Authentication: Requires Bearer token. Scope: reports:read.
Product advanced-filter tree (GroupedFilterSupport). POSTed in the body to carry larger filter sets than the query string allows; bridged into the report via a products.id subquery.
Structure: { conjunction: 'and'|'or', children: [ { type: 'condition', condition: { column, operator, value } } | { type: 'group', group: {…} } ] } (groups may nest).
Allowed columns: sku, name, barcode, mpn, type (text); brand_name, supplier_name, category, tag (relationship text); shelf_life_days, near_expiry_threshold_days (numeric). Text operators: contains, does_not_contain, is, is_not, is_one_of, starts_with, does_not_start_with, ends_with, does_not_end_with, is_empty, is_not_empty. Numeric operators: is, is_not, is_one_of, greater_than, less_than, greater_than_or_equal, less_than_or_equal, between, is_empty, is_not_empty. Legacy { filters: { conjunction, filterSet } } format is also accepted for backward compatibility.
reports:readGrant this scope to your token under Settings → Developer → Personal Access Tokens.
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.