{"openapi":"3.1.0","info":{"title":"GET /api/v1/businesses/{business_id}/cfo-portal/debt-schedule/instruments/{instrument_id}/payment-schedule","version":"1.0.0","description":"Get a loan's customizable paydown table"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}/cfo-portal/debt-schedule/instruments/{instrument_id}/payment-schedule":{"get":{"tags":["cfo-portal"],"summary":"Get a loan's customizable paydown table","description":"Return the persisted, editable paydown schedule for a loan.","operationId":"cfo_portal_get_debt_schedule_table_api_v1_businesses__business_id__cfo_portal_debt_schedule_instruments__instrument_id__payment_schedule_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"instrument_id","in":"path","required":true,"schema":{"type":"string","title":"Instrument 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_DebtScheduleResponse_"}}}},"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":{"DebtScheduleResponse":{"properties":{"instrument_id":{"type":"string","title":"Instrument Id"},"name":{"type":"string","title":"Name"},"direction":{"type":"string","title":"Direction"},"current_balance_cents":{"type":"integer","title":"Current Balance Cents"},"rows":{"items":{"$ref":"#/components/schemas/DebtScheduleRowResponse"},"type":"array","title":"Rows"},"total_principal_cents":{"type":"integer","title":"Total Principal Cents","default":0},"total_interest_cents":{"type":"integer","title":"Total Interest Cents","default":0},"total_payment_cents":{"type":"integer","title":"Total Payment Cents","default":0}},"type":"object","required":["instrument_id","name","direction","current_balance_cents"],"title":"DebtScheduleResponse","description":"The full paydown table for a debt instrument plus summary totals."},"DebtScheduleRowResponse":{"properties":{"id":{"type":"string","title":"Id"},"debt_instrument_id":{"type":"string","title":"Debt Instrument Id"},"sequence":{"type":"integer","title":"Sequence"},"due_date":{"type":"string","format":"date","title":"Due Date"},"principal_cents":{"type":"integer","title":"Principal Cents"},"interest_cents":{"type":"integer","title":"Interest Cents"},"total_cents":{"type":"integer","title":"Total Cents"},"expected_balance_after_cents":{"type":"integer","title":"Expected Balance After Cents"},"status":{"type":"string","title":"Status"},"is_custom_edited":{"type":"boolean","title":"Is Custom Edited"},"paid_amount_cents":{"type":"integer","title":"Paid Amount Cents"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["id","debt_instrument_id","sequence","due_date","principal_cents","interest_cents","total_cents","expected_balance_after_cents","status","is_custom_edited","paid_amount_cents"],"title":"DebtScheduleRowResponse","description":"A single persisted, editable row of a loan's paydown table."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_DebtScheduleResponse_":{"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/DebtScheduleResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DebtScheduleResponse]"},"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":[]}]}