Skip to main content
GET
/
api
/
v1
/
envios
/
{id}
Get Shipment by ID
curl --request GET \
  --url https://api.example.com/api/v1/envios/{id}
{
  "id": 123,
  "codigoSeguimiento": "<string>",
  "estado": "<string>",
  "fechaEnvio": "<string>",
  "fechaEntrega": "<string>",
  "precio": 123,
  "placa": "<string>",
  "nombreDestinatario": "<string>",
  "dniDestinatario": "<string>",
  "remitente": {
    "id": 123,
    "dni": "<string>",
    "nombreCompleto": "<string>",
    "correo": "<string>",
    "telefono": "<string>"
  },
  "sucursalOrigen": {},
  "sucursalDestino": {},
  "encomienda": {
    "id": 123,
    "peso": 123,
    "dimensiones": "<string>",
    "descripcion": "<string>"
  }
}

Endpoint

GET /api/v1/envios/{id}
Retrieve detailed information about a specific shipment using its unique identifier.

Path Parameters

id
number
required
The unique identifier of the shipment

Response

Returns a complete shipment object with all related information:
id
number
Unique shipment identifier
codigoSeguimiento
string
Tracking code (format: ENV-)
estado
string
Current shipment status: PENDIENTE, EN_TRANSITO, DISPONIBLE, ENTREGADO, CANCELADO
fechaEnvio
string
ISO 8601 datetime when shipment was created
fechaEntrega
string
ISO 8601 datetime when shipment was delivered (null if not yet delivered)
precio
number
Shipment cost in local currency
placa
string
Vehicle plate number (null if not yet assigned)
nombreDestinatario
string
Full name of the recipient
dniDestinatario
string
Recipient’s national ID number
remitente
object
Sender/client information
sucursalOrigen
object
Origin branch office details
sucursalDestino
object
Destination branch office details
encomienda
object
Package information

Example Request

curl -X GET http://localhost:8080/api/v1/envios/1

Example Response

{
  "id": 1,
  "codigoSeguimiento": "ENV-1709940000000",
  "estado": "EN_TRANSITO",
  "fechaEnvio": "2024-03-08T10:30:00",
  "fechaEntrega": null,
  "precio": 45.50,
  "placa": "ABC-123",
  "nombreDestinatario": "Carlos Rodríguez",
  "dniDestinatario": "87654321",
  "remitente": {
    "id": 1,
    "dni": "12345678",
    "nombreCompleto": "María García",
    "correo": "[email protected]",
    "telefono": "987654321"
  },
  "sucursalOrigen": {
    "id": 1,
    "codigoSucursal": "LIM-001",
    "nombreSucursal": "Lima Centro",
    "direccion": "Av. Abancay 123",
    "ciudad": "Lima"
  },
  "sucursalDestino": {
    "id": 2,
    "codigoSucursal": "CUS-001",
    "nombreSucursal": "Cusco Principal",
    "direccion": "Av. El Sol 456",
    "ciudad": "Cusco"
  },
  "encomienda": {
    "id": 1,
    "peso": 5.2,
    "dimensiones": "30x40x50",
    "descripcion": "Documentos importantes"
  }
}

Error Responses

Shipment Not Found

{
  "error": "EnvioNotFoundException",
  "message": "Envío no encontrado con id: 999"
}
This endpoint throws EnvioNotFoundException if the shipment with the specified ID does not exist.

Use Cases

  • Administrative dashboard displaying shipment details
  • Shipment status verification
  • Integration with external systems
  • Internal tracking and auditing

Build docs developers (and LLMs) love