Help Center/ Partner Center/ API Reference/ Managing Credits/ Querying Consumption Quota
Updated on 2024-11-26 GMT+08:00

Querying Consumption Quota

Function

Partners can use this API to query consumption quotas.

Constraints

This API can only be invoked with the AK/SK credentials or tokens of cloud solution providers or distributors.

URI

GET /v2/partners/credit/consumption-quota

Example request
GET https://bss.myhuaweicloud.eu/v2/partners/credit/consumption-quota HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

Response

Response parameters

Parameter

Parameter Type

Value Length Limit

Description

error_code

String

20

Error code. For details, see Status Code. This parameter is returned only when the query fails.

error_msg

String

1,000

Error description. This parameter is returned only when the query fails.

consumption_quota

String

64

Consumption quota.

amount

String

64

Account balance.

coupon_amount

String

64

Cash coupon balance.

due_amount

String

64

Amount due.

unbilled_amount

String

64

Estimated expenditure amount (unbilled).

used_consumption_quota

String

64

Used consumption quota.

used_consumption_quota = due_amount + unbilled_amount - amount - coupon_amount

NOTE:

If the account balance or cash coupon balance is greater than the expenditure amount, a negative value will be returned for the used expenditure quota, indicating that the expenditure quota is not used.

currency

String

20

Currency type.

USD: US dollar

measure_id

Integer

4

Measurement unit ID.

1: USD

Example Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time 
{  
    "consumption_quota": "10000",
    "amount": "10.18",
    "coupon_amount": "10.03",
    "due_amount": "500.28",
    "unbilled_amount": "100.01",
    "used_consumption_quota": "580.08",
    "measure_id": 1,
    "currency": "USD"
}

Status Code

  • 4xx: Indicates errors caused by the client side, for example, a request containing bad syntax or incorrect parameters. You must ensure the request is correct.
  • 5xx: This class of HTTP status code is intended for cases in which the Huawei Cloud server is aware that it has encountered an error or is otherwise incapable of performing the request. In this case, contact Huawei Cloud customer service.

Status Code

Error Code

Description

400

CBC.0100

Invalid parameter.

403

CBC.0151

Access denied.

500

CBC.0999

Other errors.