Update a salary record
accounting:payrolls.writehttps://api.holded.com/api/v2/salary-records/{salaryRecordId}Setting `is_draft` from `true` to `false` finalizes the draft and posts it to the ledger. Once posted, a record cannot be reverted to draft. Leave `is_draft` unset unless the user explicitly asks to finalize/post the record. This endpoint cannot move a record to a different employee, or change its accrual date — there is no field for either. If the user asks to reassign the employee or change the date, tell them a salary record can't do that; create a new record with the correct employee/date instead (and optionally delete the old one). When you do send `accounting_account_id` or `lines`, source them the same way as on creation: from the salary-record form data for that employee, or `payroll_accounts` when configured — never invent an accounting account id and never ask the user for one. Deduction lines (`tax`, `retention`) are negative amounts: when the user states one as a positive number, send it as negative. Ask the user for each amount you are changing; never send a placeholder.
Parameters
Path parameters
stringrequiredSalary record ID (24-character hexadecimal ObjectId)
Request body
Top-level accounting account where the net payable is posted (result/counterpart account, e.g. "465 Remuneraciones pendientes de pago").
When true (the default), the record is saved as a draft and is NOT posted to the ledger. When false, it is finalized immediately.
trueFree-text description stored on the record. Sending it REPLACES the current one; omitting it CLEARS it — there is no fallback to the record's existing value, so resend the current description if you want it to survive the update.
Tags attached to the record. Sending a list REPLACES the current one; omitting it CLEARS all tags — there is no fallback to the record's existing value, so resend the current tags if you want them to survive the update.
Payroll line breakdown: earning and deduction lines. A standard payroll includes all four line types — salary and companytax (positive), tax and retention (negative). Sending lines REPLACES the current breakdown; omitting `lines` CLEARS it — there is no fallback to the record's existing lines, so resend the current breakdown if you want it to survive the update.
Line type. A standard payroll uses salary, tax, companytax and retention; see the enum for all supported values.
salarytaxcompanytaxretentionextraresultadvancewage_garnishmentpago_delegado_itsalary_in_kindsalary_in_kind_retentionsalary_in_kind_incomeLine amount as a decimal string (use negative values for deductions, e.g. "-150.00"). Prefer the string form: it avoids floating-point precision loss. A plain JSON number is also accepted.
Accounting account for this line.
Optional tax key applied to this line.
Line description shown as the concept label.
Request
import requests
url = "https://api.holded.com/api/v2/salary-records/507f1f77bcf86cd799439011"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
payload = {
"accounting_account_id": "see the salary-record form data",
"is_draft": true,
"description": "March 2024 payroll",
"tags": [
"bonus",
"q1"
],
"lines": [
{
"type": "salary",
"amount": "1500.00",
"accounting_account_id": "see the salary-record form data",
"tax_key": "e_salario",
"description": "Salario"
}
]
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())Responses
Success responses
204Resource deletedError responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json404Salary record not foundapplication/json409Accounting period is lockedapplication/json429Rate limit exceededapplication/json