> ## 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.

# Inicio Rapido

> Comienza a usar la API de ZenFlow en minutos

# Inicio Rapido

Esta guia te ayudara a hacer tu primera llamada a la API de ZenFlow en menos de 5 minutos.

## Paso 1: Obtener tu API Key

1. Inicia sesion en tu [Panel de ZenFlow](https://app.zenflow.com)
2. Navega a **Configuracion** > **API Keys**
3. Haz clic en **Crear API Key**
4. Dale un nombre a tu key y selecciona los permisos (scopes) necesarios
5. Copia y guarda tu API key de forma segura

<Warning>
  El secreto de tu API key solo se muestra una vez. Guardalo de forma segura -
  no podras verlo de nuevo.
</Warning>

## Paso 2: Hacer tu Primera Peticion

Vamos a obtener tus pedidos para asegurarnos de que todo funciona:

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

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.zenflow.com.ar/api/v1/orders", {
    method: "GET",
    headers: {
      "X-API-Key": "zenflow_live_tu_api_key_aqui",
      "Content-Type": "application/json",
    },
  });

  const data = await response.json();
  console.log(data);
  ```

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

  response = requests.get(
      'https://api.zenflow.com.ar/api/v1/orders',
      headers={
          'X-API-Key': 'zenflow_live_tu_api_key_aqui',
          'Content-Type': 'application/json'
      }
  )

  data = response.json()
  print(data)
  ```
</CodeGroup>

Deberias recibir una respuesta como esta:

```json theme={null}
{
  "success": true,
  "data": {
    "orders": [],
    "pagination": {
      "total": 0,
      "page": 1,
      "limit": 50,
      "total_pages": 0
    }
  }
}
```

## Paso 3: Crear tu Primer Pedido

Ahora vamos a crear un pedido:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.zenflow.com.ar/api/v1/orders" \
    -H "X-API-Key: zenflow_live_tu_api_key_aqui" \
    -H "Content-Type: application/json" \
    -d '{
      "order_tenant_id": "ORD-001",
      "assembly_date": "2024-01-15",
      "order_detail": [
        {
          "barcode": "7891234567890",
          "quantity": 2
        }
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.zenflow.com.ar/api/v1/orders", {
    method: "POST",
    headers: {
      "X-API-Key": "zenflow_live_tu_api_key_aqui",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      order_tenant_id: "ORD-001",
      assembly_date: "2024-01-15",
      order_detail: [
        {
          barcode: "7891234567890",
          quantity: 2,
        },
      ],
    }),
  });

  const data = await response.json();
  console.log(data);
  ```

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

  response = requests.post(
      'https://api.zenflow.com.ar/api/v1/orders',
      headers={
          'X-API-Key': 'zenflow_live_tu_api_key_aqui',
          'Content-Type': 'application/json'
      },
      json={
          'order_tenant_id': 'ORD-001',
          'assembly_date': '2024-01-15',
          'order_detail': [
              {
                  'barcode': '7891234567890',
                  'quantity': 2
              }
          ]
      }
  )

  data = response.json()
  print(data)
  ```
</CodeGroup>

## Paso 4: Configurar Webhooks (Opcional)

Para recibir notificaciones en tiempo real cuando se actualicen los pedidos, configura un webhook:

```bash theme={null}
curl -X POST "https://api.zenflow.com.ar/api/v1/webhooks" \
  -H "X-API-Key: zenflow_live_tu_api_key_aqui" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Actualizaciones de Pedidos",
    "url": "https://tu-servidor.com/webhooks/zenflow",
    "events": ["order.created", "order.updated", "order.completed"]
  }'
```

<Note>
  Asegurate de guardar el secreto del webhook que se devuelve en la respuesta -
  lo necesitaras para verificar las firmas de los webhooks.
</Note>

## Siguientes Pasos

<CardGroup cols={2}>
  <Card title="Referencia de API" icon="book" href="/es/api-reference/overview">
    Explora todos los endpoints disponibles
  </Card>

  <Card title="Guia de Integracion ERP" icon="plug" href="/es/guides/erp-integration">
    Aprende a integrar con tu ERP
  </Card>

  <Card title="Guia de Webhooks" icon="webhook" href="/es/guides/webhooks">
    Configura notificaciones en tiempo real
  </Card>

  <Card title="Integraciones" icon="puzzle-piece" href="/es/integrations/overview">
    Conecta con Mercado Libre, Tiendanube y mas
  </Card>
</CardGroup>
