{"openapi":"3.1.0","info":{"title":"POST /api/v1/businesses/{business_id}/cfo-portal/debt-schedule/instruments/{instrument_id}/payments","version":"1.0.0","description":"Record a payment against a debt instrument"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}/cfo-portal/debt-schedule/instruments/{instrument_id}/payments":{"post":{"tags":["cfo-portal"],"summary":"Record a payment against a debt instrument","description":"Record a payment on a loan, posting a balanced principal/interest entry.\n\n**Request Body:**\n- `payment_amount_cents`: total payment, split into principal + interest.\n- `cash_ledger_id`: bank/cash account the money moves through.\n- `payment_date`: optional, defaults to today.\n- `memo`: optional journal-entry memo.\n\nThe principal and interest accounts are resolved by direction:\ndebt we owe pays down Long-Term Debt with Interest Expense; a note\nreceivable collects against Notes Receivable with Interest Income.\nDecrements the instrument's outstanding balance by the principal\nportion.","operationId":"cfo_portal_record_debt_payment_api_v1_businesses__business_id__cfo_portal_debt_schedule_instruments__instrument_id__payments_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/DebtPaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebtPaymentResponse"}}}},"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":{"DebtPaymentRequest":{"properties":{"payment_amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Payment Amount Cents","description":"Total payment amount in cents (split into principal + interest)."},"cash_ledger_id":{"type":"string","minLength":1,"title":"Cash Ledger Id","description":"Bank/cash ledger the money moves through — paid from (debt we owe) or received into (a note receivable)."},"payment_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Payment Date","description":"Payment date (defaults to today)."},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Memo"}},"type":"object","required":["payment_amount_cents","cash_ledger_id"],"title":"DebtPaymentRequest","description":"Request payload for recording a payment against a debt instrument."},"DebtPaymentResponse":{"properties":{"journal_entry_id":{"type":"string","title":"Journal Entry Id"},"principal_cents":{"type":"integer","title":"Principal Cents"},"interest_cents":{"type":"integer","title":"Interest Cents"},"remaining_balance_cents":{"type":"integer","title":"Remaining Balance Cents"},"name":{"type":"string","title":"Name"},"direction":{"type":"string","title":"Direction"}},"type":"object","required":["journal_entry_id","principal_cents","interest_cents","remaining_balance_cents","name","direction"],"title":"DebtPaymentResponse","description":"Result of posting a loan payment."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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":[]}]}