Skip to main content
POST

Create a payment for a payslip

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

Records 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

payslipIdstringrequired

Payslip ID (24-character hexadecimal ObjectId)

Request body

object
amountstring | null

Payment amount. Defaults to the payslip pending balance.

datestring<date> | null

Payment date in ISO 8601 format. Defaults to the payslip's own payment date.

bank_account_idstring | null

Identifier of the treasury account the payment is tied to.

Request

python
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

json
{
  "payment_status": "PAID",
  "payment_pending": "0.00"
}

Success responses

201Payment registeredapplication/json
object
payment_statusstring | null

Null when the payslip could not be re-read after the payment was registered — the write itself still succeeded.

Enum:PENDINGPAIDPARTIALLY_PAID
payment_pendingstring | null

Remaining 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/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 accounting period of the payment date is closed, or another payment is being registered for this payslipapplication/json
object
typestring
titlestring
statusinteger
detailstring
422The payment could not be registered, or bank_account_id does not belong to this accountapplication/json
429Rate limit exceededapplication/json