Update Staff Salary Component
Changes one existing incentive, or one pending reimbursement, of a staff member in payroll. It changes what payroll uses for that staff member 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/salary-components(query:salarybox_id,component_type,start_date,end_date) and send its current values (salarybox_id,component_type,date,amount, andincentive_typefor an incentive) exactly as listed, plusnew_fields for what changes. Anything left out stays as it is. - At least one
new_field is required; otherwise400undernon_field_errors: “Send at least one new_ field to change.” - No entry matches:
404“Entry not found.” with the error underamount. - More than one entry matches:
400underamount: “More than one entry matches. Edit it in the SalaryBox app.” - Only a pending reimbursement can be edited: otherwise
400underamount: “Only a pending reimbursement can be edited.” component_typeisincentiveorreimbursement.salarybox_idis an active staff member of the company.dateis the entry’s current date,YYYY-MM-DD.new_dateis optional,YYYY-MM-DDand not in the future (400on it: “Date cannot be in the future.”).amountis the entry’s current amount, a JSON number, 0 or more with up to 6 decimals; send it as the list returned it.new_amountis optional, a JSON number from 0.01 to 10000000 with up to 2 decimals.incentive_typeis optional and only withcomponent_typeincentive: the entry’s current type name, which narrows the match.new_incentive_typeis optional, only withincentive: the exact name fromGET /payroll/config/incentive-types; an unknown name gives400on it.incentive_typeornew_incentive_typewithreimbursementgives400on that field: “Only used with component_type ‘incentive’.”new_notesis optional, at max 500 characters, trimmed. Notes can be changed but not cleared.- Both the entry’s current month and the month
new_datemoves it to must be open: a finalised payroll month gives400with the app’s message. - A reimbursement amount that crosses the approval flow’s threshold, or a changed amount once an approval level has acted, gives
400with the app’s message. - No notification is sent to the staff member.
- Changing
new_amountor any value used to find the entry means a repeat of the same request finds nothing and gets404, 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_id
SalaryBox ID of an active staff member.
component_type
Allowed values:
date
The entry’s current date, YYYY-MM-DD.
amount
The entry's current amount, up to 6 decimals. Must be a JSON number.
incentive_type
The entry’s current type name, narrows the match. Only with component_type incentive.
new_date
YYYY-MM-DD, not in the future.
new_amount
Up to 2 decimals. Must be a JSON number.
new_notes
Notes can be changed but not cleared.
new_incentive_type
Exact name from GET /payroll/config/incentive-types. Only with component_type incentive.
Response
The entry was updated. data holds the new values.
message
status
data
Errors
400
Bad Request Error
403
Forbidden Error
404
Not Found Error
