跳到主要内容

创建钱包(Wallet)

创建钱包(wallet)允许为个人或法人注册新的信用钱包。

什么是 Wallet

wallet 代表客户的账单,作为管理所有关联支付手段的集中器。重要须知:

  • 一个 wallet = 一张账单:每个钱包对应一个特定客户(由 CPF/CNPJ 标识)的账单
  • 多种支付手段:同一个 wallet 可以有不同的支付工具(卡片、PIX 等)
  • 独立的工具:创建 wallet 后,需要分别创建支付工具(信用卡、额度等)
  • 集中管理:wallet 集中管理与该客户相关的所有操作和配置

Request

ENDPOINT
/wallet
MÉTODO
POST
Request Body
{
"owner": {
"request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
"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"
}
},
"invoice_configuration": {
"closing_date_configuration": {
"type": "fixed",
"fixed_day": 15
},
"due_date_configuration": {
"type": "fixed",
"fixed_day": 20,
"offset_months": 0
},
"invoice_payment_type": "bank_slip",
"interest_base": "calendar_days",
"monthly_interest_percentage": 2.0,
"fine_percentage": 2.0
},
"limits": {
"postpaid_credit_limit": 5000.00
}
}

请求体参数

字段类型描述字符数
request_control_keyuuidv4客户使用的请求唯一识别密钥36
ownerobject钱包所有者数据(个人或法人)owner 对象
person_keystringUUID v4 格式的人员唯一识别密钥36
invoice_configuration *object账单结账和到期配置invoice_configuration 对象
limits *object钱包信用额度limits 对象
条件字段
  • owner:未发送 person_key 时为必填项
  • person_key:未发送 owner 时为必填项
  • 两个字段互斥

owner 对象

