apyhub
Back
▣ INGESTION KIT · DOCUMENT INTELLIGENCE KIT

Convert Bank Statement Format API

What it does

The Bank Statement Converter API turns bank statement files into structured data in one request. Send a fileUrl or fileContent, and choose format as json, csv, xlsx, or mt940.

Send inputFormat as auto when you want the API to detect camt or MT940 by content. Set it to camt053 or mt940 only when detection fails. You can also pass fileName, which becomes the source file name in the output rows.

The API returns statement rows and transaction rows in JSON, or one file row for csv, xlsx, and mt940. You get balances, dates, amounts, currency, references, remittance text, counterparty details, and balance checks in the result.

Teams use Bank Statement Converter API to load bank data into accounting tools. They use it for reconciliation, exports, and workflow steps that need bank statement data in a clean format. To turn documents into data first, use the Extract PDF Content API. To get text from scanned files, use the AI Image Optical Character Recognition (OCR) API.

POST
Bank Statement Converter - camt.053 / MT940 to JSON, CSV, Excel
https://api.eu.apyhub.com/martin10291/convert-bank-statement-format

QUICKSTART

GUIDE

Quickstart

Convert a bank statement by sending the statement content or a public file URL.

curl -X POST "https://api.eu.apyhub.com/martin10291/convert-bank-statement-format" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"format":"json","fileContent":":20:STMT20261124\n:25:NL91ABNA0417164300\n:28C:00001/001\n:60F:C261123EUR1000,00\n:61:2611241124D150,25NTRFNONREF//B1\n:86:Payment to ACME BV invoice 2026-11\n:62F:C261124EUR849,75\n-"}'

What you'll get back

Returns a JSON object with count as an integer and items as an array of result objects.

{
  "count": 2,
  "items": [
    {
      "type": "statement",
      "statementId": "STMT20261124",
      "account": "NL91ABNA0417164300",
      "currency": "EUR",
      "openingBalance": 1000,
      "closingBalance": 849.75,
      "sourceFormat": "mt940"
    },
    {
      "type": "transaction",
      "amount": -150.25,
      "currency": "EUR",
      "bookingDate": "2026-11-24",
      "remittance": "Payment to ACME BV invoice 2026-11"
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
json = one row per statement (balances + balance check) and one row per transaction; csv or xlsx = one row with the file as base64 (contentBase64) plus statement summaries; mt940 = camt converted to MT940 text (also base64).
Public http(s) link to a camt.053, camt.052 or MT940 file, or a .zip with several (max 10 MB, 50 files). For example a pre-signed S3/Drive link. Private and local addresses are refused. Leave empty and fill File content instead, or leave both empty to convert a built-in sample statement.
Optional original file name, used as sourceFile in the rows and as the name of the output file (for example statement-2026-11.xml).

About this endpoint

What it does

Converts a bank statement file from camt.053, camt.052, or MT940 into structured output. The request can be provided as a file URL or raw file content, and the response returns extracted statement rows in the requested format.

Request Body

ParameterTypeMandatoryDescription
formatENUMNoOutput format. Allowed values: json, csv, xlsx, mt940. json returns one row per statement and one row per transaction; csv or xlsx returns one row with the file as base64 (contentBase64) plus statement summaries; mt940 returns the statement converted to MT940 as plain text (text).
fileUrlStringNoPublic http(s) link to a camt.053, camt.052 or MT940 file, or a .zip with several files. Max 10 MB, up to 50 files. Private and local addresses are refused. Send either fileUrl or fileContent; if both are sent, fileUrl is used.
fileNameStringNoOptional original file name. Used as sourceFile in the rows and as the name of the output file.
fileContentStringNoThe statement itself: raw XML / MT940 text, or base64 of the file. Zip is allowed. Max 10 MB. Processed in memory only, never stored or logged.
inputFormatENUMNoInput format override. Allowed values: auto, camt053, mt940. auto detects camt (XML) or MT940 by content; set it only if detection fails.

One of fileUrl or fileContent is required.

Response

Returns a JSON object with a count integer field and an items array of objects. count is the number of rows in items, and each item contains the extracted statement fields defined by the schema.

ParameterTypeDescription
countIntegerNumber of rows in items.
itemsObject ArrayArray of result rows. Each row has a type: statement and transaction rows for json, or one file row for csv, xlsx and mt940.
items[].typeStringRow type: statement, transaction or file.
items[].statementIdStringStatement reference (statement and transaction rows).
items[].accountStringAccount number or IBAN (statement and transaction rows).
items[].bicStringBank BIC, if present (statement rows).
items[].ownerNameStringAccount holder name, if present (statement rows).
items[].currencyStringCurrency, e.g. EUR.
items[].sequenceNumberStringStatement sequence number, if present (statement rows).
items[].creationDateStringDate the statement was created (YYYY-MM-DD), if present (statement rows).
items[].openingDateStringDate of the opening balance (YYYY-MM-DD) (statement rows).
items[].openingBalanceNumberOpening balance (statement rows).
items[].closingDateStringDate of the closing balance (YYYY-MM-DD) (statement rows).
items[].closingBalanceNumberClosing balance (statement rows).
items[].sumCreditsNumberTotal of all credits (statement rows).
items[].sumDebitsNumberTotal of all debits, as a negative number (statement rows).
items[].transactionCountIntegerNumber of transactions in the statement (statement rows).
items[].entryCountIntegerNumber of entries in the statement (statement rows).
items[].balanceCheckObjectBalance check (statement rows): expectedClosing (opening + credits + debits), closingBalance, difference, and ok (true when they match).
items[].sourceFormatStringDetected input format, e.g. mt940 or camt.053.001.02 (statement rows).
items[].sourceFileStringInput file name (from fileName) (statement and transaction rows).
items[].amountNumberTransaction amount. Negative for debits, positive for credits (transaction rows).
items[].creditDebitStringCRDT or DBIT (transaction rows).
items[].bookingDateStringBooking date (YYYY-MM-DD) (transaction rows).
items[].valueDateStringValue date (YYYY-MM-DD) (transaction rows).
items[].statusStringEntry status, e.g. BOOK (transaction rows).
items[].reversalBooleantrue if the entry is a reversal (transaction rows).
items[].counterpartyNameStringName of the other party, if present (transaction rows).
items[].counterpartyIbanStringIBAN of the other party, if present (transaction rows).
items[].counterpartyBicStringBIC of the other party's bank, if present (transaction rows).
items[].remittanceStringPayment description / remittance text (transaction rows).
items[].referenceStringCustomer reference, if present (transaction rows).
items[].bankReferenceStringBank reference, if present (transaction rows).
items[].endToEndIdStringSEPA end-to-end ID, if present (transaction rows).
items[].mandateIdStringSEPA direct debit mandate ID, if present (transaction rows).
items[].creditorIdStringSEPA creditor ID, if present (transaction rows).
items[].purposeCodeStringPurpose code, if present (transaction rows).
items[].bankTxCodeStringBank transaction code, e.g. NTRF (transaction rows).
items[].additionalInfoStringAny extra information from the statement (transaction rows).
items[].fileNameStringName of the output file, e.g. statement.csv (file rows).
items[].formatStringOutput format: csv, xlsx or mt940 (file rows).
items[].contentBase64StringThe output file as base64 (file rows, csv and xlsx).
items[].textStringThe MT940 output as plain text (file rows, mt940).
items[].rowsIntegerNumber of transaction rows in the output file (file rows).
items[].sizeBytesIntegerSize of the output file in bytes (file rows).
items[].statementsObject ArrayStatement summaries with balances and balanceCheck (file rows, csv and xlsx).
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.