Crear ruta
POST
/routes
const url = 'https://api.dev.lade.com.mx/routes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"teamId":"550e8400-e29b-41d4-a716-446655440000","name":"Ruta Norte","description":"Entregas zona norte","stops":[{"order":0,"routePointId":"point-1","estimatedDuration":30},{"order":1,"routePointId":"point-2","estimatedDuration":45}]}'};
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/routes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "teamId": "550e8400-e29b-41d4-a716-446655440000", "name": "Ruta Norte", "description": "Entregas zona norte", "stops": [ { "order": 0, "routePointId": "point-1", "estimatedDuration": 30 }, { "order": 1, "routePointId": "point-2", "estimatedDuration": 45 } ] }'Crea una nueva ruta predefinida con paradas
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»Media typeapplication/json
object
teamId
required
string format: uuid
name
required
string
description
string
clientId
string format: uuid
stops
required
Array<object>
object
order
required
integer
routePointId
required
string format: uuid
routePointName
string
address
string
estimatedArrival
string
estimatedDuration
Duration in minutes
integer
notes
string
Example
{ "teamId": "550e8400-e29b-41d4-a716-446655440000", "name": "Ruta Norte", "description": "Entregas zona norte", "stops": [ { "order": 0, "routePointId": "point-1", "estimatedDuration": 30 }, { "order": 1, "routePointId": "point-2", "estimatedDuration": 45 } ]}Responses
Sección titulada «Responses»Ruta creada
Media typeapplication/json
object
id
string format: uuid
teamId
string format: uuid
name
string
description
string
clientId
string format: uuid
clientName
string
stops
Array<object>
object
order
required
integer
routePointId
required
string format: uuid
routePointName
string
address
string
estimatedArrival
string
estimatedDuration
Duration in minutes
integer
notes
string
totalDistance
Distance in km
number
estimatedDuration
Duration in minutes
integer
isActive
boolean
createdAt
string format: date-time
Example
{ "isActive": true}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"}