# POST /api/v1/credit/bank-feeds

> Register a merchant's bank feed

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

## Description

For a merchant whose bank you already hold through Stripe Financial Connections and copy into BigQuery (`ab_stripe_fc_{app_id}`). Name the merchant (`program_id` and `external_merchant_id` while it applies, or `credit_line_id`) and its `app_id`. DayZero uses the merchant's DayZero business, creating it the first time, gives your token read access to it, and starts syncing: posted transactions and balances land on that business, where underwriting reads them, every six hours. The dataset must grant DayZero's service account `READER`; until it does the feed reads `error` with `last_error: not_shared`. Registering the same `app_id` again returns the feed (`created: false`) and resumes it if it was removed; for another merchant it is `409` `CREDIT_832`.

## Authentication

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

## Request body

Schema: `BankFeedRegisterRequest`

- `app_id` (string · required) — Your organisation id for the merchant, as it appears in the bank data dataset's name (`ab_stripe_fc_{app_id}`) or your direct-push merchant feed key. Letters, digits and underscores (`400` `CREDIT_831` otherwise). One organisation feeds one merchant (`409` `CREDIT_832`).
- `provider` (string) — Where the merchant's bank data arrives from: `stripe_fc_bigquery` (pulled from your BigQuery dataset) or `direct_push` (pushed directly via `POST /credit/bank-feeds/{id}/ingest`). Defaults to the program's `bank_feed_config.provider`, else `stripe_fc_bigquery`.
- `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 you send it on `POST /credit/lines` and `POST /credit/bank-connections`. Required without `credit_line_id`. The merchant keeps one DayZero business whichever way its bank arrives.
- `credit_line_id` (string) — An open line of yours. Its program and merchant are used; a different `program_id` or `external_merchant_id` is `400` `CREDIT_781`.
- `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 (`400` `CREDIT_788` when it names another).

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_BankFeedResponse_`

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

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

### 409 — Conflict - Resource already exists or is in an incompatible state

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/bank-feeds' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "app_id": "string"
}'
```

### JavaScript

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

### Python

```python
import httpx

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

payload = {'app_id': 'string'}

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

## See also

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