{"openapi":"3.1.0","info":{"title":"GET /api/v1/inventory/reports/adjustment-reasons","version":"1.0.0","description":"Adjustments grouped by reason"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/reports/adjustment-reasons":{"get":{"tags":["inventory:reports"],"summary":"Adjustments grouped by reason","description":"Aggregates `inventory` ledger rows whose `correction_reason` is set (i.e. manual adjustments and cycle-count posts) by reason code. Returns count, signed units, and a $-impact estimate using each variant's stored `unit_cost`. Use ``since``/``until`` ISO-8601 strings to scope the window (defaults to all-time).","operationId":"get_adjustment_reasons_api_v1_inventory_reports_adjustment_reasons_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive lower bound (ISO-8601). Omit for all-time.","title":"Since"},"description":"Inclusive lower bound (ISO-8601). Omit for all-time."},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive upper bound (ISO-8601). Omit for now.","title":"Until"},"description":"Exclusive upper bound (ISO-8601). Omit for now."},{"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/AdjustmentReasonsResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}}},"components":{"schemas":{"AdjustmentReasonRow":{"properties":{"reason":{"type":"string","title":"Reason"},"label":{"type":"string","title":"Label"},"adjustment_count":{"type":"integer","title":"Adjustment Count"},"total_units":{"type":"number","title":"Total Units","description":"Sum of `inventory.delta` for this reason (signed)."},"total_value_cents":{"type":"integer","title":"Total Value Cents","description":"Total $-value impact (cents) using each variant's `unit_cost` as a proxy for the GL impact."},"is_canonical":{"type":"boolean","title":"Is Canonical","description":"True when the reason matches a known enum value."}},"type":"object","required":["reason","label","adjustment_count","total_units","total_value_cents","is_canonical"],"title":"AdjustmentReasonRow","description":"One row of the adjustments-by-reason widget."},"AdjustmentReasonsResponse":{"properties":{"since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"},"until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"},"rows":{"items":{"$ref":"#/components/schemas/AdjustmentReasonRow"},"type":"array","title":"Rows"},"total_adjustments":{"type":"integer","title":"Total Adjustments","default":0},"total_value_cents":{"type":"integer","title":"Total Value Cents","default":0}},"type":"object","title":"AdjustmentReasonsResponse"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}