使用双因素身份验证执行 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"
}
}
通过设备验证
除现有的 sms 和 email 验证方式外,还可以使用预先注册的设备验证交易。此时,需要从 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_id | string | 设备会话的唯一标识键(UUID v4 格式,设备 TFA 时必填)。 | 36 |
contact_type * | string | 与账户批准人的联系方式,可为 sms、email 或 device |
Enumerador account_type
| 枚举值 | 翻译 |
|---|---|
| checking_account | 活期账户 |
| deposit_account | 存款账户 |
| guaranteed_account | 担保账户 |
| investment_account | 投资账户 |
| payment_account | 付款账户 |
| saving_account | 储蓄账户 |
响应
STATUS
202Response 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
4xxResponse 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 |
|---|---|---|---|---|
| 400 | TED000079 | No approver permission | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400 | TED000080 | tfa_info is required | Client must send object tfa_info | Cliente deve enviar objeto tfa_info |
| 400 | TED000081 | Error occurred while sending token | An unexpected error occurred while sending token | Um erro inexperado ocorreu ao tentar enviar token |
| 400 | TED0000109 | Session ID needed | A session_id must be provided token | Uma session_id deve ser fornecida |