Update the labour settings
curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/payroll/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 2,
"settings": {
"cnae": "5610"
}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/payroll/settings"
payload = {
"expected_version": 2,
"settings": { "cnae": "5610" }
}
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: 2, settings: {cnae: '5610'}})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/payroll/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"version": 123,
"red_holder": "company",
"red_authorization": "<string>",
"cnae": "<string>",
"accounts": [
{
"id": "<string>",
"regime": "<string>",
"province": "<string>",
"number": "<string>",
"name": "<string>",
"address": "<string>",
"postal_code": "<string>",
"municipality": "<string>",
"agreement": "<string>",
"at_ep_insurer": "<string>",
"common_contingencies_insurer": "<string>"
}
],
"payer_iban": "<string>",
"payer_bic": "<string>",
"worker_representatives": true,
"representative": {
"nif": "<string>",
"given_name": "<string>",
"first_surname": "<string>",
"second_surname": "<string>",
"position": "<string>"
}
}Payroll settings
Update the labour settings
Changes the company’s labour data at the version you read.
PATCH
/
companies
/
{company_id}
/
payroll
/
settings
Update the labour settings
curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/payroll/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 2,
"settings": {
"cnae": "5610"
}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/payroll/settings"
payload = {
"expected_version": 2,
"settings": { "cnae": "5610" }
}
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: 2, settings: {cnae: '5610'}})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/payroll/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"version": 123,
"red_holder": "company",
"red_authorization": "<string>",
"cnae": "<string>",
"accounts": [
{
"id": "<string>",
"regime": "<string>",
"province": "<string>",
"number": "<string>",
"name": "<string>",
"address": "<string>",
"postal_code": "<string>",
"municipality": "<string>",
"agreement": "<string>",
"at_ep_insurer": "<string>",
"common_contingencies_insurer": "<string>"
}
],
"payer_iban": "<string>",
"payer_bic": "<string>",
"worker_representatives": true,
"representative": {
"nif": "<string>",
"given_name": "<string>",
"first_surname": "<string>",
"second_surname": "<string>",
"position": "<string>"
}
}Beta. Melso does not serve this operation yet, and its fields can still change. See what is live.
accounts replaces the whole list, so send every account.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 labour settings.