En esta página
Antes de ejecutar
Los comandos son ejemplos sintéticos. api.example.invalid no es un entorno de pruebas ni resuelve a un servicio real. Sustituya la base únicamente por la dirección confirmada para su entorno habilitado y mantenga la clave en el backend. Para explorar sin red ni credenciales, abra el simulador.
1. Cree una transacción
Elija una clave de idempotencia estable para el mismo intento de creación. El CPF siguiente es un valor ficticio de documentación.
# Server-side only. Configure KYC_API_BASE_URL with your authorized base (https://api.example.invalid is illustrative), and KYC_API_KEY privately. Never expose credentials in browser code.
set -eu
: "${KYC_API_BASE_URL:?Set authorized base}" "${KYC_API_KEY:?Set API key}"
: "${KYC_IDEMPOTENCY_KEY:?Persist the key for this creation intent}"
curl --fail-with-body --max-time 15 --request POST \
"${KYC_API_BASE_URL%/}/v1/face-auth/transactions" \
--header "X-API-Key: ${KYC_API_KEY}" \
--header "Idempotency-Key: ${KYC_IDEMPOTENCY_KEY}" \
--header 'Content-Type: application/json' \
--data-binary '{"country_code":"BR","external_id":"docs-example-0001","locale":"pt-BR","subject":{"identity":{"country":"BR","number":"00000000000","type":"CPF"}}}'
# Persist transaction_id and business correlation; use the returned links.webview_url. Read status, decision and decision_reason together. Reuse the SAME idempotency key AND original payload only for the same creation intent; never silently bypass a 409 conflict.
2. Derive al recorrido
El POST devuelve 201 y el identificador transaction_id. Guárdelo junto a su external_id. Derive a la persona mediante la URL alojada devuelta en links.webview_url; no construya enlaces a partir del identificador de la transacción.
3. Consulte el resultado
# Server-side only. Configure KYC_API_BASE_URL with your authorized base (https://api.example.invalid is illustrative), and KYC_API_KEY privately. Never expose credentials in browser code.
set -eu
: "${KYC_API_BASE_URL:?Set authorized base}" "${KYC_API_KEY:?Set API key}"
: "${KYC_TRANSACTION_ID:?Use the returned transaction_id}"
curl --fail-with-body --max-time 15 --request GET \
"${KYC_API_BASE_URL%/}/v1/face-auth/transactions/${KYC_TRANSACTION_ID}" \
--header "X-API-Key: ${KYC_API_KEY}"
# Persist transaction_id and business correlation; use the returned links.webview_url. Read status, decision and decision_reason together. Reuse the SAME idempotency key AND original payload only for the same creation intent; never silently bypass a 409 conflict.
Lea status, decision y decision_reason en conjunto. Una decisión pending todavía no permite concluir el flujo como aprobado. La consulta requiere una clave del mismo Tenant y entorno que la transacción.
Siguiente paso
Implemente webhooks con validación HMAC y conciliación. Antes de producción, cubra rechazo, vencimiento, revisión manual, duplicados y pérdida temporal de conexión.