I'm using the Xero API php wrapper to post timesheets and there's no detail coming back except for "An error occurred" and Status 500.
I'm authenticating ok, it's included in the scopes and as far as I can tell it's valid json in the format requested...
[{"EmployeeID":"a valid employee id","StartDate":"2020-08-03","EndDate":"2020-08-09","Status":"Draft","TimesheetLines":{"TimesheetLine":[{"EarningsRateID":"a valid pay item id","NumberOfUnits":{"NumberOfUnit":["0.00","0.00","8","0.00","0.00","0.00","0.00"]}},{"EarningsRateID":"a valid pay item id","NumberOfUnits":{"NumberOfUnit":["0.00","0.00","0.00","8.5","0.00","0.00","0.00"]}},{"EarningsRateID":"a valid pay item id","NumberOfUnits":{"NumberOfUnit":["0.00","0.00","0.00","0.00","8","0.00","0.00"]}},{"EarningsRateID":"a valid pay item id","NumberOfUnits":{"NumberOfUnit":["0.00","0.00","0.00","0.00","0.00","8","0.00"]}},{"EarningsRateID":"a valid pay item id","NumberOfUnits":{"NumberOfUnit":["0.00","0.00","0.00","0.00","0.00","0.00","8.5"]}}]}}]
That's getting sent via...
try {
$result = $payrollAuApi->createTimesheet($xeroTenantId, $timesheet);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PayrollAuApi->createTimesheet: ', $e->getMessage(), PHP_EOL;
}
And the tenantID is ok.
I'm grateful for any guidance on where I'm going wrong.