Skip to main content
GET
/
api
/
pedidos
/
{id}
Get Order by ID
curl --request GET \
  --url https://api.example.com/api/pedidos/{id}
Retrieves a specific order by its reference ID.

Authentication

Requires JWT token in the Authorization header.
Authorization: Bearer YOUR_JWT_TOKEN

Path Parameters

ParameterTypeRequiredDescription
idLongYesOrder reference ID

Response

Returns a single order object with complete details including line items.

Response Body

{
  "pedido_id": 1,
  "referencia": "ORD-2026-001",
  "usuario": {
    "usuario_id": 5,
    "username": "john_doe",
    "email": {
      "address": "[email protected]"
    }
  },
  "fechaPedido": "2026-03-11T10:30:00",
  "estado": "PAGADO",
  "detalles": [
    {
      "detalle_id": 1,
      "producto": {
        "producto_id": 10,
        "nombre": "BILLY Bookcase",
        "precioCantidad": 49.99,
        "precioMoneda": "USD",
        "es_destacado": false
      },
      "cantidad": 2,
      "precioUnitario": 49.99,
      "subtotal": 99.98
    },
    {
      "detalle_id": 2,
      "producto": {
        "producto_id": 15,
        "nombre": "MALM Dresser",
        "precioCantidad": 129.99,
        "precioMoneda": "USD",
        "es_destacado": true
      },
      "cantidad": 1,
      "precioUnitario": 129.99,
      "subtotal": 129.99
    }
  ],
  "total": 229.97
}

Response Fields

FieldTypeDescription
pedido_idLongUnique order identifier
referenciaStringAuto-generated order reference number
usuarioObjectUser who placed the order
usuario.usuario_idLongUser ID
usuario.usernameStringUsername
usuario.email.addressStringUser email address
fechaPedidoDateTimeOrder creation timestamp
estadoStringOrder status (see EstadoPedido values)
detallesArrayArray of order line items
detalles[].detalle_idLongLine item ID
detalles[].productoObjectProduct details
detalles[].cantidadIntegerQuantity ordered
detalles[].precioUnitarioBigDecimalUnit price at time of order
detalles[].subtotalBigDecimalLine item subtotal
totalBigDecimalTotal order amount

EstadoPedido Values

  • PENDIENTE - Order pending
  • PAGADO - Order paid
  • ENVIADO - Order shipped
  • ENTREGADO - Order delivered
  • CANCELADO - Order cancelled

Example Request

curl -X GET "https://api.iquea.com/api/pedidos/1" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"

Status Codes

CodeDescription
200Success - Returns order object
401Unauthorized - Invalid or missing token
404Order not found
500Internal server error

Build docs developers (and LLMs) love