Validar desafio 3DS
POST
/api/v1/bank/public/charge/authentication/{uuid}/validateEndpoint público
Este endpoint é chamado após o pagador completar o desafio 3DS no iframe do emissor. O SDK ou seu handler de redirecionamento chama este endpoint para finalizar a autenticação e prosseguir com o pagamento.
Cabeçalhos da requisição
| Cabeçalho | Valor | Obrigatório |
|---|---|---|
Content-Type | application/json | Sim |
Parâmetros de caminho
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
uuid | string (UUID) | Sim | UUID da cobrança que iniciou a autenticação 3DS |
Corpo da requisição
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
transaction_id | string | Sim | ID da transação 3DS da resposta do desafio |
Campos da resposta
| Campo | Tipo | Descrição |
|---|---|---|
charge_uuid | string | Identificador da cobrança |
authentication_status | string | authenticated, failed, attempted |
eci | string | Electronic Commerce Indicator (ex.: 05, 06, 07) |
cavv | string | Cardholder Authentication Verification Value |
status | string | Status da cobrança após autenticação (confirmed, error) |
message | array/null | Detalhes do erro quando a autenticação falha |
Códigos de status HTTP
| Status | Descrição |
|---|---|
| 200 | Validação processada |
| 400 | transaction_id inválido ou campos obrigatórios ausentes |
| 404 | Cobrança não encontrada ou sem autenticação pendente |
| 409 | Autenticação já validada |
| 422 | Sessão de autenticação expirada |
| 429 | Limite de requisições excedido |
| 500 | Erro interno do servidor |
Exemplos de código
- cURL
- Python
- Node.js
curl -s -X POST "https://core-manager.a55.tech/api/v1/bank/public/charge/authentication/a1b2c3d4-e5f6-7890-abcd-ef1234567890/validate" \
-H "Content-Type: application/json" \
-d '{"transaction_id": "d4e5f6a7-b8c9-0123-defg-h45678901234"}'
import requests
charge_uuid = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
try:
response = requests.post(
f"https://core-manager.a55.tech/api/v1/bank/public/charge/authentication/{charge_uuid}/validate",
json={"transaction_id": "d4e5f6a7-b8c9-0123-defg-h45678901234"},
headers={"Content-Type": "application/json"},
)
response.raise_for_status()
result = response.json()
print(f"Auth status: {result['authentication_status']} — ECI: {result['eci']}")
print(f"Charge status: {result['status']}")
except requests.exceptions.HTTPError as e:
print(f"HTTP {e.response.status_code}: {e.response.json()}")
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
const chargeUuid = "a1b2c3d4-e5f6-7890-abcd-ef1234567890";
try {
const response = await fetch(
`https://core-manager.a55.tech/api/v1/bank/public/charge/authentication/${chargeUuid}/validate`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
transaction_id: "d4e5f6a7-b8c9-0123-defg-h45678901234",
}),
}
);
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
console.log(`Auth status: ${result.authentication_status} — ECI: ${result.eci}`);
console.log(`Charge status: ${result.status}`);
} catch (error) {
console.error("3DS validation failed:", error.message);
}
Exemplo de resposta de erro
{
"charge_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"authentication_status": "failed",
"status": "error",
"message": [
{
"code": "AUTHENTICATION_FAILED",
"source": "3ds",
"description": "Issuer rejected the 3DS challenge. Payer may retry or use a different card."
}
]
}