{"openapi":"3.1.0","info":{"title":"GET /api/v1/fixed-assets/depreciation-matrix","version":"1.0.0","description":"Depreciation schedule matrix"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/fixed-assets/depreciation-matrix":{"get":{"tags":["fixed-assets"],"summary":"Depreciation schedule matrix","description":"Depreciation pivoted to months across the top and assets down the side.\n\nEach cell is that asset's depreciation for that month, split into what has\nalready posted and what is still queued. `column_totals` is the subtotal\nrow along the bottom.","operationId":"get_depreciation_matrix","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Earliest period to include (YYYY-MM-DD)","title":"Start Date"},"description":"Earliest period to include (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Latest period to include (YYYY-MM-DD)","title":"End Date"},"description":"Latest period to include (YYYY-MM-DD)"},{"name":"include_posted","in":"query","required":false,"schema":{"type":"boolean","description":"Include already-posted periods","default":true,"title":"Include Posted"},"description":"Include already-posted periods"},{"name":"include_scheduled","in":"query","required":false,"schema":{"type":"boolean","description":"Include queued (not yet posted) periods","default":true,"title":"Include Scheduled"},"description":"Include queued (not yet posted) periods"},{"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/SuccessEnvelope_DepreciationMatrixResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"get_depreciation_matrix_api_v1_fixed_assets_depreciation_matrix_get"}}},"components":{"schemas":{"DepreciationMatrixCell":{"properties":{"period":{"type":"string","title":"Period","description":"Period bucket, YYYY-MM"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Total depreciation in this cell"},"posted_cents":{"type":"integer","title":"Posted Cents","description":"Portion already posted to the ledger, in cents"},"scheduled_cents":{"type":"integer","title":"Scheduled Cents","description":"Portion still queued as a draft entry, in cents"}},"type":"object","required":["period","amount_cents","posted_cents","scheduled_cents"],"title":"DepreciationMatrixCell","description":"One month's depreciation for one asset (or one column subtotal)."},"DepreciationMatrixResponse":{"properties":{"periods":{"items":{"type":"string"},"type":"array","title":"Periods","description":"Month buckets (YYYY-MM), ascending"},"rows":{"items":{"$ref":"#/components/schemas/DepreciationMatrixRow"},"type":"array","title":"Rows","description":"One row per asset"},"column_totals":{"items":{"$ref":"#/components/schemas/DepreciationMatrixCell"},"type":"array","title":"Column Totals","description":"Subtotal row: one total per period"},"total_posted_cents":{"type":"integer","title":"Total Posted Cents","description":"Grand total posted, in cents"},"total_scheduled_cents":{"type":"integer","title":"Total Scheduled Cents","description":"Grand total still queued, in cents"},"grand_total_cents":{"type":"integer","title":"Grand Total Cents","description":"Grand total, in cents"},"total_opening_accumulated_cents":{"type":"integer","title":"Total Opening Accumulated Cents","description":"Sum of the rows' opening accumulated amounts, in cents","default":0},"total_opening_balance_cents":{"type":"integer","title":"Total Opening Balance Cents","description":"Sum of the rows' balances at go-live, in cents","default":0}},"type":"object","required":["total_posted_cents","total_scheduled_cents","grand_total_cents"],"title":"DepreciationMatrixResponse","description":"Depreciation schedule pivoted to months (X) by asset (Y)."},"DepreciationMatrixRow":{"properties":{"asset_id":{"type":"string","title":"Asset Id","description":"Asset ID"},"asset_name":{"type":"string","title":"Asset Name","description":"Asset name"},"category_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name","description":"Asset category name"},"cells":{"items":{"$ref":"#/components/schemas/DepreciationMatrixCell"},"type":"array","title":"Cells","description":"One cell per period, in period order"},"total_cents":{"type":"integer","title":"Total Cents","description":"Row total in cents"},"posted_cents":{"type":"integer","title":"Posted Cents","description":"Row total already posted, in cents"},"scheduled_cents":{"type":"integer","title":"Scheduled Cents","description":"Row total still queued, in cents"},"original_cost_cents":{"type":"integer","title":"Original Cost Cents","description":"Asset cost basis, in cents","default":0},"opening_accumulated_cents":{"type":"integer","title":"Opening Accumulated Cents","description":"Depreciation/amortization recognised before go-live (no JE), in cents","default":0},"opening_balance_cents":{"type":"integer","title":"Opening Balance Cents","description":"Balance at go-live: cost less the opening accumulated amount, in cents (the full cost for assets that started in DayZero)","default":0},"go_live_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Go Live Date","description":"First month DayZero posts for this asset"},"schedule_kind":{"type":"string","enum":["depreciation","amortization"],"title":"Schedule Kind","description":"Depreciation or prepaid amortization","default":"depreciation"}},"type":"object","required":["asset_id","asset_name","total_cents","posted_cents","scheduled_cents"],"title":"DepreciationMatrixRow","description":"One asset's row across the matrix's months."},"SuccessEnvelope_DepreciationMatrixResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DepreciationMatrixResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DepreciationMatrixResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}