Create a payment for a payslip
Scope: accounting:payrolls.write https://api.alladdin.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
payslipId string required
Payslip ID (24-character hexadecimal ObjectId)
Request body
object amount string | null
Payment amount. Defaults to the payslip pending balance.
date string<date> | null
Payment date in ISO 8601 format. Defaults to the payslip's own payment date.
bank_account_id string | null
Identifier of the treasury account the payment is tied to.
Request
import requests
url = "https://api.alladdin.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
201 Payment registered application/json object payment_status string | null
Null when the payslip could not be re-read after the payment was registered — the write itself still succeeded.
Enum: PENDING PAID PARTIALLY_PAID `` payment_pending string | 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
400 The payslip id, amount, date or bank_account_id is not valid application/json 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 application/json 409 The accounting period of the payment date is closed, or another payment is being registered for this payslip application/json object type string title string status integer detail string 422 The payment could not be registered, or bank_account_id does not belong to this account application/json 429 Rate limit exceeded application/json
