创建电子钱包
创建一个电子钱包,钱包创建处理是同步执行的,接口将返回钱包的相关信息。
HTTP请求
POST
/v1/accounts/wallet
Request Headers{
"Content-Type": "application/json",
"Authorization": "Bearer {{access_token}}",
"x-api-key": "您分配的api密钥"
}
Request Body{
"phoneNumber": "+855044946043",
"name": "Test one",
"country": "CO",
"currency": "COP",
"groupId": "0001",
"idempotencyKey": "65e85d27-1677-4a98-9f6e-dd03cfa07ea3"
}
Content-Type: application/json{
"id": "cde5843c-bbd0-46d2-9fbb-27b08f3ad021",
"balanceInCents": 0,
"status":"ACTIVE",
"groupId": "0001",
"country": "CO",
"currency": "COP"
}
Content-Type: application/json{
"errors": [
{
"code": "400",
"errorMessage": "Invalid request field: phoneNumber: Invalid Phone Number"
}
]
}
Key |
Value |
Content-Type |
application/json |
Authorization |
Bearer {{access_token}} |
x-api-key |
您分配的api密钥 |
Request Body 字段说明
参数 |
是否必填 |
类型 |
描述 |
phoneNumber |
|
String |
钱包持有人的手机号码,包含国家代码和地区代码。格式如下: “+” + “国家代码” + “地区代码” + “手机号码”,长度少于等于20个字节。 |
name |
|
String |
钱包持有人的全名。 |
country |
|
String |
钱包持有人的国家代码,如哥伦比亚的为CO。 |
currency |
|
String |
钱包持有人使用货币代码(ISO 4217)。 |
groupId |
|
String |
钱包持有人归属的组id或者组名,长度少于等于64个字节。 |
idempotencyKey |
|
String |
由商户决定的唯一字符串,以防止请求重复。 |
Response Body 字段说明
参数 |
类型 |
描述 |
id |
String |
钱包账户的UUID。 |
balanceInCents |
Int |
钱包账户的余额,单位为分。 |
status |
String |
钱包账户的状态,枚举:"ACTIVE"。 |
groupId |
String |
钱包持有人归属的组id或者组名。 |
country |
String |
钱包账户的国家代码。 |
currency |
String |
钱包账户的结算货币代码。 |
请求失败的回复
Parameter |
Type |
Description |
code |
String |
表明具体错误类型的错误代码。 |
errorMessage |
String |
错误信息。 |