I'm using the Payroll - NZ Xero API. I'm wondering if there is a way to post multiple timesheet lines at once.
My application sends large batches of timesheets in one hit. Going by the docs, I should send each timesheet line individually. This works fine, but it's very feasible to hit the rate limit of 60 requests per minute. It's not exactly efficient to send hundreds of timesheet lines in seperate requests.
I have attempted to send an array to the /timesheets/{TimesheetID}/lines
, but I the following error...
{
"status": 400,
"detail": "BadRequest",
"invalidFields": [
{ "name": "Date", "reason": "Date is required" },
{ "name": "EarningsRateID", "reason": "The earnings rate is required" },
{ "name": "Time", "reason": "Time must be greater than zero" }
]
}
...which implies to me an array is not being handled. I've also tried posting a timesheet (/timesheets
) with an included TimesheetLines
array, but the lines are discarded.
Am I missing something, or is this a feature that the Payroll API doesn't currently offer?