Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Wrapper libraries >

Timesheet error - BadRequest

Started by Adam Blake -   in Wrapper libraries

I am using the calcinai/xero-php wrapper

I can successfully add a blank timesheet for an employee, however when I try to add a timesheet line I am getting a Bad Request response.

Can someone please point me in the right direction???

My PHP code is:

$numberOfUnits = array ("1", "2", "3", "4", "5", "6", "7");

$timesheetLines = new \XeroPHP\Models\PayrollAU\Timesheet\TimesheetLine($xero);

$timesheetLines ->setEarningsRateID ($earningsRateID)
->setTrackingItemID (NULL)
->addNumberOfUnit ($numberOfUnits);

$timesheet = new \XeroPHP\Models\PayrollAU\Timesheet($xero);

$timesheet ->setTimesheetID($timesheetID)
->setEmployeeID ($employeeID)
->setStartDate(new DateTime('2018-10-01'))
->setEndDate(new DateTime('2018-10-14'))