List Dispatches
GET /api/dispatches
Retrieve all dispatches with vehicle information, optionally filtered by collection center.
Query Parameters
Filter dispatches by collection center ID. If not provided, uses the active center from configuration.
Response
Returns an array of dispatch objects sorted by created_at DESC, with vehicle information joined.
Unique dispatch identifier
Dispatch date (DD/MM/YYYY or YYYY-MM-DD)
Description of the dispatched material
Presentation format (e.g., “Tanque”, “Bidones”)
Quantity dispatched in liters
Name of the destination company/entity
Tax ID (RIF) of the destination
Physical address of the destination
ID of the vehicle used for dispatch
License plate of the dispatch vehicle (joined from vehicles table)
Brand of the dispatch vehicle (joined from vehicles table)
Model of the dispatch vehicle (joined from vehicles table)
Driver’s identification number
MINEC guide number (government transport guide)
Associated collection center ID
Timestamp when dispatch was created
Example Request
curl http://localhost:4000/api/dispatches?collectionCenterId=center-1
Example Response
[
{
"id": "dispatch-1",
"date": "09/03/2026",
"description": "Aceite Vegetal Usado Filtrado",
"presentation": "Tanque",
"dispatched_quantity": 500.0,
"destination_name": "Procesadora Central C.A.",
"destination_rif": "J-11111111-1",
"destination_address": "Zona Industrial, Galpón 5",
"vehicle_id": "vehicle-1",
"vehicle_plate": "ABC-123",
"vehicle_brand": "Toyota",
"vehicle_model": "Hilux 2020",
"driver_name": "Carlos Rodríguez",
"driver_id": "V-12345678",
"minec_guide_number": "MG-2026-001234",
"collection_center_id": "center-1",
"created_at": "2026-03-09T14:00:00Z"
}
]
Create Dispatch
POST /api/dispatches
Create a new dispatch record.
Request Body
Unique dispatch identifier (UUID)
Dispatch date (DD/MM/YYYY or YYYY-MM-DD)
Description of the dispatched material
Presentation format (e.g., “Tanque”, “Bidones”)
Quantity dispatched in liters
Name of the destination company/entity
Tax ID (RIF) of the destination
Physical address of the destination
ID of the vehicle used for dispatch
Driver’s identification number
MINEC guide number (government transport guide)
Response
Returns the created dispatch object with created_at timestamp.
The collectionCenterId is automatically determined from the request context or active configuration.
Example Request
curl -X POST http://localhost:4000/api/dispatches \
-H "Content-Type: application/json" \
-d '{
"id": "dispatch-new-1",
"date": "09/03/2026",
"description": "Aceite Vegetal Usado Filtrado",
"presentation": "Tanque",
"dispatchedQuantity": 500.0,
"destinationName": "Procesadora Central C.A.",
"destinationRif": "J-11111111-1",
"destinationAddress": "Zona Industrial, Galpón 5",
"vehicleId": "vehicle-1",
"driverName": "Carlos Rodríguez",
"driverId": "V-12345678",
"minecGuideNumber": "MG-2026-001234"
}'
Example Response
{
"id": "dispatch-new-1",
"date": "09/03/2026",
"description": "Aceite Vegetal Usado Filtrado",
"presentation": "Tanque",
"dispatched_quantity": 500.0,
"destination_name": "Procesadora Central C.A.",
"destination_rif": "J-11111111-1",
"destination_address": "Zona Industrial, Galpón 5",
"vehicle_id": "vehicle-1",
"driver_name": "Carlos Rodríguez",
"driver_id": "V-12345678",
"minec_guide_number": "MG-2026-001234",
"collection_center_id": "center-1",
"created_at": "2026-03-09T14:00:00Z"
}
Update Dispatch
PUT /api/dispatches/:id
Update an existing dispatch.
Path Parameters
Request Body
Description of the dispatched material
Quantity dispatched in liters
Response
Returns the updated dispatch object.
Example Request
curl -X PUT http://localhost:4000/api/dispatches/dispatch-1 \
-H "Content-Type: application/json" \
-d '{
"date": "09/03/2026",
"description": "Aceite Vegetal Usado Filtrado Premium",
"presentation": "Tanque",
"dispatchedQuantity": 550.0,
"destinationName": "Procesadora Central C.A.",
"destinationRif": "J-11111111-1",
"destinationAddress": "Zona Industrial, Galpón 5",
"vehicleId": "vehicle-1",
"driverName": "Carlos Rodríguez",
"driverId": "V-12345678",
"minecGuideNumber": "MG-2026-001234"
}'
Delete Dispatch
DELETE /api/dispatches/:id
Delete a dispatch by its ID.
Path Parameters
Response
Returns true if deletion was successful
Example Request
curl -X DELETE http://localhost:4000/api/dispatches/dispatch-1
Example Response
Error Response
{
"error": "DB delete error"
}