> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenflow.com.ar/llms.txt
> Use this file to discover all available pages before exploring further.

# Obtener Pedido

> Obtener un pedido individual por ID

# Obtener Pedido

Obtén información detallada sobre un pedido específico.

<Note>Requiere scope `read:orders`.</Note>

## Solicitud

```bash theme={null}
GET /api/v1/orders/{id}
```

### Parámetros de Ruta

<ParamField path="id" type="integer" required>
  El ID del pedido
</ParamField>

## Respuesta

<ResponseField name="success" type="boolean">
  Si la solicitud fue exitosa
</ResponseField>

<ResponseField name="data" type="object">
  El objeto de pedido con detalles completos incluyendo líneas de pedido
</ResponseField>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.zenflow.com.ar/api/v1/orders/12345" \
    -H "X-API-Key: zenflow_live_your_key"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.zenflow.com.ar/api/v1/orders/12345", {
    headers: { "X-API-Key": "zenflow_live_your_key" },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.zenflow.com.ar/api/v1/orders/12345',
      headers={'X-API-Key': 'zenflow_live_your_key'}
  )
  data = response.json()
  ```
</CodeGroup>

### Respuesta

```json theme={null}
{
  "success": true,
  "data": {
    "id": 12345,
    "order_tenant_id": "ORD-001",
    "state_id": 1,
    "state_picking_id": null,
    "assembly_date": "2024-01-15",
    "customer_name": "Juan Pérez",
    "shipping_address": "Av. Corrientes 1234, CABA",
    "order_detail": [
      {
        "id": 1001,
        "product_id": 100,
        "barcode": "7891234567890",
        "product_name": "Widget A",
        "quantity": 2,
        "picked_quantity": 0,
        "price": 29.99
      },
      {
        "id": 1002,
        "product_id": 101,
        "barcode": "7891234567891",
        "product_name": "Widget B",
        "quantity": 1,
        "picked_quantity": 0,
        "price": 49.99
      }
    ],
    "created_at": "2024-01-14T10:30:00Z",
    "updated_at": "2024-01-14T10:30:00Z"
  }
}
```

## Respuestas de Error

### 404 No Encontrado

```json theme={null}
{
  "success": false,
  "error": {
    "code": "not_found",
    "message": "Pedido no encontrado"
  }
}
```

### 400 Solicitud Incorrecta

```json theme={null}
{
  "success": false,
  "error": {
    "code": "invalid_id",
    "message": "El ID del pedido debe ser un entero válido"
  }
}
```
