{"openapi":"3.1.0","info":{"title":"GET /api/v1/credit/lines/{credit_line_id}/subledger","version":"1.0.0","description":"Transactions tab: roll-forward, activity, cycle history"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/lines/{credit_line_id}/subledger":{"get":{"tags":["credit"],"summary":"Transactions tab: roll-forward, activity, cycle history","description":"The balance roll-forward for one cycle, the open cycle's activity beneath it, and one row per closed cycle. Filters run server-side: a paginated envelope silently breaks client-side filtering.","operationId":"get_subledger_api_v1_credit_lines__credit_line_id__subledger_get","parameters":[{"name":"credit_line_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Line Id"}},{"name":"cycle_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Render the band for this cycle. Defaults to the latest.","title":"Cycle Id"},"description":"Render the band for this cycle. Defaults to the latest."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated cycle states, e.g. `paid,late`.","title":"Status"},"description":"Comma-separated cycle states, e.g. `paid,late`."},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Include cycles ending on or after.","title":"Start"},"description":"Include cycles ending on or after."},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Include cycles starting on or before.","title":"End"},"description":"Include cycles starting on or before."},{"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_SubledgerResponse_"}}}},"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":{"CardSettlementResponse":{"properties":{"id":{"type":"string","title":"Id"},"external_settlement_id":{"type":"string","title":"External Settlement Id"},"cycle_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cycle Id"},"settled_on":{"type":"string","format":"date","title":"Settled On"},"amount_cents":{"type":"integer","title":"Amount Cents"},"merchant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Name"},"card_last_four":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Last Four"},"merchant_category_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Category Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"source":{"type":"string","title":"Source"}},"type":"object","required":["id","external_settlement_id","settled_on","amount_cents","source"],"title":"CardSettlementResponse","description":"A settlement line item in the activity list (§7.2)."},"CreditCycleResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"$ref":"#/components/schemas/CycleStatusEnum"},"period_start":{"type":"string","format":"date","title":"Period Start"},"period_end":{"type":"string","format":"date","title":"Period End"},"closed_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Closed On"},"statement_issued_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Statement Issued On"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"principal_cents":{"type":"integer","title":"Principal Cents"},"disbursement_fee_cents":{"type":"integer","title":"Disbursement Fee Cents"},"interest_cents":{"type":"integer","title":"Interest Cents"},"late_interest_cents":{"type":"integer","title":"Late Interest Cents","default":0},"late_fee_cents":{"type":"integer","title":"Late Fee Cents","default":0},"previous_balance_cents":{"type":"integer","title":"Previous Balance Cents","default":0},"draw_charges_cents":{"type":"integer","title":"Draw Charges Cents","description":"Principal plus fee plus term interest, fixed at close.","default":0},"amount_due_cents":{"type":"integer","title":"Amount Due Cents","description":"Everything this cycle owes, late charges included."},"amount_paid_cents":{"type":"integer","title":"Amount Paid Cents"},"outstanding_cents":{"type":"integer","title":"Outstanding Cents"},"term_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Term Days"},"rate_bps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rate Bps"},"settlement_count":{"type":"integer","title":"Settlement Count","default":0}},"type":"object","required":["id","status","period_start","period_end","principal_cents","disbursement_fee_cents","interest_cents","amount_due_cents","amount_paid_cents","outstanding_cents"],"title":"CreditCycleResponse","description":"One cycle, open or closed (§7.2 cycle history row)."},"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"},"RollForwardResponse":{"properties":{"previous_balance_cents":{"type":"integer","title":"Previous Balance Cents"},"new_purchases_cents":{"type":"integer","title":"New Purchases Cents"},"fees_cents":{"type":"integer","title":"Fees Cents"},"interest_cents":{"type":"integer","title":"Interest Cents"},"payments_cents":{"type":"integer","title":"Payments Cents"},"statement_balance_cents":{"type":"integer","title":"Statement Balance Cents"}},"type":"object","required":["previous_balance_cents","new_purchases_cents","fees_cents","interest_cents","payments_cents","statement_balance_cents"],"title":"RollForwardResponse","description":"The statement summary band as one equation (§7.1)."},"SubledgerResponse":{"properties":{"credit_line_id":{"type":"string","title":"Credit Line Id"},"selected_cycle_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Cycle Id"},"roll_forward":{"anyOf":[{"$ref":"#/components/schemas/RollForwardResponse"},{"type":"null"}]},"open_cycle":{"anyOf":[{"$ref":"#/components/schemas/CreditCycleResponse"},{"type":"null"}]},"open_cycle_activity":{"items":{"$ref":"#/components/schemas/CardSettlementResponse"},"type":"array","title":"Open Cycle Activity"},"cycle_history":{"items":{"$ref":"#/components/schemas/CreditCycleResponse"},"type":"array","title":"Cycle History"},"current_balance_cents":{"type":"integer","title":"Current Balance Cents","default":0},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of"}},"type":"object","required":["credit_line_id"],"title":"SubledgerResponse","description":"Transactions tab payload (§7).\n\nCarries the roll-forward band for the selected cycle, the open-cycle\nactivity beneath it, and one row per closed cycle."},"SuccessEnvelope_SubledgerResponse_":{"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/SubledgerResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[SubledgerResponse]"},"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":[]}]}