创建支付工具
创建支付工具允许为现有钱包注册新的支付方式(如后付费卡)。
Request
ENDPOINT
/wallet/WALLET_KEY/payment_instrumentMÉTODO
POST路径参数
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
wallet_key | uuidv4 | UUID v4 格式的钱包唯一密钥 | 36 |
Request Body
{
"request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
"owner": {
"person_type": "natural",
"name": "João Silva",
"document_number": "12345678901",
"birthdate": "1990-01-01",
"email": "joao.silva@email.com",
"phone": {
"number": "99999999",
"area_code": "11",
"country_code": "55"
},
"address": {
"street": "Rua das Flores",
"number": "123",
"neighborhood": "Centro",
"postal_code": "01234567",
"city": "São Paulo",
"state": "SP",
"complement": "Apto 1"
}
},
"payment_instrument_type": "postpaid_card",
"limit_amount": 2000.00,
"postpaid_card_data": {
"card_type": "physical",
"card_name": "Cartão Principal",
"printed_name": "JOAO SILVA",
"cvv_rotation_interval_hours": 24,
"contactless_enabled": true,
"delivery_address": {
"street": "Rua das Flores",
"number": "123",
"neighborhood": "Centro",
"postal_code": "01234567",
"city": "São Paulo",
"state": "SP",
"complement": "Apto 1"
}
}
}
请求体参数
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
request_control_key | uuidv4 | 客户端使用的请求唯一识别密钥 | 36 |
owner | object | 工具所有人信息(个人或法人) | owner 对象 |
person_key | string | UUID v4 格式的人员唯一识别密钥 | 36 |
payment_instrument_type * | string | 支付工具类型 | payment_instrument_type 枚举值 |
limit_amount | float | 工具信用额度(必须小于或等于钱包额度) | - |
postpaid_card_data | object | 后付费卡的特定数据 | postpaid_card_data 对象 |
条件字段
owner:未发送person_key时为必填person_key:未发送owner时为必填postpaid_card_data:payment_instrument_type为 "postpaid_card" 时为必填owner和person_key字段互斥
额度验证
limit_amount非必填- 填写时不得超过钱包的后付费信用额度
- 未填写时,工具将使用钱包的全部额度
owner 对象
个人(person_type: "natural")
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
person_type * | string | 人员类型(必须为 "natural") | - |
name * | string | 姓名全称 | 100 |
document_number * | string | CPF(仅数字) | 11 |
birthdate * | string | 出生日期(YYYY-MM-DD 格式) | 10 |
email * | string | 联系邮箱 | 254 |
phone * | object | 联系电话 | phone 对象 |
address * | object | 完整地址 | address 对象 |
法人(person_type: "legal")
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
person_type * | string | 人员类型(必须为 "legal") | - |
name * | string | 公司法定名称 | 100 |
trading_name * | string | 公司商号 | 100 |
document_number * | string | CNPJ(仅数字) | 14 |
foundation_date * | string | 成立日期(YYYY-MM-DD 格式) | 10 |
email * | string | 联系邮箱 | 254 |
phone * | object | 联系电话 | phone 对象 |
address * | object | 完整地址 | address 对象 |
legal_representatives * | array | 法定代表人列表( 自然人) | - |
phone 对象
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
country_code * | string | 国家代码(DDI) | 2-3 |
area_code * | string | 区号(DDD) | 2 |
number * | string | 电话号码 | 8-9 |
address 对象
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
street * | string | 街道/大道名称 | 500 |
number * | string | 门牌号 | 10 |
neighborhood * | string | 社区/街区 | 100 |
postal_code * | string | CEP(仅数字) | 8 |
city * | string | 城市 | 100 |
state * | string | 州(UF) | state 枚举值 |
complement | string | 地址补充说明 | 500 |
state 枚举值
| 枚举值 | 描述 |
|---|---|
| AC | Acre |
| AL | Alagoas |
| AM | Amazonas |
| AP | Amapá |
| BA | Bahia |
| CE | Ceará |
| DF | Distrito Federal |
| ES | Espírito Santo |
| GO | Goiás |
| MA | Maranhão |
| MG | Minas Gerais |
| MS | Mato Grosso do Sul |
| MT | Mato Grosso |
| PA | Pará |
| PB | Paraíba |
| PE | Pernambuco |
| PI | Piauí |
| PR | Paraná |
| RJ | Rio de Janeiro |
| RN | Rio Grande do Norte |
| RO | Rondônia |
| RR | Roraima |
| RS | Rio Grande do Sul |
| SC | Santa Catarina |
| SE | Sergipe |
| SP | São Paulo |
| TO | Tocantins |
| EX | 特殊情况 |
payment_instrument_type 枚举值
| 枚举值 | 描述 |
|---|---|
| postpaid_card | 后付费卡 |
postpaid_card_data 对象
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
card_type * | string | 卡 片类型 | card_type 枚举值 |
card_name * | string | 卡片名称 | 1-50 |
printed_name * | string | 卡片印刷名称 | 2-26 |
cvv_rotation_interval_hours | int | CVV 轮换间隔(小时) | - |
contactless_enabled | boolean | 启用非接触式支付 | - |
delivery_address | object | 卡片配送地址 | delivery_address 对象 |
card_type 枚举值
| 枚举值 | 描述 |
|---|---|
| virtual | 虚拟卡 |
| plastic | 实体卡 |
条件字段
cvv_rotation_interval_hours:card_type: "virtual"时为必填,card_type: "plastic"时不允许。delivery_address:card_type: "virtual"时不允许;card_type: "plastic"时为可选,若未填写,将使用owner的地址或已为person_key注册的地址。contactless_enabled:card_type: "virtual"时不允许,card_type: "plastic"时为必填。
delivery_address 对象
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
street * | string | 街道/大道名称 | 500 |
number * | string | 门牌号 | 10 |
neighborhood * | string | 社区/街区 | 100 |
postal_code * | string | CEP(仅数字) | 8 |
city * | string | 城市 | 100 |
state * | string | 州(UF) | state 枚举值 |
complement | string | 地址补充说明 | 500 |
Response
成功 - 工具已创建
STATUS
201Response Body:已创建工具
{
"request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
"payment_instrument_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
"postpaid_card_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
"owner_person_key": "f2cad6b4-2a68-9572-99a7-2849c8d6ecf8"
}
响应体参数
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
request_control_key | uuidv4 | 客户端使用的请求唯一识别密钥 | 36 |
payment_instrument_key * | uuidv4 | uuid v4 格式的工具唯一识别密钥 | 36 |
postpaid_card_key * | uuidv4 | uuid v4 格式的后付费卡唯一识别密钥 | 36 |
owner_person_key * | uuidv4 | uuid v4 格式的所有人唯一识别密钥 | 36 |
错误响应
STATUS
4xxResponse Body: Error
{
"title": "titulo",
"description": "description in English",
"translation": "descrição em portugues",
"code": "codigo",
"extra_fields": {}
}
HTTP 代码status | QI 代码code | 标题title | 描述(英文)description | 描述(葡文)translation |
|---|---|---|---|---|
| 400 | QIT000001 | Bad Request | Schema Error | Schema Inválido |
| 404 | CIN000062 | Not Found | Person not found by person key: e51070e4-7494-468d-a20e-bf14789fa8ff | Pessoa não encontrada para a person key: e51070e4-7494-468d-a20e-bf14789fa8ff |
| 404 | CIN000007 | Wallet not Found | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado |
| 400 | CIN000073 | Bad Request | Limit amount is greater than postpaid credit limit of the wallet | Limite é maior que o limite de crédito pós-pago da carteira |
| 400 | CIN000074 | Bad Request | Limit amount is greater than ccb limit of the wallet | Limite é maior que o limite de ccb da carteira |
| 400 | CIN000072 | Bad Request | Error while creating postpaid card in card service, try again in a few minutes | Erro ao criar postpaid card no serviço de cartão, tente novamente em alguns minutos |
| 400 | CIN000067 | Bad Request | Error while creating owner of the wallet. Try again in a few minutes | Erro ao criar owner da carteira. Tente novamente em alguns minutos |
| 409 | CIN000099 | Conflict | Request control key already exists. | Request control key já existe. |