Skip to main content
POST
/
trips
Create Trip
curl --request POST \
  --url https://api.example.com/trips \
  --header 'Content-Type: application/json' \
  --data '
{
  "passengerId": "<string>",
  "paymentMode": {},
  "pickupPoint": {
    "pickupPoint.lat": 123,
    "pickupPoint.lng": 123
  },
  "pickupAddress": "<string>",
  "stops": [
    {
      "stops[].point": {
        "stops[].point.lat": 123,
        "stops[].point.lng": 123
      },
      "stops[].address": "<string>",
      "stops[].placeId": "<string>",
      "stops[].notes": "<string>",
      "stops[].seq": 123,
      "stops[].plannedArrivalAt": "<string>"
    }
  ],
  "vehicleCategoryId": "<string>",
  "serviceClassId": "<string>",
  "idempotencyKey": "<string>"
}
'
{
  "success": true,
  "message": "Trip created successfully",
  "data": {
    "id": "trip-uuid-123",
    "passengerId": "123e4567-e89b-12d3-a456-426614174000",
    "currentStatus": "pending",
    "paymentMode": "card",
    "pickupPoint": {
      "lat": 40.7580,
      "lng": -73.9855
    },
    "pickupAddress": "Times Square, New York, NY",
    "stops": [
      {
        "seq": 1,
        "point": {
          "lat": 40.7614,
          "lng": -73.9776
        },
        "address": "Grand Central Terminal, New York, NY",
        "notes": "Wait at main entrance"
      }
    ],
    "requestedVehicleCategoryId": "cat-uuid-auto",
    "requestedServiceClassId": "class-uuid-standard",
    "fareEstimatedTotal": 15.50,
    "requestedAt": "2025-09-20T14:30:00Z",
    "createdAt": "2025-09-20T14:30:00Z",
    "updatedAt": "2025-09-20T14:30:00Z"
  }
}
Creates a new trip request for a passenger. The trip is initialized in pending status and awaits driver assignment through the matching system.

Request

Headers

Idempotency-Key
string
Optional idempotency key to prevent duplicate trip creation on retries. Recommended for production use.Example: req-2025-09-20-001

Body Parameters

passengerId
string
required
UUID of the passenger requesting the trip
paymentMode
enum
required
Payment method for the tripOptions: cash, card, wallet
pickupPoint
object
required
Geographic coordinates of the pickup location
pickupPoint.lat
number
required
Latitude (-90 to 90)
pickupPoint.lng
number
required
Longitude (-180 to 180)
pickupAddress
string
Human-readable pickup address (max 500 characters)Example: 350 5th Ave, New York, NY
stops
array
Array of intermediate stops and/or destination. The server assigns sequence numbers automatically.
stops[].point
object
required
Geographic coordinates of the stop
stops[].point.lat
number
required
Latitude (-90 to 90)
stops[].point.lng
number
required
Longitude (-180 to 180)
stops[].address
string
Human-readable address (max 500 characters)
stops[].placeId
string
Place identifier (e.g., Google Place ID, max 255 characters)
stops[].notes
string
Additional instructions for this stop (max 1000 characters)Example: Client drops package here
stops[].seq
number
Desired sequence order (server may reassign 1..N)
stops[].plannedArrivalAt
string
ISO 8601 timestamp for planned arrivalExample: 2025-09-18T15:45:00Z
vehicleCategoryId
string
required
UUID of the requested vehicle category (Auto, Moto, Van, etc.)
serviceClassId
string
required
UUID of the requested service class (Standard, Premium, etc.)
idempotencyKey
string
Alternative way to specify idempotency key in request body (max 120 characters)

Response

success
boolean
Indicates if the request was successful
message
string
Response message
data
object
The created trip object
data.id
string
Unique trip identifier (UUID)
data.passengerId
string
UUID of the passenger
data.currentStatus
string
Current trip status (will be pending for new trips)
data.paymentMode
string
Payment method: cash, card, or wallet
data.pickupPoint
object
Pickup location coordinates
data.pickupPoint.lat
number
Latitude
data.pickupPoint.lng
number
Longitude
data.pickupAddress
string
Pickup address if provided
data.stops
array
Array of trip stops with assigned sequence numbers
data.requestedVehicleCategoryId
string
Requested vehicle category UUID
data.requestedServiceClassId
string
Requested service class UUID
data.fareEstimatedTotal
number
Estimated total fare
data.requestedAt
string
ISO 8601 timestamp when trip was requested
data.createdAt
string
ISO 8601 timestamp of creation
data.updatedAt
string
ISO 8601 timestamp of last update

Example

curl -X POST https://api.rodando.com/trips \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: req-2025-09-20-001" \
  -d '{
    "passengerId": "123e4567-e89b-12d3-a456-426614174000",
    "paymentMode": "card",
    "pickupPoint": {
      "lat": 40.7580,
      "lng": -73.9855
    },
    "pickupAddress": "Times Square, New York, NY",
    "stops": [
      {
        "point": {
          "lat": 40.7614,
          "lng": -73.9776
        },
        "address": "Grand Central Terminal, New York, NY",
        "notes": "Wait at main entrance"
      }
    ],
    "vehicleCategoryId": "cat-uuid-auto",
    "serviceClassId": "class-uuid-standard"
  }'
{
  "success": true,
  "message": "Trip created successfully",
  "data": {
    "id": "trip-uuid-123",
    "passengerId": "123e4567-e89b-12d3-a456-426614174000",
    "currentStatus": "pending",
    "paymentMode": "card",
    "pickupPoint": {
      "lat": 40.7580,
      "lng": -73.9855
    },
    "pickupAddress": "Times Square, New York, NY",
    "stops": [
      {
        "seq": 1,
        "point": {
          "lat": 40.7614,
          "lng": -73.9776
        },
        "address": "Grand Central Terminal, New York, NY",
        "notes": "Wait at main entrance"
      }
    ],
    "requestedVehicleCategoryId": "cat-uuid-auto",
    "requestedServiceClassId": "class-uuid-standard",
    "fareEstimatedTotal": 15.50,
    "requestedAt": "2025-09-20T14:30:00Z",
    "createdAt": "2025-09-20T14:30:00Z",
    "updatedAt": "2025-09-20T14:30:00Z"
  }
}

Error Responses

400 Bad Request

Validation errors or invalid parameters

409 Conflict

Duplicate request detected (idempotency key already used)

Build docs developers (and LLMs) love