Update a payslip's incidents
curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/payslips/{payslip_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 4,
"incidents": {
"overtime": "120.00",
"unpaid_days": 1
}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/payslips/{payslip_id}"
payload = {
"expected_version": 4,
"incidents": {
"overtime": "120.00",
"unpaid_days": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_version: 4, incidents: {overtime: '120.00', unpaid_days: 1}})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/payslips/{payslip_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"period": "<string>",
"status": "draft",
"version": 123,
"pay_date": "2023-12-25",
"issues": [
{}
],
"totals": {
"employees": 123,
"gross": "121.00",
"net": "121.00",
"employee_contributions": "121.00",
"employer_contributions": "121.00",
"irpf": "121.00"
},
"payslips": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"employee_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"employee_name": "<string>",
"applied_rate": "<string>",
"gross": "121.00",
"net": "121.00",
"warnings": [
"<string>"
]
}
]
}
Payslips
Update a payslip's incidents
Records what changed in a draft month for one employee and calculates the month again.
PATCH
/
companies
/
{company_id}
/
payroll-runs
/
{run_id}
/
payslips
/
{payslip_id}
Update a payslip's incidents
curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/payslips/{payslip_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 4,
"incidents": {
"overtime": "120.00",
"unpaid_days": 1
}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/payslips/{payslip_id}"
payload = {
"expected_version": 4,
"incidents": {
"overtime": "120.00",
"unpaid_days": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_version: 4, incidents: {overtime: '120.00', unpaid_days: 1}})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/payslips/{payslip_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"period": "<string>",
"status": "draft",
"version": 123,
"pay_date": "2023-12-25",
"issues": [
{}
],
"totals": {
"employees": 123,
"gross": "121.00",
"net": "121.00",
"employee_contributions": "121.00",
"employer_contributions": "121.00",
"irpf": "121.00"
},
"payslips": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"employee_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"employee_name": "<string>",
"applied_rate": "<string>",
"gross": "121.00",
"net": "121.00",
"warnings": [
"<string>"
]
}
]
}
Beta. Melso does not serve this operation yet, and its fields can still change. See what is live.
incidents replaces the payslip’s incidents whole: read them first and send the full set, {} for none. A leaver’s termination goes here too.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 payroll run.