I'm not a developer and we are successfully using MS Power Automate to create payruns and timesheets in Xero for our employees on wages. We would like to progress to creating payruns for our salaried people as well but I have hit a snag. I don't know which API endpoint to start from. For wages employees we use the /timesheets endpoint. However, for salaried people we want to provide a total number of hours for the week, not hours for each day so it seems we can't use the /timesheets endpoint. I have tried that but I get the error
"ValidationErrors": [
{
"Message": "Incorrect number of timesheet entries supplied for the pay period."
}
]
Which makes sense because I'm trying to pass up just one value instead of an array of values. So, I think I need to be not using the /timesheets endpoint but which endpoint do I use? The body of my post is:
[
{
"EmployeeID": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
"StartDate": "/Date(1682208000000+0000)/",
"EndDate": "/Date(1682726400000+0000)/",
"Status": "APPROVED",
"TimesheetLines": [
{
"EarningsRateID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"NumberOfUnits": [
7.6
]
}
]
}
]
and the URI is https://api.xero.com/payroll.xro/1.0/Timesheets/