---
title: "Import bank transactions"
method: POST
path: "/bank-imports"
tags: ["Bank Imports"]
---

# Import bank transactions

`POST /bank-imports`

## Request

- Base URL: `https://api.lumabill.ch/v1`
- URL: `https://api.lumabill.ch/v1/bank-imports`
- Auth: HTTP bearer

Upload a CAMT.053 XML file or a CSV bank statement. The import is processed asynchronously; poll the returned `id` via the `status` field if needed. A CAMT file with statements in several account currencies imports the statements in the bank account's currency and reports the others in `warnings` (STATEMENT_CURRENCY_SKIPPED); a file with no statement in that currency is refused with 400 STATEMENT_CURRENCY_MISMATCH. Currency codes are accepted in any case. A `content` over 5 MB answers 400 STATEMENT_INLINE_TOO_LARGE; a CAMT file with a DOCTYPE or ENTITY declaration answers 400 STATEMENT_XML_DTD_REFUSED before it is parsed.

## Response `201`

Import job accepted

- BankImportResult
  - `id` string, uuid, required
  - `transactions_count` integer, required: Number of transactions parsed from the uploaded file
  - `status` 'pending' | 'processing' | 'completed' | 'failed', required
  - `warnings` object[]: Present only when the import has warnings. STATEMENT_CURRENCY_SKIPPED: statements in another account currency were not imported (`skippedStatements`, `skippedTransactions`, `currencies`, `bankAccountCurrency`). STATEMENT_LEDGER_MISMATCH: the CAMT closing balance differs from the ledger balance of the bank account.
    - `code` 'STATEMENT_CURRENCY_SKIPPED' | 'STATEMENT_LEDGER_MISMATCH', required

## Other responses

- `400`: Validation error
- `401`: Invalid or missing API key
- `403`: Subscription required or read-only key on a write endpoint
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/lumabill/apis/lumabill-api.md) · [All operations](https://skmtc.dev/lumabill/apis/lumabill-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lumabill/apis/lumabill-api/revisions/e48e7099b545?raw)
