更新时间:2024-01-15 GMT+08:00
分享

查询账户余额

功能介绍

客户可以查询自身的账户余额。

客户可以登录费用中心进入“总览”页面,在“可用额度”区域可以查询自身的账户余额。

接口约束

客户查询自身的账户余额的时候,只允许使用客户自身的AK/SK或者Token调用。

调试

您可以在API Explorer中调试该接口。

URI

GET /v2/accounts/customer-accounts/balances

请求消息

请求参数

无。

请求示例

GET https://bss.myhuaweicloud.com/v2/accounts/customer-accounts/balances HTTP/1.1
Content-Type: application/json
X-Auth-TokenMIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

响应消息

响应参数

参数

参数类型

取值范围

描述

error_code

String

最大长度:20

状态码。具体请参见状态码

只有失败才会返回这个参数。

error_msg

String

最大长度:2000

错误描述信息。

只有失败才会返回这个参数。

account_balances

List<AccountBalanceV2>

-

账户余额列表。

具体请参见表1

debt_amount

BigDecimal

-

欠款总金额。

measure_id

Integer

-

金额的度量单位。

  • 1:元

currency

String

最大长度:4

币种。

CNY:人民币。

表1 AccountBalanceV2

参数

参数类型

取值范围

描述

account_id

String

最大长度:64

账户标识。

account_type

Integer

-

账户类型。

  • 1:余额
  • 2:信用
  • 5:奖励金
  • 7:保证金

amount

Bigdecimal

-

账户余额。

currency

String

-

币种。

CNY:人民币。

designated_amount

Bigdecimal

-

专款专用余额。

credit_amount

Bigdecimal

-

总信用额度,仅信用账户存在该字段。

measure_id

Integer

-

度量单位。

  • 1:元

响应示例

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time  
{
    "account_balances": [
        {
            "account_id": "AT001017264D6E9FF7",
            "account_type": 1,
            "amount": 0,
            "currency": "CNY",
            "designated_amount": 0,
            "credit_amount": 0,
            "measure_id": 1
        },
        {
            "account_id": "AT001017264D6EA084",
            "account_type": 5,
            "amount": 0,
            "currency": "CNY",
            "designated_amount": 0,
            "credit_amount": 0,
            "measure_id": 1
        }
    ],
    "debt_amount": 120.0,
    "measure_id": 1,
    "currency": "CNY"
}

状态码

  • 状态码4xx:由于明显的客户端错误(例如,格式错误的请求语法、参数错误等),华为云会返回4xx错误码,请及时检查请求消息的正确性,重新发起请求。
  • 状态码5xx:由于华为云系统原因,导致无法完成明显有效请求的处理,可及时联系华为云客服处理。

HTTP状态码

错误码

描述

400

CBC.0100

参数错误。

400

CBC.99000049

转售子客户无账户余额。

403

CBC.0151

访问拒绝。

500

CBC.0999

其他错误。

分享:

    相关文档

    相关产品