# POST /api/v1/credit/bank-feeds/{bank_feed_id}/ingest

> Push bank accounts, transactions, and balances into a bank feed

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

## Description

For partners that pull merchant bank data in their own backend and push it directly into DayZero without BigQuery (`provider: direct_push`, or to seed a feed immediately). Each cash account gets a bank ledger on the merchant's DayZero business, posted transactions are booked with journal entries, voided transactions are hidden, and daily balance snapshots are interpolated across the history so underwriting and bank-settlement payment matching read them immediately. Idempotent on `transaction_id` and `(account_id, as_of)`.

## Authentication

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

## Parameters

- `bank_feed_id` (path, string, required) — The bank feed to push bank data into.

## Request body

Schema: `BankFeedIngestRequest`

- `accounts` (array · BankFeedIngestAccount) → `BankFeedIngestAccount` — Bank accounts on the merchant's feed.
  - `account_id` (string · required) — Your stable id for the bank account (e.g. `fca_...` or `acct_...`).
  - `institution_name` (string) — The bank's name.
  - `display_name` (string) — The account's display name.
  - `last4` (string) — The last four digits of the account.
  - `status` (string) — Account status (`active`, `inactive`).
  - `type` (string) (one of: cash, credit) — Account kind (`cash` is synced to a bank ledger; `credit` is skipped).
- `transactions` (array · BankFeedIngestTransaction) → `BankFeedIngestTransaction` — Bank transactions to upsert or void.
  - `transaction_id` (string · required) — Your idempotency key for the bank transaction.
  - `account_id` (string · required) — The `account_id` this transaction belongs to.
  - `amount_cents` (integer · required) — Signed amount in cents (cash-flow sign: money into the account is positive, money leaving the account is negative).
  - `currency` (string) — Three-letter ISO currency code.
  - `description` (string · required) — The bank statement description.
  - `status` (string) (one of: posted, pending, void) — `posted` books onto the merchant's ledger; `pending` is skipped; `void` removes a previously posted transaction.
  - `transacted_on` (string · date · required) — The calendar date the transaction posted at the bank.
  - `category` (string) — The transaction's category as a Plaid personal-finance detailed code, e.g. `BANK_FEES_OVERDRAFT_FEES`, `BANK_FEES_INSUFFICIENT_FUNDS`, `INCOME_OTHER_INCOME`. Read by the same measures that read Plaid's (`nsf_count_12m` counts the two bank-fee codes); other codes are kept as a categorisation hint. Optional: without it the description is read.
  - `category_source` (string) — Where `category` came from, e.g. `plaid`, `stripe_fc`, `partner`. Recorded with the transaction; optional.
- `balances` (array · BankFeedIngestBalance) → `BankFeedIngestBalance` — Reported closing balances; intermediate days are interpolated.
  - `account_id` (string · required) — The `account_id` this balance snapshot belongs to.
  - `as_of` (string · date · required) — The calendar day this closing balance applies to.
  - `current_balance_cents` (integer · required) — Closing balance on `as_of`, in cents.
  - `currency` (string) — Three-letter ISO currency code of the balance. Underwriting reads balances in the merchant business's own currency only; balances in any other currency are stored and left out of the measures, never converted.
  - `type` (string) (one of: cash, credit) — Account kind (`cash` or `credit`).

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_BankFeedIngestResponse_`

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

### 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 POST 'https://api.ondayzero.com/api/v1/credit/bank-feeds/{bank_feed_id}/ingest' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "accounts": [],
  "transactions": [],
  "balances": []
}'
```

### JavaScript

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

### Python

```python
import httpx

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

payload = {'accounts': [], 'transactions': [], 'balances': []}

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

## See also

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