Locations
Locations in Kojo represent an address as well as your organization's relationship with that address.
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" |
defaultTaxCode | TaxCode? | 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
Queries​
important
This API does not de-dupe locations, some of which might be matches save for abbreviations or capitalizations.
location
​
Used to read a single location.
Parameters​
Name | Description | Example |
---|---|---|
id | The ID of the location to fetch | "ckmnpybisiy5x08abky4g2d1f" |
Response​
A single Location
object.
Example Query​
query {
location(id: "ckmnpybisiy5x08abky4g2d1f") {
id
defaultTaxCode {
id
code
}
name
type
zipcode
}
}
Example Response​
{
"id": "ckmnpybisiy5x08abky4g2d1f",
"defaultTaxCode": {
"id": "clplqjgfs00044xw5iqhu9wwz",
"code": "NYC"
},
"name": "Salesforce Tower",
"type": "Jobsite",
"zipcode": "94105"
}
locations
​
Read all locations, with pagination.
Parameters​
Accepts all standard pagination parameters.
Allowed orderBy fields: createdAt
, id
, name
, updatedAt
.
Allowed filter fields: addressLine1
, addressLine2
, city
, state
, zipcode
, createdAt
, id
, name
, type
, updatedAt
.
Response​
A list of Location
objects.
Example Query​
query {
locations(limit: 10, orderBy: zipcode) {
id
defaultTaxCode {
id
code
}
name
zipcode
}
}
Example Response​
[
{
"id": "ckmnpybisiy5x08abky4g2d1f",
"defaultTaxCode": {
"id": "clplqjgfs00044xw5iqhu9wwz",
"code": "NYC"
},
"name": "Kojo HQ",
"zipcode": "94107"
},
{
"id": "ckmnpybi7ag5x08abky4g2d1f",
"defaultTaxCode": null,
"name": "Kojo Warehouse",
"zipcode": "94109"
}
]
Mutations​
addLocationToJob
​
See this mutation documented in Jobs
createLocation
​
Creates a new location.
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​
mutation {
createLocation(
name: "Salesforce Tower"
type: Billing
zipcode: "94105"
) {
id
name
zipcode
}
}
Example Response​
{
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower",
"zipcode": "94105"
}
updateLocation
​
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 | "ckmnpybisiy5x08abky4g2d1f" |
directions | string? | Specific directions regarding the location | "Use the entrance on 1st St." |
id | ID | The unique location ID | "ckmnpybisiy5x08abky4g2d1f" |
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​
mutation {
updateLocation(
id: "ckmnpybisiy5x08abky4g2d1f"
name: "Kojo HQ"
) {
id
name
zipcode
}
}
Example Response​
{
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Kojo HQ",
"zipcode": "94105"
}
deleteLocation
​
Deletes a location.
Parameters​
Name | Type | Description | Example |
---|---|---|---|
id | ID | The unique location ID | "ckmnpybisiy5x08abky4g2d1f" |
Response​
The deleted Location
.
Example Mutation​
mutation {
deleteLocation(
id: "ckmnpybisiy5x08abky4g2d1f"
) {
id
name
zipcode
}
}
Example Response​
{
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Kojo HQ",
"zipcode": "94105"
}