{"openapi":"3.1.0","info":{"title":"PATCH /api/v1/credit/programs/{program_id}","version":"1.0.0","description":"Update a lending program"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/programs/{program_id}":{"patch":{"tags":["credit"],"summary":"Update a lending program","description":"Supplying `late_terms`, `early_payoff_terms`, or `underwriting_criteria` is what settles the corresponding open decision: the guarded code paths stop raising once a rule body exists.","operationId":"update_program_api_v1_credit_programs__program_id__patch","parameters":[{"name":"program_id","in":"path","required":true,"schema":{"type":"string","title":"Program 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/CreditProgramUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditProgramResponse_"}}}},"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":{"CreditProgramResponse":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"display_name":{"type":"string","title":"Display Name"},"status":{"$ref":"#/components/schemas/ProgramStatusEnum"},"limit_min_cents":{"type":"integer","title":"Limit Min Cents"},"limit_max_cents":{"type":"integer","title":"Limit Max Cents"},"allowed_term_days":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Allowed Term Days"},"default_rate_bps":{"type":"integer","title":"Default Rate Bps"},"default_disbursement_fee_bps":{"type":"integer","title":"Default Disbursement Fee Bps"},"max_float_days":{"type":"integer","title":"Max Float Days"},"legal_lending_entity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Lending Entity"},"statement_branding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Statement Branding"},"event_delivery_mode":{"$ref":"#/components/schemas/EventDeliveryMode"},"issuing_enabled":{"type":"boolean","title":"Issuing Enabled"},"issuing_provider":{"type":"string","title":"Issuing Provider"},"ramp_spend_program_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ramp Spend Program Id"},"allowed_mcc_codes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Mcc Codes"},"blocked_mcc_codes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Blocked Mcc Codes"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"policy":{"anyOf":[{"$ref":"#/components/schemas/PolicyDecisionStatus"},{"type":"null"}]}},"type":"object","required":["id","slug","display_name","status","limit_min_cents","limit_max_cents","default_rate_bps","default_disbursement_fee_bps","max_float_days","event_delivery_mode","issuing_enabled","issuing_provider"],"title":"CreditProgramResponse","description":"A partner lending program."},"CreditProgramUpdateRequest":{"properties":{"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"status":{"anyOf":[{"$ref":"#/components/schemas/ProgramStatusEnum"},{"type":"null"}]},"default_rate_bps":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Default Rate Bps"},"default_disbursement_fee_bps":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Default Disbursement Fee Bps"},"statement_balance_mode":{"anyOf":[{"type":"string","enum":["cumulative","cycle_scoped"]},{"type":"null"}],"title":"Statement Balance Mode"},"allocation_scope":{"anyOf":[{"type":"string","enum":["per_cycle","across_line"]},{"type":"null"}],"title":"Allocation Scope"},"cycle_close_rule":{"anyOf":[{"type":"string","enum":["calendar_month_end","anchor_day","operational_trigger"]},{"type":"null"}],"title":"Cycle Close Rule"},"cycle_anchor_day":{"anyOf":[{"type":"integer","maximum":31.0,"minimum":1.0},{"type":"null"}],"title":"Cycle Anchor Day"},"excess_credit_disposition":{"anyOf":[{"type":"string","enum":["carry_forward","refund_merchant"]},{"type":"null"}],"title":"Excess Credit Disposition"},"late_terms":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Late Terms"},"early_payoff_terms":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Early Payoff Terms"},"underwriting_criteria":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Underwriting Criteria"},"legal_lending_entity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Lending Entity"},"statement_branding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Statement Branding"},"event_delivery_mode":{"anyOf":[{"$ref":"#/components/schemas/EventDeliveryMode"},{"type":"null"}]},"issuing_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Issuing Enabled"},"ramp_spend_program_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ramp Spend Program Id"},"allowed_mcc_codes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Mcc Codes"},"blocked_mcc_codes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Blocked Mcc Codes"}},"additionalProperties":false,"type":"object","title":"CreditProgramUpdateRequest","description":"Patch a program. Only supplied fields change."},"EventDeliveryMode":{"type":"string","enum":["webhook","polling","both"],"title":"EventDeliveryMode","description":"How a partner learns that something happened.\n\nThe FRD lists this twice as an open joint decision (§13.3 items 2 and\n6). Making it per-program means the decision never blocks the build:\na partner that wants webhooks registers an endpoint, one that wants to\npoll simply does not."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PolicyDecisionStatus":{"properties":{"statement_balance_mode":{"type":"string","title":"Statement Balance Mode"},"allocation_scope":{"type":"string","title":"Allocation Scope"},"cycle_boundary_basis":{"type":"string","title":"Cycle Boundary Basis"},"cycle_close_rule":{"type":"string","title":"Cycle Close Rule"},"excess_credit_disposition":{"type":"string","title":"Excess Credit Disposition"},"late_terms_decided":{"type":"boolean","title":"Late Terms Decided"},"early_payoff_decided":{"type":"boolean","title":"Early Payoff Decided"},"underwriting_criteria_decided":{"type":"boolean","title":"Underwriting Criteria Decided"},"undecided":{"items":{"type":"string"},"type":"array","title":"Undecided","description":"Rules with no answer yet. Paths needing them raise."}},"type":"object","required":["statement_balance_mode","allocation_scope","cycle_boundary_basis","cycle_close_rule","excess_credit_disposition","late_terms_decided","early_payoff_decided","underwriting_criteria_decided"],"title":"PolicyDecisionStatus","description":"Which rules this program is running on, and which are still open.\n\nSurfaced deliberately: a partner integrating against the API should be\nable to see that, say, the late-fee path will raise, rather than\ndiscovering it when a cycle first goes past due."},"ProgramStatusEnum":{"type":"string","enum":["draft","active","paused","retired"],"title":"ProgramStatusEnum","description":"Whether a program may open new lines."},"SuccessEnvelope_CreditProgramResponse_":{"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/CreditProgramResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditProgramResponse]"},"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":[]}]}