Archivos del contrato público
Importe los archivos y configure únicamente en su entorno privado la URL oficial y la clave habilitada. No publique workspaces con secretos. Los ejemplos usan datos ficticios; los timeouts son decisiones demostrativas del cliente, no un SLA.
Ejemplos HTTP en el backend
# 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.
Estos fragmentos muestran la creación básica; no son SDKs oficiales ni consumidores completos. Añada validación de configuración, persistencia, tratamiento de errores y reintentos idempotentes según su aplicación. Una nueva intención de creación requiere otra clave; un reintento técnico conserva la anterior y el mismo payload.
Para cURL, consulte el inicio rápido. Para su receptor de eventos, siga validación HMAC y conciliación. El simulador demuestra escenarios fijos sin acceder a la API real.