Approve a payslip
accounting:payrolls.writehttps://api.holded.com/api/v2/payslips/{payslipId}/approveApproves a draft payslip: it stops being a draft and is posted to the ledger. Payroll is what the Human Resources gem sells, so this endpoint requires it to be active on the account and answers 402 when it is not. The operation is not idempotent: approving a payslip that is already approved answers 409 rather than reporting a success that did not happen. It also answers 409 when the accounting period of the payslip date is closed, or when the payslip is a bonus regularisation whose accumulated contribution bases have changed since it was calculated — that one has to be regenerated before it can be approved. A payslip is not a salary record: asking this endpoint for a salary-record id answers 404 naming the resource that serves it.
Parameters
Path parameters
stringrequiredPayslip ID (24-character hexadecimal ObjectId)
Request
import requests
url = "https://api.holded.com/api/v2/payslips/507f1f77bcf86cd799439011/approve"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.post(url, headers=headers)
print(response.json())Responses
Response
{
"status": "approved"
}Success responses
200Payslip approvedapplication/jsonapprovedError responses
400The payslip id is not a valid identifierapplication/json401Invalid or missing API keyapplication/json402The Human Resources gem is not active for this accountapplication/json403Insufficient permissionsapplication/json404Payslip not foundapplication/json409The payslip cannot be approved in its current stateapplication/json422Validation errorapplication/json429Rate limit exceededapplication/json