# POST /api/v1/credit/programs

> Create a lending program

- **Tag:** credit
- **Operation ID:** `create_program`

## Description

Stand up a partner lending program. The program carries the parameter envelope, the policy positions, statement branding, and the card-issuing configuration, so onboarding a second partner is a row rather than a build. Operator action: an API token receives `403`. Needs the Credit Ledger add-on (403 `BILLING_003`), which a business that already runs a program keeps.

## Authentication

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

## Request body

Schema: `CreditProgramCreateRequest`

- `slug` (string · required) — Stable partner key, e.g. "northwind".
- `display_name` (string · required) — The lender's name as merchants see it: statements, emails, the portal.
- `status` (ProgramStatusEnum) → `ProgramStatusEnum` — draft (being set up) and active both take new lines; paused takes none and stops new originations but services the book; retired is closed. On a live business a program becomes active only while its blocking launch checks pass, unless an operator forces it.
- `force_activate` (ForceActivateRequest) — Operator console only. With `status: active` on a live business, creates the program active although a blocking launch check fails; the reason, who and when are recorded as `activation_override`. Without it a program created `active` that fails a blocking check is refused (`CREDIT_660`): create it as a draft and activate it once the checklist is green. An API token cannot force (`403`).
- `lending_model` (LendingModel) → `LendingModel` — per_transaction: one loan per card transaction with its own term, due date, fee, and daily accrual after the due date (FRD v2 D-01). cycle_draw: one draw per monthly cycle (FRD v1).
- `limit_min_cents` (integer)
- `limit_max_cents` (integer)
- `allowed_term_days` (array · integer) — Selectable payback terms. Defaults to [30, 45, 60, 90] (D-03).
- `default_rate_bps` (integer) — Annual rate. 2000 = 20% APR (D-05).
- `default_disbursement_fee_bps` (integer) — Fee assessed once at origination on each transaction, in basis points. 0-500 (0%-5%) per FRD v2 D-04.
- `max_float_days` (integer)
- `allocation_order` (AllocationOrder) → `AllocationOrder` — Bucket order a payment fills within one loan (D-10).
- `loan_ordering` (LoanOrdering) → `LoanOrdering` — Which open loan a payment reaches first (D-11).
- `interest_accrual_start` (InterestAccrualStart) → `InterestAccrualStart` — Daily accrual starts at the loan's due date (D-07) or at origination.
- `minimum_payment_cents` (integer) — Minimum per-loan payment; the outstanding amount when smaller (D-09).
- `due_soon_days` (integer) — Days ahead the due-soon event fires (D-24).
- `underwriting_wait_days` (integer) — Days the nightly sweep leaves a new underwriting assessment pending while the merchant's bank backfill, categorisation and Shopify sync finish. Past it the sweep completes the assessment with whatever data exists. `POST .../run` never waits.
- `auto_approve_default` (boolean) — What an assessment request that omits `auto_approve` asks for. `true`: DayZero opens the merchant's line itself when the completed assessment passes the gate, as `auto_approve: true` does. `false` (default): the lender records the decision. An explicit `auto_approve` on the request always wins.
- `gl_posting_enabled` (boolean) — Post journal entries on the operator's books (App. A.4).
- `gl_posting_review` (boolean) — With `gl_posting_enabled`: hold each journal entry as a draft an operator posts from Credit Ledger > Postings, instead of booking it as the event happens.
- `gl_funding_ledger_id` (string) — Ledger credited at origination: an active asset or liability ledger of this business (`CREDIT_910` otherwise). Default: Card Issuer Payable. Point it at the Brex feed ledger.
- `gl_cash_ledger_id` (string) — Ledger debited on repayment: an active asset ledger of this business (`CREDIT_910` otherwise). Default: Cash. Point it at the Payliance feed ledger.
- `interest_cap_pct_of_principal_bps` (integer) — Ceiling on total interest one loan can accrue, as a share of its principal. 2000 = 20%. Null (the default) is uncapped: interest accrues until the loan is repaid (D-07). At the ceiling the loan's interest stops growing, statements bill no further interest, and the loan stays past_due until it is paid. A cap reduces what a long-past-due merchant owes.
- `card_management` (string) (one of: dayzero, partner) — dayzero: DayZero provisions cards and pushes spend limits. partner: the partner provisions in the issuer, registers the card id, and receives credit.line.limit_changed events to push limits itself.
- `deferred_fee_recognition` (boolean) — Recognise the disbursement fee over the term on the operator's books.
- `email_statements` (boolean) — Email the statement PDF to the merchant when it issues.
- `marketplace_listed` (boolean) — Offer the program to borrowing businesses on their Capital page (`GET /capital/offers`). Only an `active` program may be listed (`CREDIT_840` otherwise).
- `marketplace_blurb` (string) — What the marketplace card says about the offer. Plain text.
- `notices` (CreditNoticeSettings) — Borrower notices to send, each off unless switched on: due_soon, past_due, loan_paid, statement_issued, collections, limit_changed, and reply_to. Branded from `statement_branding`. `in_app` (on unless set false) records an in-app notification for each one.
- `compliance` (CompliancePolicy) — Compliance policy: disclosures, adverse-action notices and the template versions they use. Null, or `enabled: false`, changes nothing. See the guide's Compliance section.
- `bank_settlement_matching` (boolean) — Settle pending payments from the bank feed: the debit on the line's linked account, or a wire whose sender is a recorded alias, confirms the payment as at the bank date, and a return reverses it. Every decision is listed under `GET /credit/lines/{id}/payment-matches`.
- `alert_slack_channel` (string)
- `alert_emails` (array · string)
- `allowance_policy` (object) — Loan-loss allowance buckets, e.g. {"buckets":[{"label":"1–30","from_days":1,"to_days":30,"rate_bps":200}]}.
- `borrowing_base_policy` (BorrowingBasePolicy) — Borrowing-base eligibility: include_fees, max_days_past_due, exclude_on_hold, concentration_limit_bps, advance_rate_bps. Null means the defaults.
- `interchange_source` (string) (one of: none, estimate, issuer_report) — How interchange is recognised (D-32). estimate: interchange_bps of each cleared settlement, trued up when an issuer report row arrives. issuer_report: only from reported rows. none: not recognised.
- `interchange_bps` (integer) — Estimated interchange rate, e.g. 175 = 1.75%.
- `statement_balance_mode` (string) (one of: cumulative, cycle_scoped)
- `allocation_scope` (string) (one of: per_cycle, across_line)
- `cycle_boundary_basis` (string) (one of: issuer_clearing_date, merchant_local, utc)
- `cycle_close_rule` (string) (one of: calendar_month_end, anchor_day, operational_trigger)
- `cycle_anchor_day` (integer)
- `excess_credit_disposition` (string) (one of: carry_forward, refund_merchant)
- `collections_policy` (object) — Delinquency ladder (D-31): {"stages": [{"days_past_due": 30, "action": "suspend_cards", "label": "Suspended"}]}. Actions: suspend_cards, suspend_line, notify.
- `monitoring_policy` (MonitoringPolicy) — Observation-only monitoring; null or enabled=false is off.
- `limit_review_policy` (LimitReviewPolicy) — Dynamic limit reviews: on a weekly or monthly cadence each line's limit is re-derived as formula (basis × pct_bps), clamped to the floor/cap and program envelope, held to the step limits, then adjusted by the risk triggers. Null means limits move only by hand.
- `limit_change_policy` (string) (one of: direct, approval_required, console_only) — Who may move a line's credit limit. direct: PATCH /credit/lines/{id} with credit_limit_cents applies it. approval_required: every change is a limit-change request a different console operator approves. console_only: an API token may only request a change; a console operator changes the limit.
- `late_terms` (object) — Late fee / late interest rule body. Leave null while undecided — the late path raises rather than guessing a rate (§2.3).
- `early_payoff_terms` (object) — interest_rebate (pro_rata | fully_earned) and fee_rebate (none | pro_rata). Null while undecided (§2.5).
- `underwriting_decision_policy` (UnderwritingDecisionPolicy) — Optional lender-owned evidence expiry and decline-reason requirements.
- `underwriting_criteria` (array · object) — Partner-owned rule set: key, label, threshold, comparator, source. Null while undecided (§2.7).
- `legal_lending_entity` (string)
- `statement_branding` (object)
- `covenants` (object) — Read-only reflection of the Credit Agreement's universal covenants for the partner UI (§10.1): e.g. cash_covenant_bps, negative, affirmative. Not enforced by the ledger.
- `event_delivery_mode` (EventDeliveryMode) → `EventDeliveryMode` — polling writes the event feed only; webhook also pushes each event to the business's subscribed endpoints; both does both. Polling stays the source of truth.
- `bank_link_redirect_uris` (array · string) — The https URLs a merchant's hosted bank Link may return to when it finishes: the `completion_redirect_uri` values `POST /credit/bank-connections` accepts, matched exactly. No query or fragment; at most 10. Null allows none.
- `event_delivery_locked` (boolean) — Hold `event_delivery_mode` where the operator set it: the partner's `PUT /credit/programs/{id}/event-delivery` is refused (`CREDIT_818`).
- `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.
- `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.
- `issuing_enabled` (boolean) — Whether DayZero issues and manages cards for this program's lines through the issuing provider (DayZero-managed cards).
- `issuing_provider` (string) (one of: ramp, brex, stripe_issuing, lithic, external, mock) — Card issuer adapter: ramp, brex (Plaid-connected Brex cards/lines), stripe_issuing, lithic, external (Bring-Your-Own-Issuer via events/webhooks), or mock (in-memory sandbox issuer).
- `custom_terms_enabled` (boolean) — When true, `allowed_term_days` may contain any 1 to 365 day payback terms and `limit_min_cents` / `limit_max_cents` may sit anywhere between $100 and $50,000,000 outside the default FRD envelope.
- `issuer_config` (object) — Provider-agnostic card issuer configuration: `spend_program_id`, `cardholder_mode` (`shared_operator_user` or `per_merchant`), `default_cardholder_id`, and `webhook_url`.
- `bank_feed_config` (object) — Per-program merchant bank feed configuration: `provider` (`stripe_fc_bigquery` or `direct_push`), `data_project` (GCP project id) and `dataset_template` (e.g. `ab_stripe_fc_{app_id}`).
- `portal_frame_ancestors` (array · string) — HTTPS origins permitted to embed the hosted borrower portal (`/p/credit/{token}?embed=1`) inside an iframe, e.g. `["https://app.partner.com"]`. Null or empty forbids framing.
- `payment_collection_config` (PaymentCollectionConfigInput) — Embeddable borrower payment iframe settings (`enabled`, `rails`, card convenience fees, partial payments, and Payliance Card credentials).
- `ramp_spend_program_id` (string) — Ramp spend program the issued cards' funds are created under. On a Ramp program it is looked up on the connected Ramp account when set or changed (`CREDIT_911` when Ramp does not have it; not checked while Ramp is not connected).
- `issuer_timezone` (string) — IANA timezone whose calendar day is the issuer's posting date (D-12). Ramp's `settlement_date` is a timestamp; the settlement's `settled_on`, and so its statement period, is its date in this zone. A date with no time is taken as given. Default America/New_York.
- `ramp_cardholder_user_id` (string) — The issuing identity: the one user on your Ramp account every card is issued to. The merchant is never a Ramp user. Verified as a user on the connected Ramp account when set (`CREDIT_701` otherwise).
- `allowed_mcc_codes` (array · string) — Merchant category codes a card may spend at; mapped to Ramp category codes on the issuer. Empty means no restriction.
- `blocked_mcc_codes` (array · string) — Merchant category codes a card may never spend at (sent to Ramp as MCCs).

## Responses

### 201 — 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.

### 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 POST 'https://api.ondayzero.com/api/v1/credit/programs' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "slug": "string",
  "display_name": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/credit/programs', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "slug": "string",
  "display_name": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {'slug': 'string', 'display_name': 'string'}

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

## See also

- HTML version: https://www.ondayzero.com/docs/reference/credit/create-program
- OpenAPI slice: https://www.ondayzero.com/docs/reference/credit/create-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
