{"openapi":"3.1.0","info":{"title":"GET /api/v1/credit/lines/{credit_line_id}/ledger","version":"1.0.0","description":"Credit line ledger register"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/lines/{credit_line_id}/ledger":{"get":{"tags":["credit"],"summary":"Credit line ledger register","description":"The append-only register every balance is derived from, in replay order.","operationId":"get_ledger_api_v1_credit_lines__credit_line_id__ledger_get","parameters":[{"name":"credit_line_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Line Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"default":500,"title":"Limit"}},{"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_list_LedgerEntryResponse__"}}}},"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":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LedgerEntryResponse":{"properties":{"id":{"type":"string","title":"Id"},"cycle_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cycle Id"},"sequence_no":{"type":"integer","title":"Sequence No"},"entry_type":{"$ref":"#/components/schemas/LedgerEntryTypeEnum"},"effective_date":{"type":"string","format":"date","title":"Effective Date"},"amount_cents":{"type":"integer","title":"Amount Cents"},"principal_delta_cents":{"type":"integer","title":"Principal Delta Cents"},"fee_delta_cents":{"type":"integer","title":"Fee Delta Cents"},"interest_delta_cents":{"type":"integer","title":"Interest Delta Cents"},"balance_after_cents":{"type":"integer","title":"Balance After Cents"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"}},"type":"object","required":["id","sequence_no","entry_type","effective_date","amount_cents","principal_delta_cents","fee_delta_cents","interest_delta_cents","balance_after_cents"],"title":"LedgerEntryResponse","description":"One immutable row of a line's register."},"LedgerEntryTypeEnum":{"type":"string","enum":["settlement","refund","draw","fee","interest","payment","payment_reversal","late_assessment","write_off","adjustment"],"title":"LedgerEntryTypeEnum","description":"What kind of credit-line event a ledger row records."},"SuccessEnvelope_list_LedgerEntryResponse__":{"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":[{"items":{"$ref":"#/components/schemas/LedgerEntryResponse"},"type":"array"},{"type":"null"}],"title":"Data"}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[list[LedgerEntryResponse]]"},"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":[]}]}