{"openapi":"3.1.0","info":{"title":"GET /api/v1/credit/lines/{credit_line_id}/statements","version":"1.0.0","description":"List statements"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/lines/{credit_line_id}/statements":{"get":{"tags":["credit"],"summary":"List statements","description":"One row per closed cycle: period, issued date, due date, status, amount due, and a download link. The due date is fixed at close and must not be derived from the issued date.","operationId":"list_statements_api_v1_credit_lines__credit_line_id__statements_get","parameters":[{"name":"credit_line_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Line Id"}},{"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_StatementListResponse_"}}}},"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":{"CycleStatusEnum":{"type":"string","enum":["open","closed","issued","paid","late","written_off"],"title":"CycleStatusEnum","description":"Cycle state per FRD §10.5.\n\n* ``open`` — collecting settlements; no draw exists yet. Merchant sees\n  activity but nothing is owed (this interval is the float).\n* ``closed`` — draw created; interest and fees computed. Statement pending.\n* ``issued`` — statement generated and available; amount due and due date shown.\n* ``paid`` — outstanding reduced to zero, *including* accrued interest.\n* ``late`` — past due date with an amount outstanding.\n* ``written_off`` — charged off per collections policy."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"StatementListItem":{"properties":{"cycle_id":{"type":"string","title":"Cycle Id"},"period_start":{"type":"string","format":"date","title":"Period Start"},"period_end":{"type":"string","format":"date","title":"Period End"},"issued_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issued On"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"status":{"$ref":"#/components/schemas/CycleStatusEnum"},"amount_due_cents":{"type":"integer","title":"Amount Due Cents"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url","description":"Rendered statement document for this cycle."}},"type":"object","required":["cycle_id","period_start","period_end","status","amount_due_cents"],"title":"StatementListItem","description":"One row of the Statements tab (§8)."},"StatementListResponse":{"properties":{"credit_line_id":{"type":"string","title":"Credit Line Id"},"legal_lending_entity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Lending Entity"},"statements":{"items":{"$ref":"#/components/schemas/StatementListItem"},"type":"array","title":"Statements"},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of"}},"type":"object","required":["credit_line_id"],"title":"StatementListResponse","description":"Statement list and the per-statement download (§14, call 5)."},"SuccessEnvelope_StatementListResponse_":{"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/StatementListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[StatementListResponse]"},"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":[]}]}