Skip to main content
Fetch the complete ride history for the authenticated user. The response includes rides where the user participated as either a rider or a driver. Authentication required — include Authorization: Bearer <token> in the request header.

Request

GET /rides/history No query parameters.

Response

An array of Ride objects. Each object contains the full ride record.
id
number
Unique ride identifier.
status
string
Final or current status of the ride. One of REQUESTED, ACCEPTED, PICKED, COMPLETED, CANCELLED.
riderId
number
ID of the rider.
driverId
number
ID of the driver, or null if the ride was never accepted.
pickupLocation
string
Human-readable pickup address.
dropLocation
string
Human-readable drop-off address.
pickupLat
number
Pickup latitude.
pickupLon
number
Pickup longitude.
dropLat
number
Drop-off latitude.
dropLon
number
Drop-off longitude.
fare
number
Fare for the ride.
paymentMode
string
Payment method used (e.g., CASH, CARD, WALLET).
paymentStatus
string
Current payment status.
riderRating
number
Rating the rider submitted (1–5), or null if no feedback was given.
riderFeedback
string
Written feedback from the rider, or null.
cancellationReason
string
Reason for cancellation, or null if the ride was not cancelled.
cancelledBy
string
Identifier of who cancelled the ride, or null.
cancellationFee
number
Fee charged for cancellation, or null.
createdAt
string
ISO 8601 timestamp of ride creation.
acceptedAt
string
ISO 8601 timestamp of driver acceptance, or null.

Example

curl -X GET "http://localhost:8080/rides/history" \
  -H "Authorization: Bearer <token>"
This endpoint returns rides where you appear as either the rider (riderId) or the driver (driverId), giving both riders and drivers a unified view of their trip history.