Skip to main content
Submit a booking request with pickup and drop-off details. The server automatically associates the ride with your account and sets the initial status to REQUESTED. Authentication required — include Authorization: Bearer <token> in the request header.

Request

POST /rides/book
pickupLocation
string
Human-readable name or address of the pickup location.
dropLocation
string
Human-readable name or address of the drop-off location.
pickupLat
number
Latitude of the pickup point.
pickupLon
number
Longitude of the pickup point.
dropLat
number
Latitude of the drop-off point.
dropLon
number
Longitude of the drop-off point.
pickupLandmark
string
Landmark or additional detail for the pickup location (up to 600 characters).
dropLandmark
string
Landmark or additional detail for the drop-off location (up to 600 characters).
paymentMode
string
Payment method for the ride (e.g., CASH, CARD, WALLET).

Response

id
number
Unique identifier for the created ride.
status
string
Always REQUESTED on creation.
riderId
number
The ID of the authenticated rider who booked the ride.
fare
number
Computed fare for the ride.
pickupLocation
string
Pickup location as provided in the request.
dropLocation
string
Drop-off location as provided in the request.
pickupLat
number
Pickup latitude.
pickupLon
number
Pickup longitude.
dropLat
number
Drop-off latitude.
dropLon
number
Drop-off longitude.
pickupLandmark
string
Pickup landmark.
dropLandmark
string
Drop-off landmark.
paymentMode
string
Payment mode as provided in the request.
startOtp
string
OTP the driver must verify before starting the ride.
endOtp
string
OTP the rider must confirm to mark the ride as complete.
createdAt
string
ISO 8601 timestamp of when the ride was created.

Example

curl -X POST "http://localhost:8080/rides/book" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "pickupLocation": "MG Road, Bangalore",
    "dropLocation": "Indiranagar, Bangalore",
    "pickupLat": 12.9757,
    "pickupLon": 77.6011,
    "dropLat": 12.9784,
    "dropLon": 77.6408,
    "pickupLandmark": "Near Café Coffee Day",
    "dropLandmark": "Opposite HDFC Bank",
    "paymentMode": "CASH"
  }'
The status field is always set to REQUESTED by the server regardless of any value you send in the request body.