{"openapi":"3.1.0","info":{"title":"GET /api/v1/payment-advisory/firm-summary","version":"1.0.0","description":"Get consolidated AP summary for firm"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/payment-advisory/firm-summary":{"get":{"tags":["payment-advisory"],"summary":"Get consolidated AP summary for firm","description":"Get AP outstanding/overdue summary across all firm client businesses.","operationId":"get_firm_ap_summary_api_v1_payment_advisory_firm_summary_get","parameters":[{"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_GetFirmApSummaryResponse_"}}}},"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":{"FirmClientSummary":{"properties":{"business_id":{"type":"string","title":"Business Id"},"business_name":{"type":"string","title":"Business Name"},"outstanding_cents":{"type":"integer","title":"Outstanding Cents"},"overdue_cents":{"type":"integer","title":"Overdue Cents"},"bills_needing_review":{"type":"integer","title":"Bills Needing Review"},"total_bills":{"type":"integer","title":"Total Bills"},"close_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Close Score"},"close_score_color":{"anyOf":[{"type":"string","enum":["green","yellow","red","gray"]},{"type":"null"}],"title":"Close Score Color"},"close_period_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Period Id"},"close_blockers_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Close Blockers Count"}},"additionalProperties":true,"type":"object","required":["business_id","business_name","outstanding_cents","overdue_cents","bills_needing_review","total_bills"],"title":"FirmClientSummary","description":"Per-client AP and close-score summary for the firm cockpit."},"FirmSummaryTotals":{"properties":{"total_outstanding_cents":{"type":"integer","title":"Total Outstanding Cents"},"total_overdue_cents":{"type":"integer","title":"Total Overdue Cents"},"bills_needing_review":{"type":"integer","title":"Bills Needing Review"},"total_bills":{"type":"integer","title":"Total Bills"}},"additionalProperties":true,"type":"object","required":["total_outstanding_cents","total_overdue_cents","bills_needing_review","total_bills"],"title":"FirmSummaryTotals","description":"Firm-wide AP totals."},"GetFirmApSummaryResponse":{"properties":{"totals":{"$ref":"#/components/schemas/FirmSummaryTotals"},"clients":{"items":{"$ref":"#/components/schemas/FirmClientSummary"},"type":"array","title":"Clients"}},"additionalProperties":true,"type":"object","required":["totals","clients"],"title":"GetFirmApSummaryResponse","description":"Response for ``get_firm_ap_summary``."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_GetFirmApSummaryResponse_":{"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/GetFirmApSummaryResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetFirmApSummaryResponse]"},"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":[]}]}