# PUT /api/v1/credit/merchant-profile

> Set a merchant's profile

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

## Description

Name the merchant as on `POST /credit/bank-feeds` (`program_id` and `external_merchant_id`, or `credit_line_id`); DayZero uses its business, creating it the first time, and gives your token read access to it. Records the merchant's start date (`business_started_on`), legal form, NAICS code, MCC, industry, country and currency. Fields left out keep what an earlier call set. `months_in_business` reads the declared start date first (`evidence.basis: declared`); without one it infers the age from the first Shopify order or bank transaction (`basis: inferred`). The currency becomes the business's while its books are empty.

## Authentication

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

## Request body

Schema: `MerchantProfileRequest`

- `program_id` (string) — Your program the merchant is applying under. Required without `credit_line_id`; with it, must be the line's program if sent.
- `external_merchant_id` (string) — Your id for the merchant, as on `POST /credit/bank-feeds` and `POST /credit/lines`. Required without `credit_line_id`.
- `credit_line_id` (string) — The merchant's open line, when there is one.
- `merchant_legal_name` (string) — Names the merchant's DayZero business when this call creates it. Ignored when the business exists.
- `merchant_business_id` (string) — The merchant's existing DayZero business, when your token can reach it. Leave it out and DayZero uses the business the merchant was linked to before, or creates one.
- `business_started_on` (string · date) — When the business started trading (its founding date). `months_in_business` reads it before any date it can infer from the data (`basis: declared`). Not in the future.
- `legal_entity_type` (string) — The merchant's legal form.
- `naics_code` (string) — NAICS industry code, 2 to 6 digits.
- `mcc` (string) — The merchant's own card-acceptance MCC, 4 digits.
- `industry` (string) — Free-text industry, e.g. `apparel` or `restaurant`.
- `country` (string) — ISO 3166-1 alpha-2 country the merchant trades from.
- `currency` (string) — ISO 4217 currency the merchant's books are kept in. Applied to the merchant's business while it holds no journal entries; after that it is recorded and `currency_applied` is false.

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_MerchantProfileResponse_`

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

### 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 PUT 'https://api.ondayzero.com/api/v1/credit/merchant-profile' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "program_id": "string",
  "external_merchant_id": "string",
  "credit_line_id": "string",
  "merchant_legal_name": "string",
  "merchant_business_id": "string",
  "business_started_on": "2026-01-01"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/credit/merchant-profile', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "program_id": "string",
  "external_merchant_id": "string",
  "credit_line_id": "string",
  "merchant_legal_name": "string",
  "merchant_business_id": "string",
  "business_started_on": "2026-01-01"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {'program_id': 'string',
 'external_merchant_id': 'string',
 'credit_line_id': 'string',
 'merchant_legal_name': 'string',
 'merchant_business_id': 'string',
 'business_started_on': '2026-01-01'}

response = httpx.put("https://api.ondayzero.com/api/v1/credit/merchant-profile", headers=headers, json=payload)
data = response.json()
```

## See also

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