Skip to navigation

Update Staff Salary Payment

Changes one existing salary payment entry of a staff member in payroll. It corrects the saved record and moves no money. Shared rules: see Writing data. Needs Payroll on your plan.

  • There are no entry ids. Find the entry with GET /payroll/payment and send its current values (salarybox_id, date, amount, from_date and to_date) exactly as listed, plus new_ fields for what changes. Anything left out stays as it is.
  • At least one new_ field is required; otherwise 400 under non_field_errors: “Send at least one new_ field to change.”
  • No entry matches: 404 “Entry not found.” with the error under amount.
  • More than one entry matches (identical entries on one day): 400 under amount: “More than one entry matches. Edit it in the SalaryBox app.”
  • salarybox_id is an active staff member of the company.
  • date is the entry’s current date, YYYY-MM-DD. new_date is optional, YYYY-MM-DD and not in the future.
  • amount is the entry’s current amount, a JSON number, 0 or more with up to 6 decimals; send it as the list returned it. new_amount is optional, a JSON number from 0.01 to 10000000 with up to 2 decimals.
  • new_notes is optional, at max 500 characters, trimmed. Notes can be changed but not cleared.
  • from_date and to_date are also required to find the entry: the period it pays, YYYY-MM-DD, exactly as the list returns them. They can be part of a month for entries made in the app. date is the day it was paid.
  • new_month is optional, YYYY-MM: the salary month it pays. It sets from_date and to_date to that whole month. A future month gives 400 on it “Month cannot be in the future.” new_payment_mode is optional, with the same choices as payment_mode in Record Staff Salary Payment: CASH, CHEQUE, DEBIT_CARD, IMPS, NEFT, NET_BANKING, RTGS or UPI.
  • Salaries are usually paid after finalising, so the amount, payment mode, notes and paid date can still be changed in a finalised month. Moving the entry to a different month with new_month is refused if either month is finalised: 400 on from_date (current month) or new_month. Moving updates both months’ paid totals.
  • An online payout can’t be edited: 400 on amount “Cannot update online payments.” The list shows these as paid_online: true.
  • The staff member gets an in-app notification that it was updated, and no SMS.
  • Changing new_amount or any value used to find the entry means a repeat of the same request finds nothing and gets 404, so nothing changes twice. If only other fields changed, a repeat sets the same values.

Authentication

AuthorizationApi-Key

Format: “Api-Key {api-key}”

Request

This endpoint expects an object.
salarybox_idstringRequired1-50 characters
SalaryBox ID of an active staff member.
datedateRequired

The entry’s current date, YYYY-MM-DD.

from_datedateRequired

The entry’s current period start, YYYY-MM-DD, exactly as the list returns it.

to_datedateRequired

The entry’s current period end, YYYY-MM-DD, exactly as the list returns it.

amountdoubleRequired>=0
The entry's current amount, up to 6 decimals. Must be a JSON number.
new_amountdoubleOptional0.01-10000000
Up to 2 decimals. Must be a JSON number.
new_datedateOptional

YYYY-MM-DD. Not in the future. The day it was paid.

new_notesstringOptional1-500 characters
Notes can be changed but not cleared.
new_monthstringOptionalformat: "^\d{4}-(0[1-9]|1[0-2])$"

YYYY-MM. The salary month it pays; sets from_date and to_date to that whole month. Not a future month. Neither month involved may be finalised.

new_payment_modeenumOptional

Response

The salary payment was updated. data holds the new values.

messagestringOptional
statusbooleanOptional
dataobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error