guiaDespecho) from the carrier gives you and your customers a reference for external tracking.
Shipment types
TERRESTRE
Standard ground delivery. Estimated delivery in 5 days. Suitable for domestic shipments where speed is not the primary concern.
EXPRESS
Priority delivery. Estimated delivery in 1 day. Use for time-sensitive orders or high-priority customers.
Shipment lifecycle
CREADO — Shipment created
A new shipment record is created and linked to the order. The carrier and destination are recorded. The estimated delivery date is calculated from the shipment type.
ASIGNADO — Carrier assigned
The shipment has been assigned to a specific driver or carrier route. The
guiaDespecho (carrier guide number) is typically recorded at this stage.Create a shipment
Send aPOST request to /api/envios with the order ID, shipment type, carrier name, and destination. The shipment is linked to the order via pedidoId — this is a logical reference, not a database foreign key, since each service maintains its own data store.
201 Created response returns the shipment object. The initial status is CREADO and fechaEstimadaEntrega is calculated automatically based on the tipoEnvio.
Required fields
| Field | Type | Description |
|---|---|---|
pedidoId | integer | ID of the approved order this shipment belongs to |
tipoEnvio | string | TERRESTRE (5-day delivery) or EXPRESS (1-day delivery) |
transportista | string | Name of the carrier company |
destino | string | Delivery destination |
Advance shipment status
Move a shipment to the next stage usingPATCH /api/envios/{id}/status. Pass the target status as a query parameter.
ASIGNADO, EN_RUTA, or ENTREGADO. Attempting to skip stages or set an invalid status returns a 400 Bad Request.
The guide number field
TheguiaDespecho field stores the carrier’s tracking or guide number — the reference code issued by the carrier when the shipment is picked up. This value is auto-generated when the shipment is created. Include it when communicating with customers or when cross-referencing with the carrier’s own tracking system.
List all shipments
pedidoId, status, tipoEnvio, transportista, guiaDespecho, destino, and fechaEstimadaEntrega.
Endpoint reference
| Method | Path | Description |
|---|---|---|
POST | /api/envios | Create a new shipment |
GET | /api/envios | List all shipments |
GET | /api/envios/{id} | Get a shipment by ID |
PATCH | /api/envios/{id}/status?status= | Advance shipment status |