Work Locations

Creates a work location for a company — a physical location where employees can work. Work locations matter for payroll: creating one adds a corresponding entry to the company's tax setup for that location's state, and an employee's workLocationId (see Create an Employee) determines which work location's taxes apply to their pay.

Every company has one default work location, created automatically along with the company. Use this endpoint to add additional locations.

Endpoint

POST https://api.worklio.com/wep/companies/{CLIENT_ID}/worklocations

Requires a bearer access token (see How to Get API Access). CLIENT_ID is the company identifier returned as id when you create the company.

Required fields:

FieldTypeRequiredDescription
namestringYesDisplay name for the location. Max 100 characters.
codestringYesShort internal code identifying the location. Max 20 characters.
addressLine1stringYesStreet address line 1.
addressLine2stringNoStreet address line 2 (suite, unit, etc.). Defaults to an empty string if omitted.
addressCitystringYesCity.
addressStatestringYesTwo-letter state code.
addressZIPstringYesZIP code.
addressCountrystringNoDefaults to "US" if omitted.
🚧

Use a real, deliverable address. Worklio derives the location's tax jurisdiction — and its geoLatitude/geoLongitude — from this address, and adds a corresponding state entry to the company's tax setup once the location is created.

Example request

require("dotenv").config();

const TOKEN = process.env.API_KEY;
const CLIENT_ID = process.env.CLIENT_ID;
const url = `https://api.worklio.com/wep/companies/${CLIENT_ID}/worklocations`;

const payload = {
  addressLine1: "742 Evergreen Terrace",
  addressCity: "Columbus",
  addressState: "OH",
  addressZIP: "43214",
  code: "Ohiolocation",
  name: "Ohio location"
};

async function createWorkLocation() {
  const response = await fetch(url, {
    method: "POST",
    headers: {
      accept: "application/json",
      "api-version": "2.0",
      authorization: `Bearer ${TOKEN}`,
      "content-type": "application/json",
      "x-api-version": "2.0"
    },
    body: JSON.stringify(payload)
  });

  console.log(response.status);
  console.log(await response.text());
}

createWorkLocation();
curl -s -X POST "https://api.worklio.com/wep/companies/$CLIENT_ID/worklocations" \
  -H "accept: application/json" \
  -H "api-version: 2.0" \
  -H "authorization: Bearer $API_KEY" \
  -H "content-type: application/json" \
  -H "x-api-version: 2.0" \
  -d '{
    "addressLine1": "742 Evergreen Terrace",
    "addressCity": "Columbus",
    "addressState": "OH",
    "addressZIP": "43214",
    "code": "Ohiolocation",
    "name": "Ohio location"
  }' | jq .

Example response

{
  "id": 1265,
  "isDefault": false,
  "code": "Ohiolocation",
  "name": "Ohio location",
  "addressLine1": "742 Evergreen Terrace",
  "addressLine2": "",
  "addressCity": "Columbus",
  "addressState": "OH",
  "addressZIP": "43214",
  "addressCountry": "US",
  "geoLatitude": 40.0532,
  "geoLongitude": -83.021
}

id is the location's unique identifier. Save it — you'll need it as workLocationId when creating an employee who works on-site at this location.

isDefault is false for every location created through this endpoint. A company's one default location is created automatically along with the company, not through this call.

Next step: set up taxes for the location

Creating a work location adds a new entry for that location's state to the company's tax setup — the same state and suta entries returned by Get Company Tax Setup. Once the location is created, continue by reading the company's tax setup and filling in the new state's parameters with Update Company Tax Setup.


Did this page help you?