Locations
Schema​
Location
​
Name | Type | Description | Example |
---|---|---|---|
addressLine1 | string? | The first line of the location's address | "123 Kojo Avenue" |
addressLine2 | string? | The second line of the location's address | "Office 18F" |
city | string? | The city the location is located in | "San Francisco" |
createdAt | DateTime | When this location was created | "2021-03-24 17:26:46.983Z" |
defaultTaxCodeId | ID? | The default tax code to apply when this location is set as the DeliveryLocation on an Order | See TaxCode docs |
directions | string? | Specific directions regarding the location | "Use the entrance on 1st St." |
id | ID | The unique location ID | "ckmnpybisiy5x08abky4g2d1f" |
jobs | Job[] | The list of Jobs the location is attached to | See the Job docs |
name | string | The name of the location | "Kojo Systems Mars HQ" |
phone | string? | The phone number for the location | "513-123-4567" |
state | string? | The state the location is located in | "CA" |
type | LocationType | The location type | Billing |
vendors | Vendor[] | The list of Vendors the location is attached to | See the Vendor docs |
updatedAt | DateTime | When this location was last updated | "2021-03-24 17:26:46.983Z" |
zipcode | string? | 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​
Name | Description | Example |
---|---|---|
id | The 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​
Name | Type | Default | Description | Example |
---|---|---|---|---|
addressLine1 | string? | null | The first line of the location's address | "123 Kojo Avenue" |
addressLine2 | string? | null | The second line of the location's address | "Office 18F" |
city | string? | null | The city the location is located in | "San Francisco" |
defaultTaxCodeId | ID? | The id of the default tax code to apply when this location is set as the DeliveryLocation on an Order | "ckmnpybisiy5x08abky4g2d1f" | |
directions | string? | null | Specific directions regarding the location | "Use the entrance on 1st St." |
name | string | The name of the location | "Kojo Systems Mars HQ" | |
phone | string? | null | The phone number for the location | "513-123-4567" |
state | string? | null | The state the location is located in | "CA" |
type | LocationType | The location type | Billing | |
zipcode | string? | null | The 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​
Name | Type | Description | Example |
---|---|---|---|
addressLine1 | string? | The first line of the location's address | "123 Kojo Avenue" |
addressLine2 | string? | The second line of the location's address | "Office 18F" |
city | string? | The city the location is located in | "San Francisco" |
defaultTaxCodeId | ID? | The id of the default tax code to apply when this location is set as the DeliveryLocation on an Order | |
directions | string? | Specific directions regarding the location | "Use the entrance on 1st St." |
name | string? | The name of the location | "Kojo Systems Mars HQ" |
phone | string? | The phone number for the location | "513-123-4567" |
state | string? | The state the location is located in | "CA" |
type | LocationType? | The location type | Billing |
zipcode | string? | 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"
}