# PATCH /api/v1/credit/programs/{program_id}

> Update a lending program

- **Tag:** credit
- **Operation ID:** `update_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. Moving a live program to `active` from another status is refused (`CREDIT_660`) while a blocking launch check fails, unless the patch carries `force_activate` with a reason. Operator action: an API token receives `403`.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `program_id` (path, string, required)

## Request body

Schema: `CreditProgramUpdateRequest`

- `display_name` (string)
- `status` (ProgramStatusEnum)
- `lending_model` (LendingModel)
- `limit_min_cents` (integer)
- `limit_max_cents` (integer)
- `allowed_term_days` (array · integer)
- `default_rate_bps` (integer)
- `default_disbursement_fee_bps` (integer)
- `allocation_order` (AllocationOrder)
- `loan_ordering` (LoanOrdering)
- `interest_accrual_start` (InterestAccrualStart)
- `minimum_payment_cents` (integer)
- `due_soon_days` (integer)
- `underwriting_wait_days` (integer) — Days the nightly sweep leaves a new underwriting assessment pending while the merchant's data lands.
- `auto_approve_default` (boolean) — What an assessment request that omits `auto_approve` asks for: `true` opens the line automatically when the gate passes.
- `gl_posting_enabled` (boolean)
- `gl_posting_review` (boolean) — Hold each journal entry as a draft an operator posts.
- `gl_funding_ledger_id` (string) — Ledger credited at origination: an active asset or liability ledger of this business (`CREDIT_910` otherwise). Point it at the Brex feed ledger so a card charge is booked once. Null is the default (Card Issuer Payable).
- `gl_cash_ledger_id` (string) — Ledger debited on repayment: an active asset ledger of this business (`CREDIT_910` otherwise). Point it at the Payliance feed ledger so a collected debit is booked once. Null is the default (Cash).
- `interest_cap_pct_of_principal_bps` (integer) — Ceiling on total interest per loan as a share of principal (2000 = 20%); null is uncapped. At the ceiling the loan's interest stops growing, statements bill no further interest, and the loan stays past_due. Reaches loans originated after the change only.
- `card_management` (string)
- `deferred_fee_recognition` (boolean)
- `email_statements` (boolean)
- `marketplace_listed` (boolean) — Offer the program on the capital marketplace. Only an `active` program may be listed (`CREDIT_840` otherwise).
- `marketplace_blurb` (string) — What the marketplace card says about the offer; null clears it.
- `notices` (CreditNoticeSettings)
- `compliance` (CompliancePolicy) — Compliance policy. Replaces the stored one whole; null clears it.
- `bank_settlement_matching` (boolean)
- `alert_slack_channel` (string)
- `alert_emails` (array · string)
- `allowance_policy` (object)
- `borrowing_base_policy` (BorrowingBasePolicy) — Replaces the whole policy; fields left out take their defaults.
- `interchange_source` (string)
- `interchange_bps` (integer)
- `issuing_provider` (string) — Card issuer adapter: ramp, brex, stripe_issuing, lithic, external or mock.
- `custom_terms_enabled` (boolean) — Allow custom payback terms (1-365 days) and limit envelopes ($100-$50,000,000) outside the default FRD range.
- `issuer_config` (object) — Provider-agnostic card issuer configuration. Replaces the stored object; null clears it.
- `bank_feed_config` (object) — Per-program bank feed configuration (`provider`, `data_project`, `dataset_template`). Replaces the stored object; null clears it.
- `portal_frame_ancestors` (array · string) — HTTPS origins permitted to embed the hosted borrower portal (`/p/credit/{token}?embed=1`). Replaces the stored list; null clears it.
- `payment_collection_config` (PaymentCollectionConfigInput) — Embeddable borrower payment iframe settings. Replaces stored settings (preserving an existing Payliance Card access key when omitted); null clears it.
- `statement_balance_mode` (string)
- `allocation_scope` (string)
- `cycle_close_rule` (string)
- `cycle_anchor_day` (integer)
- `excess_credit_disposition` (string)
- `collections_policy` (object)
- `monitoring_policy` (MonitoringPolicy) — Observation-only monitoring; send null to disable.
- `limit_review_policy` (LimitReviewPolicy) — Dynamic limit reviews. Send null to turn them off.
- `limit_change_policy` (string) — direct, approval_required or console_only. Leaving direct is refused while the limit-review policy says apply: direct.
- `late_terms` (object)
- `early_payoff_terms` (object)
- `underwriting_decision_policy` (UnderwritingDecisionPolicy) — Optional lender-owned evidence expiry and decline-reason requirements.
- `underwriting_criteria` (array · object)
- `legal_lending_entity` (string)
- `statement_branding` (object)
- `covenants` (object)
- `event_delivery_mode` (EventDeliveryMode)
- `bank_link_redirect_uris` (array · string) — The URLs a merchant's hosted bank Link may return to (see the create request). Replaces the stored list; null clears it.
- `event_delivery_locked` (boolean) — True holds `event_delivery_mode` where the operator set it; the partner's `PUT /credit/programs/{id}/event-delivery` is then refused.
- `sandbox_email_recipients` (array · string) — Sandbox only. Merchant addresses an email from this sandbox may be sent to, besides DayZero's own allow-list: an exact address or `@domain` for every address there; at most 25. A sent email's subject starts `[Sandbox]`. Ignored on a live business. Replaces the stored list; null clears it.
- `sandbox_email_redirect_to` (string) — Sandbox only. One address every merchant email from this sandbox goes to instead of the line's `merchant_email`, whatever the recipient list says. The subject starts `[Sandbox]` and names the merchant address it was meant for. Null sends to the merchant when allowed. Ignored on a live business. Null or blank clears it.
- `issuing_enabled` (boolean)
- `ramp_spend_program_id` (string)
- `issuer_timezone` (string) — The issuer's posting-date timezone (see the create request). Reaches settlements recorded after the change only.
- `ramp_cardholder_user_id` (string) — The issuing identity (see the create request). Verified as a user on the connected Ramp account when set; null clears it.
- `allowed_mcc_codes` (array · string)
- `blocked_mcc_codes` (array · string)
- `force_activate` (ForceActivateRequest) — Operator console only. With `status: active` on a live program that fails a blocking launch check, makes it active anyway; the reason, who and when are recorded as `activation_override`. Without it that change is refused (`CREDIT_660`); an API token cannot send it (`CREDIT_661`).

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_CreditProgramResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (CreditProgramResponse)

### 400 — Bad Request - Invalid input

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 401 — Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 404 — Not Found - Resource does not exist

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X PATCH 'https://api.ondayzero.com/api/v1/credit/programs/{program_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "display_name": "string",
  "status": "string",
  "lending_model": "string",
  "limit_min_cents": 0,
  "limit_max_cents": 0,
  "allowed_term_days": []
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/credit/programs/{program_id}', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "display_name": "string",
  "status": "string",
  "lending_model": "string",
  "limit_min_cents": 0,
  "limit_max_cents": 0,
  "allowed_term_days": []
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {'display_name': 'string',
 'status': 'string',
 'lending_model': 'string',
 'limit_min_cents': 0,
 'limit_max_cents': 0,
 'allowed_term_days': []}

response = httpx.patch("https://api.ondayzero.com/api/v1/credit/programs/{program_id}", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/credit/update-program
- OpenAPI slice: https://www.ondayzero.com/docs/reference/credit/update-program/openapi.json
- Other endpoints in **credit**: https://www.ondayzero.com/docs/reference/credit (markdown bundle: https://www.ondayzero.com/docs/reference/credit.md, OpenAPI: https://www.ondayzero.com/docs/reference/credit/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
