跳到主要内容

使用双因素身份验证执行 TED 转账

在此类交易中,需要通过发送给账户中具有批准转账权限的人员的令牌来确认付款。

配置为使用双因素身份验证的集成合作伙伴的 TED 交易请求方式与执行 TED 中描述的方式类似。区别在于添加了 tfa_info 对象,其中包含关于转账批准人和联系方式的信息,以及成功请求的状态将始终为 pending_2fa_approval

请求

ENDPOINT
/account/ACCOUNT_KEY/ted
方法
POST

通过电子邮件和短信验证

Request Body
{
"request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
"target_account": {
"account_branch": "0001",
"account_number": "92796",
"account_digit": "1",
"owner_document_number": "23599885000192",
"owner_name": "Titular da Conta",
"ispb": "12345678",
"account_type": "checking_account"
},
"transaction_amount": 8.86,
"tfa_info": {
"approver_document_number": "98765432100",
"contact_type": "email"
}
}

通过设备验证

除现有的 smsemail 验证方式外,还可以使用预先注册的设备验证交易。此时,需要从 Device Scan 获取 session_id 并在 tfa_info 中发送。

Request Body
{
"request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
"target_account": {
"account_branch": "0001",
"account_number": "92796",
"account_digit": "1",
"owner_document_number": "23599885000192",
"owner_name": "Titular da Conta",
"ispb": "12345678",
"account_type": "checking_account"
},
"transaction_amount": 8.86,
"tfa_info": {
"approver_document_number": "98765432100",
"session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
"contact_type": "device"
}
}

Body Params

字段类型描述字符数
request_control_key *string客户使用的 uuid v4 格式的请求唯一标识键。36
target_account *object目标账户Objeto target_account
transaction_amount *float转账金额10
tfa_info *object包含账户批准人文件号和联系方式的对象。Objeto tfa_info

Objeto target_account

字段类型描述字符数
account_branch *string银行代码(机构代码)。4
account_digit *string账户校验码1
account_number *string账户号码。20
owner_document_number *string账户持有人的 CPF 或 CNPJ(仅数字)。14
owner_name *string账户持有人姓名。50
account_type *string账户类型。Enumerador account_type
ispb *string基于金融机构 CNPJ(8 位数字)。8

Objeto tfa_info

字段类型描述字符数
approver_document_number *string账户批准人的文件号。11
session_idstring设备会话的唯一标识键(UUID v4 格式,设备 TFA 时必填)。36
contact_type *string与账户批准人的联系方式,可为 smsemaildevice

Enumerador account_type

枚举值翻译
checking_account活期账户
deposit_account存款账户
guaranteed_account担保账户
investment_account投资账户
payment_account付款账户
saving_account储蓄账户

响应

STATUS
202
Response Body
{
"request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
"ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
"created_at": "2021-10-22T20:30:23.459Z",
"ted_status": "pending_2fa_approval",
"transaction_amount": 126.97,
"fee_amount": 0.0
}
STATUS
4xx
Response Body: Error
{
"title": "titulo",
"description": "description in English",
"translation": "descrição em portugues",
"code": "codigo",
"extra_fields": {}
}
信息

此端点也可能返回执行 TED 中列出的错误,以及以下错误。

HTTP 状态码
status
QI 代码
code
标题
title
描述(英文)
description
描述(葡文)
translation
400TED000079No approver permissionGiven document number does not belong to an approver for this accountNúmero de documento enviado não pertence a um aprovador da conta
400TED000080tfa_info is requiredClient must send object tfa_infoCliente deve enviar objeto tfa_info
400TED000081Error occurred while sending tokenAn unexpected error occurred while sending tokenUm erro inexperado ocorreu ao tentar enviar token
400TED0000109Session ID neededA session_id must be provided tokenUma session_id deve ser fornecida