Querying Summary Bills
Function
This API can be used to query the expenditure summary bills of a customer on the self-built platform. The bills summarize the summary data by month.
Postpaid customers who have enabled the monthly settlement can log in to Billing Center to query their expenditure summary bills by referring to here.
You can query data from the past three years.
Constraints
- This API can be invoked using the customer AK/SK or token only.
- If cloud_service_type_code is not specified in the request, the obtained bill is the monthly expenditure bill generated by cloud service type. That is, the total number of records (total_count) is calculated by cloud service type. Each record contains the expenditure summary of a cloud service type. In this case, resource_type_code in the response is null.
- If cloud_service_type_code is specified in the request, the obtained bill is the monthly expenditure bill generated by resource type for a cloud service. That is, the total number of records (total_count) is calculated by resource type. Each record contains the expenditure summary of a resource type for the cloud service. In this case, resource_type_code in the response is the resource type.
URI
GET /v1.0/{domain_id}/customer/account-mgr/bill/monthly-sum
The following table describes the parameters.
Parameter |
Mandatory |
Maximum Length |
Description |
---|---|---|---|
domain_id |
Yes |
64 |
Customer account ID. |
Parameter |
Mandatory |
Type |
Maximum Length |
Description |
---|---|---|---|---|
cycle |
Yes |
String |
10 |
Billing cycle of the expenditure summary bill, which is in YYYY-MM format (GMT+08:00). |
cloud_service_type_code |
No |
String |
256 |
Cloud service type code. For example, the cloud service type code of OBS is hws.service.type.obs. To obtain a specific service type, call the API in Querying Cloud Service Types.
|
type |
No |
String |
[0|1] |
If this parameter is not specified, the expenditure summary of the HUAWEI CLOUD account is queried by default. This parameter cannot be left empty or set to "" or null. |
enterpriseProjectId |
No |
String |
- |
Enterprise project ID.
If this parameter is not included or is left empty, it cannot be used as a filter criterion. If this parameter is set to null, it cannot be used as a filter criterion. This parameter cannot be set to "". |
Request Message
Request Parameters
None
Example Request
GET https://bss.myhuaweicloud.eu/v1.0/{domain_id}/customer/account-mgr/bill/monthly-sum?cycle=2018-05&type=0 HTTP/1.1 Content-Type: application/json X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
Response Message
Response Parameters
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Status code. For details, see Status Code. This parameter is returned only when a failure occurs. |
error_msg |
String |
Error description. This parameter is returned only when a failure occurs. |
currency |
String |
Currency. USD If the parameter is left blank, USD is used. |
total_count |
Integer |
Number of the total records. The value must be greater than or equal to 0. |
bill_sums |
List<BillSumRecordInfo> |
Record information. For details, see Table 3. |
total_amount |
Bigdecimal |
Total amount (tax included). |
debt_amount |
Bigdecimal |
Total debt. |
coupon_amount |
Bigdecimal |
Cash coupon amount. |
cashcoupon_amount |
Bigdecimal |
Flexi-purchase coupon amount (reserved). |
storedcard_amount |
Bigdecimal |
Stored-value card amount (reserved). |
debit_amount |
Bigdecimal |
Balance in the cash account. |
credit_amount |
Bigdecimal |
Balance in the credit account. |
measure_id |
Integer |
Unit.
|
Parameter |
Type |
Description |
---|---|---|
customer_id |
String |
Customer account ID. |
resource_type_code |
String |
Resource type code. For example, the resource type code of ECS is hws.resource.type.vm.
NOTE:
If the request does not contain the cloud_service_type_code parameter, the value null is returned. |
region_code |
String |
Cloud service region. This parameter is reserved. |
cloud_service_type_code |
String |
Cloud service type code. For example, the cloud service type code of OBS is hws.service.type.obs. |
consume_time |
String |
Expenditure data collection period. GMT+08:00 and format: YYYY-MM Example: 2018-05 |
pay_method |
String |
Expenditure type.
|
consume_amount |
Bigdecimal |
Consumption amount, that is, the amount deducted from the customer's account. It includes the amount paid using cash coupons. |
debt |
Bigdecimal |
Outstanding amount, that is, the amount due generated when fees are deducted from the customer account and the account balance is insufficient. |
discount |
Bigdecimal |
Discounted amount. |
measure_id |
Integer |
Unit.
|
bill_type |
Integer |
Bill type.
|
account_details |
List<BalanceTypePay> |
Total payment amount distinguished by expenditure type and payment method of an account. For details, see Table 4. |
discount_detail_infos |
List<DiscountDetailInfo> |
Discounted amount details. For details, see Table 5. This parameter is not returned when bill_type is 1. |
enterpriseProjectId |
String |
Enterprise project ID.
If enterpriseProjectId is specified in the request, the bill_sums value in the response is the records by enterprise project ID. |
Parameter |
Type |
Description |
---|---|---|
balance_type_id |
String |
Account type.
|
deduct_amount |
Bigdecimal |
Deducted amount. Unit. |
Parameter |
Type |
Description |
---|---|---|
promotion_type |
String |
Discount type. 500: Specified discount for agent subscription 501: Specified exemption for agent subscription 502: Specified buy-it-now price for agent subscription 600: Contract discount rebate (commercial discount) 601: Discount specified in the channel frame contract 602: Discount specified in the designated-purpose fund contract (special commercial contract discount) 603: Discount specified in the directly signed offline contract 604: Discount specified in the authorized telemarketing contract 605: Discount specified in the commercial contract 606: Discount specified in the channel commercial contract 607: Partner authorized discount 608: Featured product discount 610: Discount amount 700: Promotion discount (for promotion, available only in yearly/monthly billing scenarios) 800: Bonus |
discount_amount |
BigDecimal |
Discounted amount. |
promotion_id |
String |
Discount type ID. It can be a contract ID or a commerce ID. |
measure_id |
Integer |
Unit.
The default value is 3. |
Example Response
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: length Date: response time { "error_code": "CBC.0000", "error_msg": "success", "currency": "USD", "total_count": 1, "total_amount": 10212, "debt_amount": 56, "coupon_amount": 0, "cashcoupon_amount": 0, "storedcard_amount": 0, "debit_amount": 10156, "credit_amount": 0, "measure_id": 3, "bill_sums": [ { "customer_id": "7b47a4c7ec764e1a94c5c2eb1a578e77", "resource_type_code": "", "region_code": null, "cloud_service_type_code": "hws.service.type.ebs", "consume_time": "2019-12", "pay_method": "", "consume_amount": 10212, "debt": 56, "discount": 0, "measure_id": 3, "bill_type": 0, "account_details": [ { "balance_type_id": "BALANCE_TYPE_DEBIT", "deduct_amount": 10156 }, { "balance_type_id": "BALANCE_TYPE_CREDIT", "deduct_amount": 0 }, { "balance_type_id": "BALANCE_TYPE_BONUS", "deduct_amount": 0 }, { "balance_type_id": "BALANCE_TYPE_COUPON", "deduct_amount": 0 }, { "balance_type_id": "BALANCE_TYPE_DEBIT_RATE", "deduct_amount": 0 }, { "balance_type_id": "BALANCE_TYPE_FOREGIFT", "deduct_amount": 0 }, { "balance_type_id": "BALANCE_TYPE_BE_AVAILABLE", "deduct_amount": 0 }, { "balance_type_id": "BALANCE_TYPE_OTHER", "deduct_amount": 0 }, { "balance_type_id": "BALANCE_TYPE_RCASH_COUPON", "deduct_amount": 0 }, { "balance_type_id": "WRITEOFFDEBT", "deduct_amount": 0 }, { "balance_type_id": "BALANCE_TYPE_STORED_VALUE_CARD", "deduct_amount": 0 } ], "discount_detail_infos": [], "enterpriseProjectId": "0" } ] }
Status Code
- 4xx: This class of HTTP status code is intended for situations in which the error seems to have been caused by the client, for example, the request contains 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 |
Description |
---|---|
CBC.0000 |
Success. |
CBC.0999 |
Other errors. |
CBC.0151 |
Access denied. |
CBC.0100 |
Parameter error. |
CBC.0154 |
Token authentication failed. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.