Skip to main content

Locations

Schema​

Location​

NameTypeDescriptionExample
addressLine1string?The first line of the location's address"123 Kojo Avenue"
addressLine2string?The second line of the location's address"Office 18F"
citystring?The city the location is located in"San Francisco"
createdAtDateTimeWhen this location was created"2021-03-24 17:26:46.983Z"
defaultTaxCodeIdID?The default tax code to apply when this location is set as the DeliveryLocation on an OrderSee TaxCode docs
directionsstring?Specific directions regarding the location"Use the entrance on 1st St."
idIDThe unique location ID"ckmnpybisiy5x08abky4g2d1f"
jobsJob[]The list of Jobs the location is attached toSee the Job docs
namestringThe name of the location"Kojo Systems Mars HQ"
phonestring?The phone number for the location"513-123-4567"
statestring?The state the location is located in"CA"
typeLocationTypeThe location typeBilling
vendorsVendor[]The list of Vendors the location is attached toSee the Vendor docs
updatedAtDateTimeWhen this location was last updated"2021-03-24 17:26:46.983Z"
zipcodestring?The zipcode the location is located in"94107"

LocationType​

Allowed values: Billing, Jobsite, Office, Other, Warehouse, Will_Call

REST Endpoints​

GET /locations​

Read all locations, with pagination.

Parameters​

Accepts all standard pagination parameters.

Allowed orderBy fields: createdAt, displayName, id, updatedAt.

Allowed filter fields: addressLine1, addressLine2, city, state, zipcode, createdAt, id, name, type, updatedAt.

Response​

A list of Location objects.

Example Request​

GET https://api.kojo.tech/locations?limit=10&offset=20

Example Response​

[
{
"id": "cklbccas20jj3080855g801b2",
"addressLine1": "1720 Slough Avenue",
"addressLine2": null,
"city": "Scranton",
"defaultTaxCodeId": "clplqndk7000u4xw54wbjagao",
"state": "PA",
"zipcode": "18501",
"directions": null,
"name": "Dunder Mifflin Warehouse",
"phone": "570-343-1112",
"type": "Warehouse",
"createdAt": "2021-02-18T20:52:48.146Z",
"updatedAt": "2021-02-18T20:52:48.146Z"
},
{
"id": "cklbccgdg0law08080e6s0nf6",
"addressLine1": "637 Natoma St.",
"addressLine2": "#7",
"city": "San Francisco",
"defaultTaxCodeId": null,
"state": "CA",
"zipcode": "94103",
"directions": null,
"name": "Kojo HQ - Receiving",
"phone": "415-623-7898",
"type": "Other",
"createdAt": "2021-02-18T20:52:55.395Z",
"updatedAt": "2021-02-18T20:52:55.395Z"
}
]

GET /locations/:id​

Read a single location by ID.

Parameters​

NameDescriptionExample
idThe ID of the location to fetch"cklbccanw0jgg0808mtwgry8w"

Response​

A single Location object.

Example Request​

GET https://api.kojo.tech/locations/

Example Response​

{
"id": "cklbccgdg0law08080e6s0nf6",
"addressLine1": "637 Natoma St.",
"addressLine2": "#7",
"city": "San Francisco",
"defaultTaxCodeId": "clplqndk7000u4xw54wbjagao",
"state": "CA",
"zipcode": "94103",
"directions": null,
"name": "Kojo HQ - Receiving",
"phone": "415-623-7898",
"type": "Other",
"createdAt": "2021-02-18T20:52:55.395Z",
"updatedAt": "2021-02-18T20:52:55.395Z"
}

POST /locations​

Creates a new location and sends them a registration email.

Parameters​

NameTypeDefaultDescriptionExample
addressLine1string?nullThe first line of the location's address"123 Kojo Avenue"
addressLine2string?nullThe second line of the location's address"Office 18F"
citystring?nullThe city the location is located in"San Francisco"
defaultTaxCodeIdID?The id of the default tax code to apply when this location is set as the DeliveryLocation on an Order"ckmnpybisiy5x08abky4g2d1f"
directionsstring?nullSpecific directions regarding the location"Use the entrance on 1st St."
namestringThe name of the location"Kojo Systems Mars HQ"
phonestring?nullThe phone number for the location"513-123-4567"
statestring?nullThe state the location is located in"CA"
typeLocationTypeThe location typeBilling
zipcodestring?nullThe zipcode the location is located in"94107"

Response​

The created Location.

Example Mutation​

POST https://api.kojo.tech/locations
{
"addressLine1": "650 California St.",
"addressLine2": "300",
"city": "San Francisco",
"defaultTaxCodeId": "clplqndk7000u4xw54wbjagao",
"state": "CA",
"zipcode": "94110",
"directions": null,
"name": "Affirm HQ - Receiving",
"phone": "415-623-7898",
"type": "Jobsite"
}

Example Response​

{
"id": "ckoj0coh7053b0808wwlnbu7i",
"addressLine1": "650 California St.",
"addressLine2": "300",
"city": "San Francisco",
"defaultTaxCodeId": "clplqndk7000u4xw54wbjagao",
"state": "CA",
"zipcode": "94110",
"directions": null,
"name": "Affirm HQ - Receiving",
"phone": "415-623-7898",
"type": "Jobsite",
"createdAt": "2021-05-10T19:38:26.923Z",
"updatedAt": "2021-05-10T19:38:26.923Z"
}

PATCH /locations/:id​

Updates a location.

Parameters​

NameTypeDescriptionExample
addressLine1string?The first line of the location's address"123 Kojo Avenue"
addressLine2string?The second line of the location's address"Office 18F"
citystring?The city the location is located in"San Francisco"
defaultTaxCodeIdID?The id of the default tax code to apply when this location is set as the DeliveryLocation on an Order
directionsstring?Specific directions regarding the location"Use the entrance on 1st St."
namestring?The name of the location"Kojo Systems Mars HQ"
phonestring?The phone number for the location"513-123-4567"
statestring?The state the location is located in"CA"
typeLocationType?The location typeBilling
zipcodestring?The zipcode the location is located in"94107"

Response​

The updated Location.

Example Mutation​

PATCH https://api.kojo.tech/locations
{
"name": "Affirm HQ - Jobsite",
}

Example Response​

{
"id": "ckoj0coh7053b0808wwlnbu7i",
"addressLine1": "650 California St.",
"addressLine2": "300",
"city": "San Francisco",
"defaultTaxCodeId": null,
"state": "CA",
"zipcode": "94110",
"directions": null,
"name": "Affirm HQ - Jobsite",
"phone": "415-623-7898",
"type": "Jobsite",
"createdAt": "2021-05-10T19:38:26.923Z",
"updatedAt": "2021-05-10T19:38:26.923Z"
}

DELETE /locations/:id​

Deletes a location.

Response​

The updated Location.

Example Mutation​

DELETE https://api.kojo.tech/locations/ckoj0coh7053b0808wwlnbu7i

Example Response​

{
"id": "ckoj0coh7053b0808wwlnbu7i",
"addressLine1": "650 California St.",
"addressLine2": "300",
"city": "San Francisco",
"defaultTaxCodeId": "clplqndk7000u4xw54wbjagao",
"state": "CA",
"zipcode": "94110",
"directions": null,
"name": "Affirm HQ - Jobsite",
"phone": "415-623-7898",
"type": "Jobsite",
"createdAt": "2021-05-10T19:38:26.923Z",
"updatedAt": "2021-05-10T19:38:26.923Z",
"deletedAt": "2021-05-10T19:38:26.923Z"
}