{"openapi":"3.1.0","info":{"title":"PATCH /api/v1/businesses/{business_id}/cfo-portal/debt-schedule/instruments/{instrument_id}","version":"1.0.0","description":"Update a debt instrument"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}/cfo-portal/debt-schedule/instruments/{instrument_id}":{"patch":{"tags":["cfo-portal"],"summary":"Update a debt instrument","description":"Update editable fields on an existing debt instrument.\n\n**Request Body:** Any of ``name``, ``current_balance_cents``, ``notes``,\n``amount_repaid_cents``, ``revenue_share_bps``, ``total_repayment_cap_cents``.\n\n**Returns:** The updated instrument snapshot.","operationId":"cfo_portal_update_debt_instrument_api_v1_businesses__business_id__cfo_portal_debt_schedule_instruments__instrument_id__patch","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/DebtInstrumentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DebtInstrumentUpdateResponse_"}}}},"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":{"DebtInstrumentUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"current_balance_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Current Balance Cents"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"},"amount_repaid_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Amount Repaid Cents"},"revenue_share_bps":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Revenue Share Bps"},"total_repayment_cap_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Total Repayment Cap Cents"}},"type":"object","title":"DebtInstrumentUpdateRequest","description":"Fields the CFO portal may update on an existing debt instrument."},"DebtInstrumentUpdateResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"current_balance_cents":{"type":"integer","title":"Current Balance Cents"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"amount_repaid_cents":{"type":"integer","title":"Amount Repaid Cents"},"revenue_share_bps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revenue Share Bps"},"total_repayment_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Repayment Cap Cents"}},"type":"object","required":["id","name","current_balance_cents","amount_repaid_cents"],"title":"DebtInstrumentUpdateResponse","description":"Outcome of updating a debt instrument."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_DebtInstrumentUpdateResponse_":{"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/DebtInstrumentUpdateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DebtInstrumentUpdateResponse]"},"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":[]}]}