Work Locations


Overview

URL https://api.xero.com/payroll.xro/1.0/Worklocations
Methods Supported POST, GET
Description Allows you to retrieve, add and update a Work Location in a Xero US organisation

Elements for WorkLocations

The following are required to create a new work location
Street Address Street address of the work location (max length = 400)
City The city name of the address (max length = 50)
State The state name of the address
Latitude The latitude of the address
Longitude The longitude of the address
The following are optional when creating a work location
WorkLocationID Xero identifier for a work location
SuitOrAptOrUnit Suite or apartment or unit information (max length = 50)
IsPrimary Set to true to make this the primary work location

GET WorkLocations

Optional parameters for GET WorkLocations

Record filter You can specify an individual record by appending the value to the endpoint, i.e.
GET https://…/WorkLocations/{identifier}
WorkLocationID The Xero identifier for a work location
e.g. 297c2dc5-cc47-4afd-0000-74990b8761e9
You can get all work locations by just calling the endpoint.
GET https://…/worklocations
page By default the number of records returned per call is 100. You can add GET https://…/WorkLocations?page=2 to get the next set of records.
Where Filter by an any element (see Filters)
order Order by any element returned (see Order By)

Example response for GET WorkLocations/{identifier}

  <WorkLocations>
    <WorkLocation>
      <WorkLocationID>d9c8c45e-b153-42dc-a0d5-1cae48348d8a</WorkLocationID>
      <IsPrimary>false</IsPrimary>
      <StreetAddress>123 Main St</StreetAddress>
      <City>Houston</City>
      <State>TX</State>
      <Zip>77002</Zip>
      <Latitude>29.76352</Latitude>
      <Longitude>-95.35962</Longitude>
    </WorkLocation>
  </WorkLocations>

Example response for GET WorkLocations

  <WorkLocations>
    <WorkLocation>
      <WorkLocationID>d9c8c45e-b153-42dc-a0d5-1cae48348d8a</WorkLocationID>
      <IsPrimary>false</IsPrimary>
      <StreetAddress>123 Main St</StreetAddress>
      <City>Houston</City>
      <State>TX</State>
      <Zip>77002</Zip>
      <Latitude>29.76352</Latitude>
      <Longitude>-95.35962</Longitude>
    </WorkLocation>
    <WorkLocation>
      <WorkLocationID>aeeccb62-54ed-4c0e-9492-53c07898b3af</WorkLocationID>
      <IsPrimary>false</IsPrimary>
      <StreetAddress>244 Jackson St</StreetAddress>
      <City>San Francisco</City>
      <State>CA</State>
      <Zip>94111</Zip>
      <Latitude>37.79690</Latitude>
      <Longitude>-122.40033</Longitude>
    </WorkLocation>
    <WorkLocation>
      <WorkLocationID>114def3c-1c61-4fe5-9f45-5bd07011490f</WorkLocationID>
      <IsPrimary>false</IsPrimary>
      <StreetAddress>th</StreetAddress>
      <City>San Francisco</City>
      <State>CA</State>
      <Zip>94111</Zip>
      <Latitude>37.79690</Latitude>
      <Longitude>-122.40033</Longitude>
    </WorkLocation>
    <WorkLocation>
      <WorkLocationID>adc0dd19-1958-40f7-9cda-82ebf146bbd1</WorkLocationID>
      <IsPrimary>true</IsPrimary>
      <StreetAddress>101 Green St</StreetAddress>
      <City>San Francisco</City>
      <State>CA</State>
      <Zip>94109</Zip>
      <Latitude>37.80031</Latitude>
      <Longitude>-122.40197</Longitude>
    </WorkLocation>
  </WorkLocations>

POST WorkLocations

Use this method to add or update one or more work location in Payroll.

Example

<WorkLocations>
  <WorkLocation>
    <IsPrimary>true</IsPrimary>
    <StreetAddress>123 Main St</StreetAddress>
    <City>Houston</City>
    <State>TX</State>
    <Zip>77002</Zip>
    <Latitude>29.76352</Latitude>
    <Longitude>-95.35962</Longitude>
  </WorkLocation>
</WorkLocations>