钱包扣款
从一个钱包账户扣除一定指定货币的金额
HTTP请求
POST
/v1/accounts/wallet/charge
Request Headers{
"Content-Type": "application/json",
"Authorization": "Bearer {{access_token}}",
"x-api-key": "您分配的api密钥"
}
Request Body{
"walletAccountId": "cde5843c-bbd0-46d2-9fbb-27b08f3ad021",
"amountInCents": 100,
"currency": "COP",
"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": "422",
"errorMessage": "The account has insufficient fund for this charge."
}
]
}
Key |
Value |
Content-Type |
application/json |
Authorization |
Bearer {{access_token}} |
x-api-key |
您分配的api密钥 |
Request Body 字段说明
参数 |
是否必填 |
类型 |
描述 |
walletAccountId |
|
String |
希望扣款的钱包账户的UUID。 |
amountInCents |
|
Int |
扣款金额,单位为分。 |
currency |
|
String |
用于结算的货币代码 (ISO 4217), 如哥伦比亚的为COP。 |
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 |
错误信息。 |