Import a VAT book
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/vat-book-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.melso.ai/v1/companies/{company_id}/vat-book-imports"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.melso.ai/v1/companies/{company_id}/vat-book-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"vat_book_import": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"direction": "issued",
"filename": "<string>",
"format": "<string>",
"first_date": "2023-12-25",
"last_date": "2023-12-25",
"invoices": 123,
"duplicates": 123,
"base_total": "121.00",
"vat_total": "121.00",
"created_at": "2023-11-07T05:31:56Z"
},
"invoices": 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"
}Accounting
Import a VAT book
Imports an issued or received VAT book (CSV with headers, ContaPlus CSV or XLSX, up to 10 MB and 50,000 rows) as the company’s income or expenses, skipping invoices already recorded.
POST
/
companies
/
{company_id}
/
vat-book-imports
Import a VAT book
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/vat-book-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.melso.ai/v1/companies/{company_id}/vat-book-imports"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.melso.ai/v1/companies/{company_id}/vat-book-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"vat_book_import": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"direction": "issued",
"filename": "<string>",
"format": "<string>",
"first_date": "2023-12-25",
"last_date": "2023-12-25",
"invoices": 123,
"duplicates": 123,
"base_total": "121.00",
"vat_total": "121.00",
"created_at": "2023-11-07T05:31:56Z"
},
"invoices": 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"
}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