Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Validation error when creating UK payroll timesheets

Started by Dexter Marks-Barber -   in API Endpoints


I'm working on a project where I need to generate timesheets for employees using the UK payroll endpoints.

I'm getting the following validation error when creating a timesheet:
"Validation error occured. (PayPeriods)"

I believe this to be down to the StartDate and EndDate on a timesheet being outside of the pay run calendar's PeriodStartDate and PeriodEndDate. But this is not the case for me.

Here's a snippet of my code:

I get the last pay roll calendar and pipe in the details directly into the timesheet and attempt to save. This is using the XeroPHP library fork with some UK payroll implementation.

Any ideas on how to resolve this issue?
Hi Dexter,

I thought this might have been the actual pay period format but looks like the way you've formatted the date/time string is correct albeit i'm not a PHP expert.

Can you please email us at api@xero.com with your app name and we can check the logs to see what the problem might be?


Dan Young (Xero Staff)  

Hi, I've responded via email.

Dexter Marks-Barber