Preview a payslip
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/payroll/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"year": 2026,
"month": 12,
"start_date": "2026-12-01",
"profile": {
"group": 7,
"contract": "indefinido",
"weekly_hours": "40",
"full_time_hours": "40",
"annual_salary": "21000.00"
}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/payroll/preview"
payload = {
"year": 2026,
"month": 12,
"start_date": "2026-12-01",
"profile": {
"group": 7,
"contract": "indefinido",
"weekly_hours": "40",
"full_time_hours": "40",
"annual_salary": "21000.00"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
year: 2026,
month: 12,
start_date: '2026-12-01',
profile: {
group: 7,
contract: 'indefinido',
weekly_hours: '40',
full_time_hours: '40',
annual_salary: '21000.00'
}
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/payroll/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"employee_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"days": 123,
"earnings": [
{}
],
"deductions": [
{}
],
"social_security": {},
"irpf": {},
"totals": {},
"incidents": {
"overtime": "121.00",
"overtime_force_majeure": "121.00",
"bonus": "121.00",
"advance": "121.00",
"unpaid_days": 123,
"periodic_bonuses": [
{}
],
"per_diems": [
{}
],
"travel": {},
"termination": {}
},
"warnings": [
"<string>"
]
}
Payroll settings
Preview a payslip
Calculates one month’s payslip for a contract without saving anything.
POST
/
companies
/
{company_id}
/
payroll
/
preview
Preview a payslip
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/payroll/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"year": 2026,
"month": 12,
"start_date": "2026-12-01",
"profile": {
"group": 7,
"contract": "indefinido",
"weekly_hours": "40",
"full_time_hours": "40",
"annual_salary": "21000.00"
}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/payroll/preview"
payload = {
"year": 2026,
"month": 12,
"start_date": "2026-12-01",
"profile": {
"group": 7,
"contract": "indefinido",
"weekly_hours": "40",
"full_time_hours": "40",
"annual_salary": "21000.00"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
year: 2026,
month: 12,
start_date: '2026-12-01',
profile: {
group: 7,
contract: 'indefinido',
weekly_hours: '40',
full_time_hours: '40',
annual_salary: '21000.00'
}
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/payroll/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"employee_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"days": 123,
"earnings": [
{}
],
"deductions": [
{}
],
"social_security": {},
"irpf": {},
"totals": {},
"incidents": {
"overtime": "121.00",
"overtime_force_majeure": "121.00",
"bonus": "121.00",
"advance": "121.00",
"unpaid_days": 123,
"periodic_bonuses": [
{}
],
"per_diems": [
{}
],
"travel": {},
"termination": {}
},
"warnings": [
"<string>"
]
}
Beta. Melso does not serve this operation yet, and its fields can still change. See what is live.
Authorizations
companyApiKeypartnerApiKey
A company API key, mk_live_…, that the company's owner creates in the
Melso app under Settings, Connect your AI, API keys. It works in that
one company with the owner's authority. Test keys (mk_test_…) are not
issued. Keep the key on your servers. See
Authentication.
Path Parameters
Body
application/json
Response
The calculated payslip.