Skip to main content

Locations

PUT Upsert Location /locations/upsert

Update an exisitng location if the id the provided exists already, otherwise creates a new location.

Response

NameValueDescriptionRequired
idstringUnique Idtrue
namestringLocation Nametrue
timezonestringTimezone (moment-timezones)false
minimumWagenumberMinimum wage in dollarsfalse
addressstringPhysical Address of the Locationfalse
locationEmailstringEmail Associated with Locationfalse

Authorization Bearer Token

Token                             API_Key

Headers

Content-Type                 application/json

Example

import axios from "axios"; 

const headers = {
"Authorization": `Bearer ${your_api_key}`,
"Content-Type": "application/json"
};

const newLocation = {
"id": "generated-id",
"name": "Fresno",
"timezone": "America/Los_Angeles",
"address": "123 West Ave, Fresno CA 93705, USA",
"minimumWage": 16,
"locationEmail": "fresno@test.com"
}

const rootUrl = "https://us-central1-checklist-admin-d0013.cloudfunctions.net/api/v1";

const request = axios(rootUrl+`/locations/upsert`, { headers, data: newLocation });

Body Response JSON

{
"id": "generated-id",
"timezone": "America/Los_Angeles",
"name": "San Francisco",
"minimumWage": 18,
"address": "123 Street Ave, San Francisco CA 12345, USA",
"locationEmail": "sf@example.com",
}