{"openapi":"3.1.0","info":{"title":"GET /api/v1/credit/lines/{credit_line_id}","version":"1.0.0","description":"Credit line dashboard"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/lines/{credit_line_id}":{"get":{"tags":["credit"],"summary":"Credit line dashboard","description":"Limit, current balance, available credit, utilisation in basis points, start date, term, and linked account. Available credit and utilisation are returned rather than derived so the dashboard card and the statement band cannot disagree.","operationId":"get_credit_line_api_v1_credit_lines__credit_line_id__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_CreditLineResponse_"}}}},"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":{"CreditLineResponse":{"properties":{"id":{"type":"string","title":"Id"},"program_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Program Id"},"external_line_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Line Id"},"external_merchant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Merchant Id"},"status":{"$ref":"#/components/schemas/CreditLineStatusEnum"},"credit_limit_cents":{"type":"integer","title":"Credit Limit Cents"},"current_balance_cents":{"type":"integer","title":"Current Balance Cents","description":"Sum of outstanding across all closed, unpaid cycles."},"available_credit_cents":{"type":"integer","title":"Available Credit Cents","description":"Limit minus current balance."},"utilisation_bps":{"type":"integer","title":"Utilisation Bps","description":"Balance over limit, in basis points."},"term_days":{"type":"integer","title":"Term Days"},"rate_bps":{"type":"integer","title":"Rate Bps"},"disbursement_fee_bps":{"type":"integer","title":"Disbursement Fee Bps"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"linked_account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked Account Name"},"linked_account_mask":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked Account Mask"},"autopay_enabled":{"type":"boolean","title":"Autopay Enabled"},"open_cycle_activity_cents":{"type":"integer","title":"Open Cycle Activity Cents","description":"Settlements in the open cycle. Excluded from current balance because no draw exists for them until close (§10.2).","default":0},"amount_due_cents":{"type":"integer","title":"Amount Due Cents","description":"Outstanding of the most recently closed cycle.","default":0},"next_due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Next Due Date"},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of","description":"When these figures were computed. Every balance payload carries one so a client can label stale data (§10.8)."}},"type":"object","required":["id","status","credit_limit_cents","current_balance_cents","available_credit_cents","utilisation_bps","term_days","rate_bps","disbursement_fee_bps","autopay_enabled"],"title":"CreditLineResponse","description":"Dashboard cards and metadata row (§4).\n\n``available_credit_cents`` and ``utilisation_bps`` are returned rather\nthan derived so the card, the statement band, and the payoff quote\ncannot disagree (§10.2)."},"CreditLineStatusEnum":{"type":"string","enum":["pending","active","suspended","closed"],"title":"CreditLineStatusEnum","description":"Lifecycle of a credit line itself (distinct from cycle state)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_CreditLineResponse_":{"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/CreditLineResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditLineResponse]"},"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":[]}]}