{"openapi":"3.1.0","info":{"title":"GET /api/v1/businesses/{business_id}/reports/cash-basis/bridge","version":"1.0.0","description":"Accrual to cash-basis net income bridge"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}/reports/cash-basis/bridge":{"get":{"tags":["businesses"],"summary":"Accrual to cash-basis net income bridge","description":"Accrual net income, cash-basis net income and the rows that decompose the difference (invoices not yet collected, collections recognised, bills not yet paid, bill payments recognised, unapplied receipts / payments, rounding, period close). Amounts in cents; row amounts are the effect on net income.","operationId":"get_cash_basis_bridge_api_v1_businesses__business_id__reports_cash_basis_bridge_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"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_GetCashBasisBridgeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"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"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CashBasisBridgeRow":{"properties":{"key":{"type":"string","enum":["unpaid_invoices_removed","invoice_collections_recognised","unpaid_bills_removed","bill_payments_recognised","unapplied_receipts","unapplied_payments","rounding","period_close","unexplained"],"title":"Key","description":"Stable row identifier"},"label":{"type":"string","title":"Label","description":"Human-readable row label"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Effect on net income in cents (positive increases net income)"},"description":{"type":"string","title":"Description","description":"What the row represents"}},"additionalProperties":true,"type":"object","required":["key","label","amount_cents","description"],"title":"CashBasisBridgeRow","description":"One line of the accrual → cash net income reconciliation."},"GetCashBasisBridgeResponse":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"accrual_net_income_cents":{"type":"integer","title":"Accrual Net Income Cents"},"cash_net_income_cents":{"type":"integer","title":"Cash Net Income Cents"},"rows":{"items":{"$ref":"#/components/schemas/CashBasisBridgeRow"},"type":"array","title":"Rows"},"difference_cents":{"type":"integer","title":"Difference Cents","description":"cash_net_income_cents - accrual_net_income_cents"},"unexplained_cents":{"type":"integer","title":"Unexplained Cents","description":"difference_cents - sum(rows); 0 when ties is true","default":0},"ties":{"type":"boolean","title":"Ties","description":"True when the rows exactly explain the difference"}},"additionalProperties":true,"type":"object","required":["start_date","end_date","accrual_net_income_cents","cash_net_income_cents","difference_cents","ties"],"title":"GetCashBasisBridgeResponse","description":"Response for ``get_cash_basis_bridge`` (cents)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_GetCashBasisBridgeResponse_":{"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/GetCashBasisBridgeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetCashBasisBridgeResponse]"},"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":[]}]}