Delete a payment from a payslip
accounting:payrolls.writehttps://api.holded.com/api/v2/payslips/{payslipId}/payments/{paymentId}Removes a payment already registered against a payslip, returning its amount to the payslip's pending balance and moving `payment_status` back accordingly. `paymentId` comes from the `payments` array of `GET /api/v2/payslips/{payslipId}`; nothing else exposes it. When a payslip carries several payments, read that array and confirm which one to remove before calling this endpoint — the amounts and dates are what tell them apart. 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)
stringrequiredPayment ID (24-character hexadecimal ObjectId), as returned in the `payments` array of GET /api/v2/payslips/{payslipId}
Request
import requests
url = "https://api.holded.com/api/v2/payslips/507f1f77bcf86cd799439011/payments/507f1f77bcf86cd799439011"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.delete(url, headers=headers)
print(response.json())Responses
Success responses
204Resource deletedError responses
401Invalid or missing API keyapplication/json402The Human Resources gem is not active for this accountapplication/json403Insufficient permissionsapplication/json404Payslip not found, or the payslip carries no payment with this idapplication/json409The accounting period of the payment or payslip date is closed, or another payment is being written for this payslipapplication/json422The payment could not be removedapplication/json429Rate limit exceededapplication/json