{"openapi":"3.1.0","info":{"title":"GET /api/v1/businesses/{business_id}/ledger/{ledger_id}/vendor-breakdown","version":"1.0.0","description":"Get vendor/counterparty breakdown for a ledger account"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}/ledger/{ledger_id}/vendor-breakdown":{"get":{"tags":["businesses"],"summary":"Get vendor/counterparty breakdown for a ledger account","description":"Returns vendors/counterparties that contributed to a ledger account total in the given date range, with amounts and percentages.","operationId":"get_ledger_vendor_breakdown_api_v1_businesses__business_id__ledger__ledger_id__vendor_breakdown_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","title":"Ledger 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":"cash_flow","in":"query","required":false,"schema":{"type":"boolean","description":"When true, restrict to cash-touching journal entries and use cash flow sign convention","default":false,"title":"Cash Flow"},"description":"When true, restrict to cash-touching journal entries and use cash flow sign convention"},{"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_GetLedgerVendorBreakdownResponse_"}}}},"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":{"GetLedgerVendorBreakdownResponse":{"properties":{"vendors":{"items":{"$ref":"#/components/schemas/LedgerVendorBreakdownEntry"},"type":"array","title":"Vendors"},"total_amount":{"type":"integer","title":"Total Amount"}},"additionalProperties":true,"type":"object","required":["vendors","total_amount"],"title":"GetLedgerVendorBreakdownResponse","description":"Response for ``get_ledger_vendor_breakdown``."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LedgerVendorBreakdownEntry":{"properties":{"counterparty_name":{"type":"string","title":"Counterparty Name"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"total_amount":{"type":"integer","title":"Total Amount"},"entry_count":{"type":"integer","title":"Entry Count"},"percentage":{"type":"number","title":"Percentage"}},"additionalProperties":true,"type":"object","required":["counterparty_name","total_amount","entry_count","percentage"],"title":"LedgerVendorBreakdownEntry","description":"Vendor/counterparty slice of a ledger total."},"SuccessEnvelope_GetLedgerVendorBreakdownResponse_":{"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/GetLedgerVendorBreakdownResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GetLedgerVendorBreakdownResponse]"},"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":[]}]}