curl --request PUT \
--url https://api.melso.ai/v1/companies/{company_id}/corporate-tax/{year} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 2,
"adjustments": [
{
"concept": "Multa de tráfico (art. 15.c LIS)",
"amount": "300.00",
"temporary": false
}
],
"capitalization_reserve": true,
"losses_offset": "4500.00"
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/corporate-tax/{year}"
payload = {
"expected_version": 2,
"adjustments": [
{
"concept": "Multa de tráfico (art. 15.c LIS)",
"amount": "300.00",
"temporary": False
}
],
"capitalization_reserve": True,
"losses_offset": "4500.00"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 2,
adjustments: [
{
concept: 'Multa de tráfico (art. 15.c LIS)',
amount: '300.00',
temporary: false
}
],
capitalization_reserve: true,
losses_offset: '4500.00'
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/corporate-tax/{year}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"year": 123,
"version": 123,
"result_before_tax": "121.00",
"adjustments_total": "121.00",
"capitalization_reserve": "121.00",
"losses_offset": "121.00",
"taxable_base": "121.00",
"rate": "<string>",
"gross_tax": "121.00",
"net_tax": "121.00",
"withholdings": "121.00",
"instalments_paid": "121.00",
"to_pay": "121.00",
"instalments": [
{
"period": "2026-Q3",
"amount": "121.00",
"deadline": "2023-12-25"
}
],
"review": [
"<string>"
]
}{
"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 return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}Save the corporate tax inputs
Saves what the year’s corporate tax needs beyond the books, at exactly expected_version, and returns the recalculated tax.
curl --request PUT \
--url https://api.melso.ai/v1/companies/{company_id}/corporate-tax/{year} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 2,
"adjustments": [
{
"concept": "Multa de tráfico (art. 15.c LIS)",
"amount": "300.00",
"temporary": false
}
],
"capitalization_reserve": true,
"losses_offset": "4500.00"
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/corporate-tax/{year}"
payload = {
"expected_version": 2,
"adjustments": [
{
"concept": "Multa de tráfico (art. 15.c LIS)",
"amount": "300.00",
"temporary": False
}
],
"capitalization_reserve": True,
"losses_offset": "4500.00"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 2,
adjustments: [
{
concept: 'Multa de tráfico (art. 15.c LIS)',
amount: '300.00',
temporary: false
}
],
capitalization_reserve: true,
losses_offset: '4500.00'
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/corporate-tax/{year}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"year": 123,
"version": 123,
"result_before_tax": "121.00",
"adjustments_total": "121.00",
"capitalization_reserve": "121.00",
"losses_offset": "121.00",
"taxable_base": "121.00",
"rate": "<string>",
"gross_tax": "121.00",
"net_tax": "121.00",
"withholdings": "121.00",
"instalments_paid": "121.00",
"to_pay": "121.00",
"instalments": [
{
"period": "2026-Q3",
"amount": "121.00",
"deadline": "2023-12-25"
}
],
"review": [
"<string>"
]
}{
"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 return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}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.
The fiscal year, such as 2025.
2000 <= x <= 2100Body
The version you read; 0 when nothing was saved yet.
x >= 0Every adjustment to the accounting result (ajustes extracontables). Replaces the saved list.
50Show child attributes
Show child attributes
Apply the capitalization reserve (art. 25 LIS).
An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
The year's 202 instalments paid. Empty to take them from the books.
Negative bases of earlier years offset.
A company in its first or second year with a positive base
The company opted for the 202 on the year's result so far (art. 40.3 LIS).
The year before's turnover, which sets the rate. Empty to take it from the books.
Withholdings suffered. Empty to take them from the books.
Growth of the average workforce over the year before
Response
The recalculated tax.
An 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"
An 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"
An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
A decimal number as a string, such as "21" or "0.5".
^-?[0-9]{1,10}(\.[0-9]{1,6})?$An 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"
An 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"
An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
The modelo 202 instalments of the next year that build on this result.
Show child attributes
Show child attributes