Skip to main content
PUT

Update a salary record

Scope:accounting:payrolls.write
https://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

salaryRecordIdstringrequired

Salary record ID (24-character hexadecimal ObjectId)

Request body

object
accounting_account_idstringrequired

Top-level accounting account where the net payable is posted (result/counterpart account, e.g. "465 Remuneraciones pendientes de pago").

is_draftbooleanrequired

When true (the default), the record is saved as a draft and is NOT posted to the ledger. When false, it is finalized immediately.

default: true
descriptionstring | nulloptional

Free-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[]string[] | nulloptional

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.

lines[]object[] | nulloptional

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.

typestringrequired

Line type. A standard payroll uses salary, tax, companytax and retention; see the enum for all supported values.

Enum:salarytaxcompanytaxretentionextraresultadvancewage_garnishmentpago_delegado_itsalary_in_kindsalary_in_kind_retentionsalary_in_kind_income
amountobjectrequired

Line 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_idstringrequired

Accounting account for this line.

tax_keystring | nulloptional

Optional tax key applied to this line.

descriptionstring | nulloptional

Line description shown as the concept label.

Request

python
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 deleted

Error responses

400Bad requestapplication/json
401Invalid or missing API keyapplication/json
403Insufficient permissionsapplication/json
404Salary record not foundapplication/json
409Accounting period is lockedapplication/json
object
typestring
titlestring
statusinteger
detailstring
429Rate limit exceededapplication/json