Skip to main content
POST

Approve a payslip

Scope:accounting:payrolls.write
https://api.holded.com/api/v2/payslips/{payslipId}/approve

Approves 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

payslipIdstringrequired

Payslip ID (24-character hexadecimal ObjectId)

Request

python
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

json
{
  "status": "approved"
}

Success responses

200Payslip approvedapplication/json
object
statusstring
Enum:approved

Error responses

400The payslip id is not a valid identifierapplication/json
401Invalid or missing API keyapplication/json
402The Human Resources gem is not active for this accountapplication/json
object
typestring
titlestring
statusinteger
detailstring
403Insufficient permissionsapplication/json
404Payslip not foundapplication/json
409The payslip cannot be approved in its current stateapplication/json
object
typestring
titlestring
statusinteger
detailstring
422Validation errorapplication/json
429Rate limit exceededapplication/json