Skip to main content
POST
Create Trip

Endpoint

Create a new trip request. This initiates the ride-hailing process and matches the passenger with available drivers.

Headers

string
required
Must be application/json

Request Body

integer
required
Passenger user ID making the request
string
required
Service type requestedPossible values:
  • motocicleta - Motorcycle taxi
  • auto - Car service
  • mototaxi - Motorcycle taxi with passenger cabin
object
required
Trip origin location
object
required
Trip destination location (same structure as origen)

Response

boolean
required
Trip creation success status
string
Success or error message
object
Created trip object

Request Example

Response Example

Trip Status Flow

After creation, a trip goes through the following states:
1

pendiente

Trip created, waiting for driver acceptance
2

aceptado

Driver accepted the trip
3

en_ruta

Driver is on the way to pick up passenger
4

en_curso

Passenger picked up, trip in progress
5

completado

Trip successfully completed
Alternatively, the trip can be cancelled at any point before completion.

Service Types

Motocicleta

Standard motorcycle taxi for quick trips

Auto

Car service for comfort and multiple passengers

Mototaxi

Motorcycle taxi with passenger cabin

Pricing

The estimated price is calculated based on:
  • Base fare: Starting price
  • Distance: Price per kilometer
  • Duration: Price per minute (peak hours)
  • Service type: Different rates for moto/auto
  • Demand: Dynamic pricing during high demand

Error Responses

Bad Request
Invalid request data or coordinates
Not Found
User not found
Internal Server Error
Server error during trip creation

Notes

After creating a trip, use the Trip Status endpoint to monitor the trip state and driver assignment.
Ensure the origin and destination coordinates are accurate. Invalid coordinates will result in failed trip requests.

See Also