Ir al contenido

Crear ruta

POST
/routes
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

Media typeapplication/json
object
teamId
required
string format: uuid
name
required
string
>= 1 characters <= 100 characters
description
string
<= 1000 characters
clientId
string format: uuid
stops
required
Array<object>
>= 1 items <= 50 items
object
order
required
integer
routePointId
required
string format: uuid
routePointName
string
nullable
address
string
nullable
estimatedArrival
string
nullable
estimatedDuration

Duration in minutes

integer
<= 1440
notes
string
nullable <= 500 characters
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
}
]
}

Ruta creada

Media typeapplication/json
object
id
string format: uuid
teamId
string format: uuid
name
string
description
string
nullable
clientId
string format: uuid
nullable
clientName
string
nullable
stops
Array<object>
object
order
required
integer
routePointId
required
string format: uuid
routePointName
string
nullable
address
string
nullable
estimatedArrival
string
nullable
estimatedDuration

Duration in minutes

integer
<= 1440
notes
string
nullable <= 500 characters
totalDistance

Distance in km

number
nullable
estimatedDuration

Duration in minutes

integer
nullable
isActive
boolean
default: true
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"
}