Ir al contenido

Crear viaje

POST
/trips
curl --request POST \
--url https://api.dev.lade.com.mx/trips \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "teamId": "550e8400-e29b-41d4-a716-446655440000", "routeId": "route-1", "clientId": "client-1", "startDate": "2024-01-15T08:00:00Z", "endDate": "2024-01-15T18:00:00Z", "cargoDescription": "Productos electrónicos", "cargoWeight": 500, "notes": "Manejar con cuidado" }'

Crea un nuevo viaje/entrega

Media typeapplication/json
object
teamId
required
string format: uuid
routeId
string format: uuid
clientId
string format: uuid
driverId
string format: uuid
vehicleId
string format: uuid
startDate
required
string format: date-time
endDate
string format: date-time
cargoDescription
string
<= 1000 characters
cargoWeight
number
<= 999999
cargoVolume
number
<= 999999
cost
number
<= 99999999
revenue
number
<= 99999999
notes
string
<= 1000 characters
specialInstructions
string
<= 1000 characters
Example
{
"teamId": "550e8400-e29b-41d4-a716-446655440000",
"routeId": "route-1",
"clientId": "client-1",
"startDate": "2024-01-15T08:00:00Z",
"endDate": "2024-01-15T18:00:00Z",
"cargoDescription": "Productos electrónicos",
"cargoWeight": 500,
"notes": "Manejar con cuidado"
}

Viaje creado

Media typeapplication/json
object
id
string format: uuid
teamId
string format: uuid
status

Estado del viaje

string
Allowed values: NO_INICIADO EN_PROCESO FINALIZADO_A_TIEMPO FINALIZADO_CON_RETRASO CANCELADO
routeId
string format: uuid
nullable
routeName
string
nullable
clientId
string format: uuid
nullable
clientName
string
nullable
driverId
string format: uuid
nullable
driverName
string
nullable
driverPhone
string
nullable
vehicleId
string format: uuid
nullable
vehiclePlate
string
nullable
startDate
string format: date-time
nullable
endDate
string format: date-time
nullable
actualEndDate
string format: date-time
nullable
cargoDescription
string
nullable
cargoWeight

Weight in kg

number
nullable
cargoVolume

Volume in m3

number
nullable
cost
number
nullable
revenue
number
nullable
notes
string
nullable
specialInstructions
string
nullable
cancelledAt
string format: date-time
nullable
cancelledBy
string
nullable
createdAt
string format: date-time
Example
{
"status": "NO_INICIADO"
}

Solicitud inválida

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Validation failed",
"field": "email",
"message": "Invalid email format"
}

No autenticado

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Unauthorized",
"message": "Invalid or expired token"
}

Sin permisos

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Forbidden",
"message": "You don't have permission to access this resource"
}