Skip to main content
Use the Trips API to start and manage trips from your backend, for example when an order is placed, and to read trip status, ETAs, and locations for an operations view. The base URL is https://api.radar.io. Send your API key in the Authorization header. For key types, the error format, and rate limits, see Authentication, errors, and rate limits. For the full pickup, delivery, and worker tracking workflows, see Track pickups, deliveries, and workers. For most apps, start and update trips with the SDK, which also changes tracking behavior on the device while a trip is active.

Trip object

A trip is a sequence of location updates with metadata and a unique ID, optionally with an ETA to a destination geofence. Depending on your use case, a trip can represent a pickup, a delivery, or something else.

Trip statuses

A trip with a status of started, approaching, or arrived is active. An active trip appears as trip on the user object.

Example trip

This trip is a pickup in progress, with a destination geofence and an ETA.

Get a trip

Gets a trip, including its locations. Reference the trip by Radar _id or externalId.
  • Endpoint: GET /v1/trips/:id
  • Authentication: Secret key
  • Rate limit: 10 requests per second

Path parameters

Response

A 200 response contains meta and trip, a trip object.

Example

This request gets the trip with the externalId order-299.
Radar returns this response:

Errors

A 404 response looks like this:

Get a trip route

Gets the route for a trip as a distance and an encoded polyline.
  • Endpoint: GET /v1/trips/:id/route
  • Authentication: Secret key
  • Rate limit: 10 requests per second
Trip routes must be enabled for your project. Contact your Radar account team.

Path parameters

Query parameters

Response

A 200 response contains:

Example

This request gets the route for the trip order-299.
Radar returns this response:

Errors

List trips

Lists trips. Trips are sorted descending by updatedAt unless you set sortBy.
  • Endpoint: GET /v1/trips
  • Authentication: Secret key
  • Rate limit: 10 requests per second

Query parameters

Response

A 200 response contains meta, with a hasMore boolean, and trips, an array of trip objects. To page through trips, set sortBy=createdAt and pass the createdAt of the last trip as createdBefore. See Pagination.

Example

This request lists the started and approaching trips to one store, without locations.
Radar returns this response:

Errors

Create a new trip

Creates a new trip. Location updates from the SDK with the trip’s userId update the trip for that user. Use the SDK to start trips and track users for most use cases. Create a trip with this operation when the trip starts from your backend or from an integration, for example when an order is placed.

Body parameters

Response

A 200 response contains meta and trip, the created trip object.

Example

This request creates a trip to the geofence store-42 for user-123.
Radar returns this response:

Errors

A 404 response looks like this:

Update a trip

Updates a trip. Reference the trip by Radar _id or externalId. Use this operation to change a trip’s status, for example to complete or cancel it, or to change its destination, mode, or metadata. On iOS and Android, use the SDK to update trips.

Path parameters

Body parameters

Response

A 200 response contains meta and trip, the updated trip object.

Example

This request completes the trip order-299.
Radar returns this response:

Errors

Delete a trip

Deletes a trip. Reference the trip by Radar _id or externalId.
  • Endpoint: DELETE /v1/trips/:id
  • Authentication: Secret key
  • Rate limit: 10 requests per second

Path parameters

Response

A 200 response contains only meta.

Example

This request deletes the trip order-299.
Radar returns this response:

Errors

Trip legs

A multi-leg trip has several destinations, visited in order. Each destination is a leg. On a multi-leg trip, destinations are defined on each leg, and the top-level destinationGeofenceTag, destinationGeofenceExternalId, and destinationLocation fields aren’t present.
Multi-leg trips must be enabled for your project. Contact your Radar account team.
When a leg ends, Radar generates a user.stopped_trip_leg event on the server. iOS SDK 3.46.0 and Android SDK 4.3.0 have no enum case for this event type, so handle it on your backend.

Leg object

Example multi-leg trip

This trip has two legs, each with a geofence destination.

Add a trip leg

Adds a leg to a multi-leg trip.
  • Endpoint: POST /v1/trips/:id/legs
  • Authentication: Publishable key
  • Rate limit: 10 requests per second

Path parameters

Body parameters

Response

A 200 response contains meta and trip, the updated trip object with its legs.

Example

This request adds a leg with a geofence destination to the trip route-123.
Radar returns this response:

Errors

Update a trip leg

Updates one leg of a multi-leg trip, for example to mark a stop as completed or to change its destination.
  • Endpoint: PATCH /v1/trips/:id/legs/:legId
  • Authentication: Publishable key
  • Rate limit: 10 requests per second

Path parameters

Body parameters

Response

A 200 response contains meta and trip, the updated trip object with its legs.

Example

This request completes one leg of the trip route-123.
Radar returns this response:

Errors

Reorder trip legs

Reorders the legs of a multi-leg trip. The trip must be pending or active and have more than one leg.
  • Endpoint: PUT /v1/trips/:id/legs
  • Authentication: Publishable key
  • Rate limit: 10 requests per second

Path parameters

Body parameters

Response

A 200 response contains meta and trip, the updated trip object with its legs in the new order.

Example

This request puts the two legs of the trip route-123 in a new order.
Radar returns this response:

Errors

Delete a trip leg

Deletes a leg from a multi-leg trip. A trip must keep at least one leg.
  • Endpoint: DELETE /v1/trips/:id/legs/:legId
  • Authentication: Publishable key
  • Rate limit: 10 requests per second

Path parameters

Response

A 200 response contains meta and trip, the updated trip object with its remaining legs.

Example

This request deletes one leg from the trip route-123.
Radar returns this response:

Errors

Trip analytics

The trip analytics page in the Radar dashboard summarizes completed trips for the environment you are viewing. It is updated nightly, so a trip appears the day after it completes. Wait time and trip time are calculated only for completed trips that have start, arrival, and completion times. A trip that was completed without reaching arrived is left out of both. You can filter by date range, destination geofence tag, destination geofence external ID, and travel mode. The By Destination table groups the same metrics by destination geofence. Your project’s data retention settings apply to analytics.