Skip to main content
DELETE

Delete a payment from a payslip

Scope:accounting:payrolls.write
https://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

payslipIdstringrequired

Payslip ID (24-character hexadecimal ObjectId)

paymentIdstringrequired

Payment ID (24-character hexadecimal ObjectId), as returned in the `payments` array of GET /api/v2/payslips/{payslipId}

Request

python
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 deleted

Error responses

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 found, or the payslip carries no payment with this idapplication/json
409The accounting period of the payment or payslip date is closed, or another payment is being written for this payslipapplication/json
object
typestring
titlestring
statusinteger
detailstring
422The payment could not be removedapplication/json
429Rate limit exceededapplication/json