Create a payment for a payslip
accounting:payrolls.writehttps://api.holded.com/api/v2/payslips/{payslipId}/paymentsRecords a payment against a payslip that already exists, deducting the amount from its pending balance. Partial payments are allowed (an `amount` below the outstanding total). All three body fields are optional: an omitted `amount` defaults to the full pending balance, and an omitted `date` defaults to the payslip's own payment date (the start of the month after the liquidation period ends, or the contract end date when it falls inside that period). `bank_account_id` ties the movement to a treasury account, and must belong to this account. 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. 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 body
Payment amount. Defaults to the payslip pending balance.
Payment date in ISO 8601 format. Defaults to the payslip's own payment date.
Identifier of the treasury account the payment is tied to.
Request
import requests
url = "https://api.holded.com/api/v2/payslips/507f1f77bcf86cd799439011/payments"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
payload = {
"amount": "1450.00",
"date": "2024-01-15",
"bank_account_id": "string"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())Responses
Response
{
"payment_status": "PAID",
"payment_pending": "0.00"
}Success responses
201Payment registeredapplication/jsonNull when the payslip could not be re-read after the payment was registered — the write itself still succeeded.
PENDINGPAIDPARTIALLY_PAIDRemaining pending balance after this payment. Null when the payslip could not be re-read after the payment was registered — the write itself still succeeded.
Error responses
400The payslip id, amount, date or bank_account_id is not validapplication/json401Invalid or missing API keyapplication/json402The Human Resources gem is not active for this accountapplication/json403Insufficient permissionsapplication/json404Payslip not foundapplication/json409The accounting period of the payment date is closed, or another payment is being registered for this payslipapplication/json422The payment could not be registered, or bank_account_id does not belong to this accountapplication/json429Rate limit exceededapplication/json