Save a bank statement
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/bank-statements \
--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"
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', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"bank_statement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"format": "norma43",
"period_start": "2023-12-25",
"period_end": "2023-12-25",
"opening_balance": "121.00",
"closing_balance": "121.00",
"movements": 123,
"created_at": "2023-11-07T05:31:56Z"
},
"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"
},
"saved": 123,
"duplicates": 123
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>"
}Banking
Save a bank statement
Saves a statement file’s new movements, skipping those already saved.
POST
/
companies
/
{company_id}
/
bank-statements
Save a bank statement
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/bank-statements \
--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"
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', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"bank_statement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"format": "norma43",
"period_start": "2023-12-25",
"period_end": "2023-12-25",
"opening_balance": "121.00",
"closing_balance": "121.00",
"movements": 123,
"created_at": "2023-11-07T05:31:56Z"
},
"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"
},
"saved": 123,
"duplicates": 123
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>"
}Live capability. Melso runs this in production today. Partner keys reach it once your partner account is enabled. See Availability.
A person decides. The company’s owner makes this call, signed in to Melso. Partner keys cannot make it: send the person the approval link instead. See Approvals and filing.
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
multipart/form-data
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.
Maximum string length:
120An amount in euros as a decimal string with two decimals, such as "121.00".
Pattern:
^-?[0-9]+\.[0-9]{2}$Example:
"121.00"
An amount in euros as a decimal string with two decimals, such as "121.00".
Pattern:
^-?[0-9]+\.[0-9]{2}$Example:
"121.00"