Guía de integración
Autentícate, envía una petición y lee la respuesta
Los ejemplos usan cURL y valores de marcador. Sustitúyelos por las credenciales asignadas a tu empresa y por el cuerpo definido para cada operación.
1. Obtener un token
Solicita el client ID y el user token a soporte. El token generado tiene vigencia de 24 horas.
curl --request POST 'https://api.celestefacturacion.com/webhook/api/auth' \
--header 'Content-Type: application/json' \
--data '{
"client-id": "<CLIENT_ID>",
"nit": "<NIT>",
"user-token": "<USER_TOKEN>"
}'
2. Registrar una factura
Envía el cuerpo completo del documento. Guarda el UUID de proceso que devuelve Celeste.
curl --request POST 'https://api.celestefacturacion.com/webhook/api/factura_venta' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'X-Celeste-Nit: <NIT>' \
--header 'X-Celeste-Client-Id: <CLIENT_ID>' \
--header 'Content-Type: application/json' \
--data-binary @factura.json
3. Consultar el estado
Consulta el proceso después usando el UUID devuelto y la fecha de generación en formato yyyymmdd.
curl --get 'https://api.celestefacturacion.com/webhook/api/factura_venta' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'X-Celeste-Nit: <NIT>' \
--header 'X-Celeste-Client-Id: <CLIENT_ID>' \
--data-urlencode 'uuid=<UUID_DEL_PROCESO>' \
--data-urlencode 'date=<AAAAMMDD>'
Registrar un pedido
Los pedidos se registran directamente y devuelven su respuesta; no requieren una consulta posterior de estado electrónico.
curl --request POST 'https://api.celestefacturacion.com/webhook/api/pedido_venta' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'X-Celeste-Nit: <NIT>' \
--header 'X-Celeste-Client-Id: <CLIENT_ID>' \
--header 'Content-Type: application/json' \
--data-binary @pedido.json