Skip to navigation

Update Staff Work Basis Payment

Changes one existing work basis payment entry 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/work-basis-payment and send its current values (salarybox_id, date and work_name, rate_per_unit, quantity) 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 work_name.
  • More than one entry matches (identical entries on one day): 400 under work_name: “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.
  • The entry is found by work_name (exact, 1-200 characters), rate_per_unit and quantity (JSON numbers, 0 or more with up to 6 decimals; send them as the list returned them). category_name is not used to find it.
  • new_work_name and new_category_name are optional, 1-200 characters, trimmed. new_rate_per_unit is optional, a JSON number from 0.01 to 10000000 with up to 2 decimals. new_quantity is optional, a JSON number from 0.001 to 1000000 with up to 3 decimals. The resulting rate_per_unit x quantity cannot exceed 10000000: 400 on new_quantity.
  • The response amount is rate_per_unit x quantity.
  • new_notes is optional, at max 500 characters, trimmed. Notes can be changed but not cleared.
  • Both the entry’s current month and the month new_date moves it to must be open: a finalised payroll month gives 400.
  • The staff member gets the usual in-app notification, as when an admin edits it in the app.
  • 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.

work_namestringRequired1-200 characters
The entry's current work name, exact match.
rate_per_unitdoubleRequired>=0
The entry's current rate, up to 6 decimals. Must be a JSON number.
quantitydoubleRequired>=0
The entry's current quantity, up to 6 decimals. Must be a JSON number.
new_work_namestringOptional1-200 characters
new_category_namestringOptional1-200 characters
new_rate_per_unitdoubleOptional0.01-10000000
Up to 2 decimals. Must be a JSON number.
new_quantitydoubleOptional0.001-1000000

Up to 3 decimals. Must be a JSON number. The resulting rate_per_unit x quantity cannot exceed 10000000.

new_datedateOptional

YYYY-MM-DD. Not in the future. The month it moves to must not be finalised.

new_notesstringOptional1-500 characters
Notes can be changed but not cleared.

Response

The work basis payment was updated. data holds the new values.

messagestringOptional
statusbooleanOptional
dataobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error