The Assignments API is the operational core of the Rappi2 logistics platform. An assignment ties a single order, driver, and vehicle together for one delivery run. Creating an assignment enforces business rules across all three resources; the two lifecycle transitions (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JorLOrT/rappi2/llms.txt
Use this file to discover all available pages before exploring further.
/iniciar and /finalizar) drive state changes on both the order and the driver automatically.
Business rules
Before an assignment can be created, all three referenced resources must satisfy the following conditions simultaneously:| Resource | Required condition |
|---|---|
Order (orden) | estado = Pendiente |
Driver (conductor) | activo = true and disponibilidad = Disponible |
Vehicle (vehiculo) | activo = true and estado = Operativo |
400 with a descriptive message.
State machine
Assignment states
| State | Description |
|---|---|
Asignada | Assignment created; driver and vehicle are booked. |
EnCurso | Delivery in progress; driver has left the pick-up point. |
Finalizada | Delivery confirmed; driver is free again. |
Cancelada | Assignment cancelled before completion. |
Side effects on related resources
List assignments
asignaciones:read
Query parameters
Number of records to skip for pagination.
Maximum number of records to return. Hard cap: 200.
Filter by assignment state:
Asignada, EnCurso, Finalizada, or Cancelada.Return only assignments for this driver.
Response 200
Array of assignment objects.
Unique assignment identifier.
ID of the delivery order.
ID of the assigned driver.
Licence plate of the assigned vehicle.
Current assignment state.
Timestamp when
/iniciar was called. null until then.Timestamp when
/finalizar was called. null until then.Create an assignment
Pendiente, driver Disponible, vehicle Operativo) are validated atomically. On success, the order advances to En Proceso and the driver is set to Ocupado.
Required permission: asignaciones:write
Request body
ID of the order to assign. Must be in
Pendiente state.ID of the driver to assign. Must be active and
Disponible.Licence plate of the vehicle to use. Must be active and
Operativo.Response 201
The newly created assignment object.
Get an assignment
404 if not found.
Required permission: asignaciones:read
Path parameters
Assignment ID.
Response 200
Assignment object.
Update an assignment
/iniciar and /finalizar endpoints instead, as they enforce state-machine rules and update related resources.
Required permission: asignaciones:write
Path parameters
Assignment ID.
Request body
All fields are optional.New state:
Asignada, EnCurso, Finalizada, or Cancelada.Manual override of the start timestamp.
Manual override of the end timestamp.
Response 200
Updated assignment object.
Start a delivery
Asignada to EnCurso. Simultaneously advances the linked order to En Tránsito and records fecha_inicio. Returns 400 if the assignment is not currently Asignada.
Required permission: asignaciones:write
Path parameters
Assignment ID. Must be in
Asignada state.Request body
No body required.Response 200
Updated assignment object with estado = EnCurso and fecha_inicio set.
Finish a delivery
EnCurso to Finalizada. Simultaneously marks the order as Entregado, sets the driver back to Disponible, and records fecha_fin. Returns 400 if the assignment is not currently EnCurso.
Required permission: asignaciones:write
Path parameters
Assignment ID. Must be in
EnCurso state.Request body
No body required.Response 200
Updated assignment object with estado = Finalizada and fecha_fin set.
Cancel / delete an assignment
400 if the assignment is currently EnCurso — call /finalizar first.
Required permission: asignaciones:delete
Path parameters
Assignment ID. Must not be in
EnCurso state.