{"openapi":"3.1.0","info":{"title":"POST /api/v1/businesses/{business_id}/cfo-portal/debt-schedule/instruments/{instrument_id}/payment-schedule/rows","version":"1.0.0","description":"Add a row to a loan's 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/rows":{"post":{"tags":["cfo-portal"],"summary":"Add a row to a loan's paydown table","description":"Add a user-defined payment row to a loan's paydown table.","operationId":"cfo_portal_add_debt_schedule_row_api_v1_businesses__business_id__cfo_portal_debt_schedule_instruments__instrument_id__payment_schedule_rows_post","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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebtScheduleRowCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DebtScheduleResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"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."},"DebtScheduleRowCreateRequest":{"properties":{"due_date":{"type":"string","format":"date","title":"Due Date"},"principal_cents":{"type":"integer","minimum":0.0,"title":"Principal Cents","default":0},"interest_cents":{"type":"integer","minimum":0.0,"title":"Interest Cents","default":0},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"}},"type":"object","required":["due_date"],"title":"DebtScheduleRowCreateRequest","description":"Request to add a custom row to a loan's paydown table."},"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":[]}]}