{"openapi":"3.1.0","info":{"title":"GET /api/v1/inventory/reports/aging","version":"1.0.0","description":"Inventory aging report"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/reports/aging":{"get":{"tags":["inventory:reports"],"summary":"Inventory aging report","description":"Bucket remaining cost-lot quantities (and dollars) by lot age (0-30 / 31-60 / 61-90 / 91-180 / 180+ days). Optionally returns the per-variant detail with the oldest received_at.","operationId":"get_aging_api_v1_inventory_reports_aging_get","parameters":[{"name":"detail","in":"query","required":false,"schema":{"type":"boolean","description":"Include per-variant breakdown sorted by oldest lot age.","default":false,"title":"Detail"},"description":"Include per-variant breakdown sorted by oldest lot age."},{"name":"detail_limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Cap on per-variant detail rows when `detail=true`.","default":100,"title":"Detail Limit"},"description":"Cap on per-variant detail rows when `detail=true`."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgingResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgingBucket":{"properties":{"bucket":{"type":"string","title":"Bucket","description":"Aging band: 0-30 / 31-60 / 61-90 / 91-180 / 180+."},"on_hand_units":{"type":"number","title":"On Hand Units"},"total_value_cents":{"type":"integer","title":"Total Value Cents"},"lot_count":{"type":"integer","title":"Lot Count"}},"type":"object","required":["bucket","on_hand_units","total_value_cents","lot_count"],"title":"AgingBucket","description":"Aging bucket totals (in dollars and units)."},"AgingResponse":{"properties":{"total_value_cents":{"type":"integer","title":"Total Value Cents","default":0},"total_on_hand_units":{"type":"number","title":"Total On Hand Units","default":0},"buckets":{"items":{"$ref":"#/components/schemas/AgingBucket"},"type":"array","title":"Buckets"},"variants":{"items":{"$ref":"#/components/schemas/AgingVariantRow"},"type":"array","title":"Variants"}},"type":"object","title":"AgingResponse"},"AgingVariantRow":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"oldest_received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Oldest Received At"},"days_oldest":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Oldest"},"on_hand_units":{"type":"number","title":"On Hand Units"},"total_value_cents":{"type":"integer","title":"Total Value Cents"}},"type":"object","required":["variant_id","on_hand_units","total_value_cents"],"title":"AgingVariantRow","description":"Per-variant aging summary (only when `detail=true`)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}