# POST /api/v1/credit/programs

> Create a lending program

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

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

## 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. "tie".
- `display_name` (string · required)
- `status` (ProgramStatusEnum) → `ProgramStatusEnum`
- `limit_min_cents` (integer)
- `limit_max_cents` (integer)
- `allowed_term_days` (array · integer) — Selectable payback terms. Defaults to [30, 60, 90].
- `default_rate_bps` (integer)
- `default_disbursement_fee_bps` (integer)
- `max_float_days` (integer)
- `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)
- `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_criteria` (array · object) — Partner-owned rule set: key, label, threshold, comparator, source. Null while undecided (§2.7).
- `legal_lending_entity` (string)
- `statement_branding` (object)
- `event_delivery_mode` (EventDeliveryMode) → `EventDeliveryMode`
- `issuing_enabled` (boolean)
- `ramp_spend_program_id` (string)
- `allowed_mcc_codes` (array · string)
- `blocked_mcc_codes` (array · string)

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_CreditProgramResponse_`

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

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## 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