个人(person_type: "natural"

字段类型描述字符数
person_type *string人员类型(必须为 "natural")-
name *string姓名100
document_number *stringCPF(仅数字)11
birthdate *string出生日期(YYYY-MM-DD 格式)10
email *string联系邮箱254
phone *object联系电话phone 对象
address *object完整地址address 对象
字段类型描述字符数
person_type *string人员类型(必须为 "legal")-
name *string公司法定名称100
trading_name *string公司商业名称100
document_number *stringCNPJ(仅数字)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邮政编码(仅数字)8
city *string城市100
state *string州(UF)state 枚举值
complementstring地址补充信息500

state 枚举值

枚举值描述
ACAcre
ALAlagoas
AMAmazonas
APAmapá
BABahia
CECeará
DFDistrito Federal
ESEspírito Santo
GOGoiás
MAMaranhão
MGMinas Gerais
MSMato Grosso do Sul
MTMato Grosso
PAPará
PBParaíba
PEPernambuco
PIPiauí
PRParaná
RJRio de Janeiro
RNRio Grande do Norte
RORondônia
RRRoraima
RSRio Grande do Sul
SCSanta Catarina
SESergipe
SPSão Paulo
TOTocantins
EX例外

invoice_configuration 对象

字段类型描述字符数
closing_date_configuration *object账单结账日配置closing_date_configuration 对象
due_date_configuration *object账单到期日配置due_date_configuration 对象
invoice_payment_type *string账单支付类型invoice_payment_type 枚举值
interest_base *string利息计算基础interest_base 枚举值
monthly_interest_percentage *float逾期月利率(0-100)-
fine_percentage *float逾期罚款比例(0-100)-

closing_date_configuration 对象

固定配置(type: "fixed"

字段类型描述字符数
type *string配置类型(必须为 "fixed")-
fixed_day *integer每月固定结账日(1-27)-

基于规则的配置(type: "rule_based"

字段类型描述字符数
type *string配置类型(必须为 "rule_based")-
rule *object日期计算规则rule 对象(closing_date_configuration)

rule 对象(closing_date_configuration)

字段类型描述字符数
day_of_week *string星期几day_of_week 枚举值
occurrence *string当月第几次出现occurrence 枚举值
fallback_strategy *string非工作日策略fallback_strategy 枚举值

due_date_configuration 对象

固定配置(type: "fixed"

字段类型描述字符数
type *string配置类型(必须为 "fixed")-
offset_months *integer从结账日起的月份偏移量-
fixed_day *integer每月固定到期日(2-27)-

基于规则的配置(type: "rule_based"

字段类型描述字符数
type *string配置类型(必须为 "rule_based")-
offset_months *integer从结账日起的月份偏移量-
rule *object日期计算规则rule 对象(closing_date_configuration)

rule 对象(due_date_configuration)

字段类型描述字符数
day_of_week *string星期几day_of_week 枚举值
occurrence *string当月第几次出现occurrence 枚举值
fallback_strategy *string非工作日策略fallback_strategy 枚举值
日期验证
  • 到期日必须至少在结账日后 2 天
  • 对于基于规则的配置,结账和到期的星期几之间必须至少相差一天(例如:周一结账,周三到期)

day_of_week 枚举值

枚举值描述
monday星期一
tuesday星期二
wednesday星期三
thursday星期四
friday星期五
saturday星期六
sunday星期日

occurrence 枚举值

枚举值描述
first第一次出现
second第二次出现
third第三次出现
fourth第四次出现
last最后一次出现

fallback_strategy 枚举值

枚举值描述
next_business_day下一个工作日
previous_business_day上一个工作日
same_day当天

invoice_payment_type 枚举值

枚举值描述
bank_slip银行票据(Boleto bancário)

interest_base 枚举值

枚举值描述
calendar_days自然日

limits 对象

字段类型描述字符数
postpaid_credit_limit *float后付费信用额度-

Response

成功 - 钱包已创建,等待分析

STATUS
202
Response Body:等待分析的钱包
{
"wallet_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
"owner_person_key": null,
"wallet_status": "pending_analysis"
}
说明

若返回 HTTP Status 202wallet_status 字段值为 pending_analysis,则创建将异步处理。 之后将发送 webhook 通知钱包是否通过 KYC 分析审批或被拒绝。有关 webhook 的更多详情,请参阅 webhook 文档

说明

对于需要 KYC 分析的情况,owner_person_key 字段在初始响应中将返回为 null。钱包的持有人仅在 KYC 流程结束且获得批准后才会在系统中创建。此时,人员密钥将通过审批 webhook 发送,请参阅 webhook 文档

成功 - 钱包已创建并激活

STATUS
201
Response Body:已激活的钱包
{
"wallet_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
"owner_person_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
"wallet_status": "active"
}

响应体参数

字段类型描述字符数
wallet_key *uuidv4uuid v4 格式的钱包唯一识别密钥36
owner_person_key *string钱包所有者的识别密钥36
wallet_status *string钱包状态-

wallet_status 枚举值

枚举值描述
pending_analysis等待 KYC 分析的钱包
active已激活且可使用的钱包
rejected已拒绝的钱包
钱包状态
  • pending_analysis:当钱包以完整所有者数据创建时返回,将进行 KYC 分析。
  • active:当钱包以现有人员密钥创建时返回,可立即使用。

错误响应

STATUS
4xx
Response Body: Error
{
"title": "titulo",
"description": "description in English",
"translation": "descrição em portugues",
"code": "codigo",
"extra_fields": {}
}
HTTP 代码
status
QI 代码
code
标题
title
描述(英文)
description
描述(葡文)
translation
400QIT000001Bad RequestSchema ErrorSchema Inválido
404CIN000020Requester not FoundNo requester configuration found for requester key: 8e1e6b46-beb3-467b-965c-6c545707d467Solicitante não encontrado para requester key: 8e1e6b46-beb3-467b-965c-6c545707d467
404CIN000062Not FoundPerson not found by person key: e51070e4-7494-468d-a20e-bf14789fa8ffPessoa não encontrada para a person key: e51070e4-7494-468d-a20e-bf14789fa8ff
409CIN000043ConflictActive wallet foundCarteira ativa já existe
400CIN000063Bad RequestExpiration date too close to closing dateData de vencimento muito próxima da data de fechamento
400CIN000064Bad RequestInvalid offset months for rule-based configurationMeses de offset inválidos para configuração baseada em regras
400CIN000065Bad RequestWeekdays too close for rule-based configurationDias da semana muito próximos para configuração baseada em regras
400CIN000002Bad RequestInvalid signer document numberNúmero do documento do signatário inválido
400CIN000066Bad RequestError while creating wallet in card serviceErro ao criar carteira no serviço de cartão
409CIN000099ConflictRequest control key already exists.Request control key já existe.