Skip to main content

Locations

Locations in Kojo represent an address as well as your organization's relationship with that address.

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"
defaultTaxCodeTaxCode?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

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​

NameDescriptionExample
idThe 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​

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 type"Billing"
zipcodestring?nullThe 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​

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"ckmnpybisiy5x08abky4g2d1f"
directionsstring?Specific directions regarding the location"Use the entrance on 1st St."
idIDThe unique location ID"ckmnpybisiy5x08abky4g2d1f"
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​

mutation {
updateLocation(
id: "ckmnpybisiy5x08abky4g2d1f"
name: "Kojo HQ"
) {
id
name
zipcode
}
}

Example Response​

{
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Kojo HQ",
"zipcode": "94105"
}

deleteLocation​

Deletes a location.

Parameters​

NameTypeDescriptionExample
idIDThe 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"
}