Crear viaje
POST
/trips
const url = 'https://api.dev.lade.com.mx/trips';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»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
cargoWeight
number
cargoVolume
number
cost
number
revenue
number
notes
string
specialInstructions
string
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"}Responses
Sección titulada «Responses»Viaje creado
Media typeapplication/json
object
id
string format: uuid
teamId
string format: uuid
status
Estado del viaje
string
routeId
string format: uuid
routeName
string
clientId
string format: uuid
clientName
string
driverId
string format: uuid
driverName
string
driverPhone
string
vehicleId
string format: uuid
vehiclePlate
string
startDate
string format: date-time
endDate
string format: date-time
actualEndDate
string format: date-time
cargoDescription
string
cargoWeight
Weight in kg
number
cargoVolume
Volume in m3
number
cost
number
revenue
number
notes
string
specialInstructions
string
cancelledAt
string format: date-time
cancelledBy
string
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"}