-1

Using Xero API for PHP, I am able to retrieve a list of employees by using the following:

$xero->load('PayrollAU\\Employee')->execute();

However, this does not return the employees address. Other information is returned (name, email, gender, etc) but not the address.

How do I retrieve the employee's address?

Saveen
  • 4,120
  • 14
  • 38
  • 41
Lawrence Cooke
  • 1,567
  • 3
  • 26
  • 52

1 Answers1

1

It turns out, Xero doesn't send all the information in that particular call

In order to get all the information you have to run two calls

the first:

$xero->load('PayrollAU\\Employee')->execute();

From the result set, fetch the EmployeeID

then run another call

$xero->loadByGUID('PayrollAU\\Employee',$employeeID);

The loadByGUID call will pull all the employee data to use.

Lawrence Cooke
  • 1,567
  • 3
  • 26
  • 52