You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add employee details through an API and allocate timesheets for employees using UK payroll. However, I encountered a couple of issues that I need assistance with.
Case 1: Issue with Payroll Calendar ID
While creating an employee, I set the payrollCalendarID, but it seems that the employee is being created with a null value for the payrollCalendarID. I'm not sure why this is happening and would appreciate any guidance on how to resolve it.
Case 2: Error when Adding Salary and Wage
I attempted to add salary and wage details for an employee using the following code snippet:
constresponse=awaitxero.payrollUKApi.createEmployeeSalaryAndWage(xeroTenantId,employeeId,{earningsRateID: earningsRateID,// I obtained the earnings Rate ID from the servernumberOfUnitsPerWeek: 0,ratePerUnit: 14,numberOfUnitsPerDay: 12,effectiveFrom: "2023-01-01",annualSalary: 10000,status: "Active",paymentType: "Hourly",});
However, I received the following error:
"invalidFields":[{"name":"_default","reason":"Please add a salary & wage."}]}, "salaryAndWages":null
I'm using version 4.33.0 of the Xero API.
I would greatly appreciate any help or insights on how to resolve these issues. Thank you in advance!
The text was updated successfully, but these errors were encountered:
Creating a employee fills the personal details section of the employee record. To add details of the payroll calendar, start date etc you need to make a separate call to add an employment record.
The salary and wage call is failing because it is mixing hourly pay and a salary. If you are adding the payment type as hourly, you need to send the annualsalary value as null or 0.00.
I'm trying to add employee details through an API and allocate timesheets for employees using UK payroll. However, I encountered a couple of issues that I need assistance with.
Case 1: Issue with Payroll Calendar ID
While creating an employee, I set the
payrollCalendarID
, but it seems that the employee is being created with anull
value for thepayrollCalendarID
. I'm not sure why this is happening and would appreciate any guidance on how to resolve it.Case 2: Error when Adding Salary and Wage
I attempted to add salary and wage details for an employee using the following code snippet:
However, I received the following error:
I'm using version 4.33.0 of the Xero API.
I would greatly appreciate any help or insights on how to resolve these issues. Thank you in advance!
The text was updated successfully, but these errors were encountered: