Skip to main content

GET /locations

Look up HopDrive locations your application is authorized to see. Use these endpoints to discover a location's HopDrive id — for example when you want to pass pickup_location_id / delivery_location_id to GET /appointments/availability instead of an address string, or to confirm which saved location an address resolved to.

Results are always scoped to the rooftops your bearer token authorizes; you will never see another dealer's locations.

GET /locations

Returns an array of locations matching the supplied query params. With no filters it returns every location your token can access (paginated).

Example Request

List locations for a rooftop
curl --request GET \
--url 'https://api.hopdrive.com/v1/locations?customer_id=1234&search=Mulberry' \
--header 'Authorization: Bearer <your token>'

Query Params

All query params are optional. Filters combine with AND.

FieldTypeDescription
customer_idNumberRestrict to a single rooftop. Must be a rooftop your bearer token authorizes, else ACCESS_DENIED.
region_idNumberRestrict to locations in a given HopDrive region.
typeStringRestrict to a location type (e.g. customer, consumer residential, consumer business).
activeBooleantrue/1 returns only active locations; false/0 returns only inactive ones. Omit to return both.
searchStringPartial, case-insensitive match against the location name or full address. Handy for finding an address.
limitNumberMax rows to return. Default 100, capped at 500.
offsetNumberNumber of rows to skip, for pagination. Default 0.

Example Response

200 /v1/locations
{
"locations": [
{
"id": 9001,
"customer_id": 1234,
"name": "210 S Mulberry St",
"nickname": null,
"address": "210 S Mulberry St, Richmond, VA 23220",
"address_one": "210 S Mulberry St",
"address_two": null,
"city": "Richmond",
"state": "VA",
"zip": "23220",
"latitude": 37.5407,
"longitude": -77.4665,
"place_id": "ChIJ...",
"region_id": 12,
"type": "consumer residential",
"timezone": "America/New_York",
"active": 1,
"email": null,
"phone": null,
"createdat": "2026-05-01T14:22:10.000Z",
"updatedat": "2026-05-01T14:22:10.000Z"
}
]
}

GET /locations/:id

Fetch a single location by its HopDrive id.

Example Request

Get a location by id
curl --request GET \
--url 'https://api.hopdrive.com/v1/locations/9001' \
--header 'Authorization: Bearer <your token>'

Example Response

200 /v1/locations/9001
{
"id": 9001,
"customer_id": 1234,
"name": "210 S Mulberry St",
"nickname": null,
"address": "210 S Mulberry St, Richmond, VA 23220",
"address_one": "210 S Mulberry St",
"address_two": null,
"city": "Richmond",
"state": "VA",
"zip": "23220",
"latitude": 37.5407,
"longitude": -77.4665,
"place_id": "ChIJ...",
"region_id": 12,
"type": "consumer residential",
"timezone": "America/New_York",
"active": 1,
"email": null,
"phone": null,
"createdat": "2026-05-01T14:22:10.000Z",
"updatedat": "2026-05-01T14:22:10.000Z"
}

Response Fields

FieldTypeDescription
idNumberHopDrive location ID. This is the value to pass to other endpoints.
customer_idNumberThe rooftop that owns this location.
nameStringDisplay name (often the street address or a business name).
nicknameStringOptional dealer-assigned nickname. May be null.
addressStringFull formatted address.
address_oneStringStreet address line.
address_twoStringSuite / unit / PO box line. May be null.
cityStringCity.
stateStringState.
zipStringPostal code.
latitudeNumberGeocoded latitude.
longitudeNumberGeocoded longitude.
place_idStringGoogle Place ID, when known.
region_idNumberHopDrive region this location falls in. May be null if not yet assigned.
typeStringLocation type.
timezoneStringIANA timezone of the location.
activeNumber1 if active, 0 if inactive.
emailStringOptional contact email. May be null.
phoneStringOptional contact phone. May be null.
createdatStringISO 8601 UTC creation timestamp.
updatedatStringISO 8601 UTC last-update timestamp.

Error Responses

HTTPCodeCause
400REQUEST_INVALIDA query param has the wrong type, or the :id path segment is not a number.
401ACCESS_DENIEDMissing / invalid bearer token, or a customer_id filter the token does not authorize.
404REQUEST_INVALIDNo location with that id is visible to your bearer token.
500UNKNOWNUnexpected server error.