Skip to main content
POST
Create trip
distance is optional when both google_start_place_id and google_end_place_id are provided (from the address suggestions endpoints); the driving distance between them is then computed automatically and the trip’s distance_source is COMPUTED. Providing an explicit distance always takes precedence and sets distance_source to MANUAL. A request with neither a distance nor both place IDs returns a 400. When updating an existing trip via external_id, the distance is recomputed only if the place IDs change; if they are unchanged, the existing distance is kept.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string

Content-Type must be set to application/json.

Path Parameters

businessId
string<uuid>
required

The UUID of the business.

Body

application/json
vehicle_id
string<uuid>
required

The UUID of the vehicle used for this trip.

trip_date
string<date>
required

The date of the trip (YYYY-MM-DD).

external_id
string | null

An optional external identifier for the trip. If provided and a trip with this external_id already exists, the existing trip will be updated instead of creating a new one.

distance
string

The distance traveled in miles, as a decimal string. Optional when both google_start_place_id and google_end_place_id are provided; the driving distance is then computed automatically. Providing a distance always takes precedence and marks the trip distance as MANUAL.

purpose
enum<string>
default:UNREVIEWED

The purpose classification of the trip.

Available options:
UNREVIEWED,
BUSINESS,
PERSONAL
start_address
string | null

The starting address of the trip.

end_address
string | null

The ending address of the trip.

google_start_place_id
string | null

Google Maps place ID of the trip start address, from the address suggestion endpoints.

google_end_place_id
string | null

Google Maps place ID of the trip end address, from the address suggestion endpoints.

start_latitude
string | null

Latitude of the start address, as a decimal string.

start_longitude
string | null

Longitude of the start address, as a decimal string.

end_latitude
string | null

Latitude of the end address, as a decimal string.

end_longitude
string | null

Longitude of the end address, as a decimal string.

description
string | null

An optional description or notes about the trip.

Response

Existing trip with matching external_id was updated.

data
object
required