Delete a payment from a payslip
Scope: accounting:payrolls.write https://api.alladdin.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
payslipId string required
Payslip ID (24-character hexadecimal ObjectId)
paymentId string required
Payment ID (24-character hexadecimal ObjectId), as returned in the payments array of GET /api/v2/payslips/{payslipId}
Request
import requests
url = "https://api.alladdin.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
204 Resource deleted
Error responses
401 Invalid or missing API key application/json 402 The Human Resources gem is not active for this account application/json object type string title string status integer detail string 403 Insufficient permissions application/json 404 Payslip not found, or the payslip carries no payment with this id application/json 409 The accounting period of the payment or payslip date is closed, or another payment is being written for this payslip application/json object type string title string status integer detail string 422 The payment could not be removed application/json 429 Rate limit exceeded application/json
