Skip to main content

Ejemplos cURL

1. Login

curl -X POST https://api.gestia.lat/api/v1/auth/login \
-H 'Content-Type: application/json' \
-d '{"email": "tu@correo.com", "password": "tu-clave"}'

2. Crear una factura

curl -X POST https://api.gestia.lat/api/v1/invoices \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H 'Content-Type: application/json' \
-d '{
"customerId": "uuid-del-cliente",
"items": [
{ "productId": "uuid-del-producto", "quantity": 2, "unitPrice": 150000 }
]
}'

3. Consultar inventario

curl https://api.gestia.lat/api/v1/products?page=1&limit=10 \
-H "Authorization: Bearer gsk_live_a1b2c3..."

4. Crear un cliente

curl -X POST https://api.gestia.lat/api/v1/customers \
-H "Authorization: Bearer gsk_live_a1b2c3..." \
-H 'Content-Type: application/json' \
-d '{"name": "Carlos Gómez", "email": "carlos@ejemplo.com"}'

Nota: usa el token JWT (login) para acciones de usuario y la API Key para integraciones automatizadas con scopes limitados.