Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Employee Details and Allocating Timesheets with UK Payroll API #640

Open
ibmmt opened this issue May 31, 2023 · 3 comments
Open

Adding Employee Details and Allocating Timesheets with UK Payroll API #640

ibmmt opened this issue May 31, 2023 · 3 comments

Comments

@ibmmt
Copy link

ibmmt commented May 31, 2023

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:

const response = await xero.payrollUKApi.createEmployeeSalaryAndWage(
  xeroTenantId,
  employeeId,
  {
    earningsRateID: earningsRateID, // I obtained the earnings Rate ID from the server
    numberOfUnitsPerWeek: 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!


@github-actions
Copy link

PETOSS-298

@github-actions
Copy link

Thanks for raising an issue, a ticket has been created to track your request

@Sallyhornet
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants