curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/bank-statements/read \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form bank_account_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'account_name=<string>' \
--form opening_balance=121.00 \
--form closing_balance=121.00import requests
url = "https://api.melso.ai/v1/companies/{company_id}/bank-statements/read"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_name": "<string>",
"opening_balance": "121.00",
"closing_balance": "121.00"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('bank_account_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('account_name', '<string>');
form.append('opening_balance', '121.00');
form.append('closing_balance', '121.00');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.melso.ai/v1/companies/{company_id}/bank-statements/read', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"format": "norma43",
"iban": "<string>",
"currency": "<string>",
"period_start": "2023-12-25",
"period_end": "2023-12-25",
"opening_balance": "<string>",
"closing_balance": "<string>",
"movement_total": "121.00",
"difference": "<string>",
"bank_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"currency": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"iban": "<string>",
"external_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"movements": [
{
"line_number": 123,
"booked_on": "2023-12-25",
"value_on": "2023-12-25",
"amount": "121.00",
"balance_after": "<string>",
"concept": "<string>",
"counterparty_name": "<string>",
"reference": "<string>",
"duplicate": true
}
],
"new_movements": 123,
"duplicates": 123,
"questions": [
"account"
],
"can_save": true
}{
"error": "lines[0].vat_rate must be 21, 10, 4 or 0",
"code": "invalid_invoice",
"request_id": "req_01JAB3K9X2"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax service is not active for this company",
"code": "tax_service_required",
"request_id": "req_01JAB3K9X2"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>"
}Read a bank statement
Reads a statement file without saving it: Norma 43 (Cuaderno 43), CSV, XLSX or PDF, up to 5 MB and 5,000 movements of one account.
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/bank-statements/read \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form bank_account_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'account_name=<string>' \
--form opening_balance=121.00 \
--form closing_balance=121.00import requests
url = "https://api.melso.ai/v1/companies/{company_id}/bank-statements/read"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_name": "<string>",
"opening_balance": "121.00",
"closing_balance": "121.00"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('bank_account_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('account_name', '<string>');
form.append('opening_balance', '121.00');
form.append('closing_balance', '121.00');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.melso.ai/v1/companies/{company_id}/bank-statements/read', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"format": "norma43",
"iban": "<string>",
"currency": "<string>",
"period_start": "2023-12-25",
"period_end": "2023-12-25",
"opening_balance": "<string>",
"closing_balance": "<string>",
"movement_total": "121.00",
"difference": "<string>",
"bank_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"currency": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"iban": "<string>",
"external_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"movements": [
{
"line_number": 123,
"booked_on": "2023-12-25",
"value_on": "2023-12-25",
"amount": "121.00",
"balance_after": "<string>",
"concept": "<string>",
"counterparty_name": "<string>",
"reference": "<string>",
"duplicate": true
}
],
"new_movements": 123,
"duplicates": 123,
"questions": [
"account"
],
"can_save": true
}{
"error": "lines[0].vat_rate must be 21, 10, 4 or 0",
"code": "invalid_invoice",
"request_id": "req_01JAB3K9X2"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax service is not active for this company",
"code": "tax_service_required",
"request_id": "req_01JAB3K9X2"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>"
}Authorizations
Your partner secret key, mk_live_… for real companies or mk_test_…
for test companies. Keep it on your servers. See
Authentication.
Path Parameters
The company's ID. Every company-scoped call works in exactly this company.
Body
Norma 43, CSV, XLSX or PDF, up to 5 MB. CSV and XLSX need a header row naming a date and an amount, or a debit and a credit column.
The account. Without it, Melso uses the saved account with the file's IBAN, or creates one.
120An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
Response
What the file holds.
norma43, csv, xlsx, pdf An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
How far the balances are from the movements.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
What a person must answer before saving.
account, balances