Resource Month Bill
GetResourceMonthBill API
API description
Retrieve details of resource month bills in pages.
[The root account in Enterprise Organizational Financial Management](Reference/Enterprise Organization/Financial Management.md) can query sub-account bill details.
Sub-accounts added to the financial group will have all amount fields masked except for coupon amounts. To initiate this request, IAM users must have administrator privileges for [Identity and Access Management](Reference/Enterprise Organization/Enterprise Organization vs. Identity and Access Management.md) or FCFullControlPolicy identity and access management policy management permissions.
Default API request frequency limit: 20 times/second.
Permission description
The request initiator needs to have legal AccessKeyID and SecretAccessKey to initiate the request. Please refer to [Authentication](Reference/Authentication mechanism/Introduction.md).
Note
If the request lacks user authentication (i.e., anonymous access), it returns 403 Forbidden with the error message: AccessDenied.
Request structure and example
1 GET /v{version}/bill/resource/month?month={month}&productType={productType}&serviceType={serviceType}&queryAccountId={queryAccountId}&pageNo={pageNo}&pageSize={pageSize} HTTP/1.1
2 Host: billing.baidubce.com
3 ContentType: application/json
4 Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Name | Types | Parameter location | Description | Required or not |
|---|---|---|---|---|
| month | String | Query | Month for which to query bills, in yyyy-MM format, e.g.: 2019-02 | Optional |
| beginTime | String | Query | Earliest date for daily bill query range, in yyyy-MM-dd format, e.g.: 2019-02-01 | Optional |
| endTime | String | Query | Latest date for daily bill query range, in yyyy-MM-dd format, e.g.: 2019-02-18. If the parameters for daily query are not empty, the results of the daily query will be returned with priority; the time range for daily query does not support spanning months; daily query allows you to check bills of the current month that are before today. To query the bill of the previous day, please do so after 10:00 on the current day to ensure that the data has been accurately processed. | Optional |
| productType | String | Query | Bill type: Prepay/postpay | Required |
| serviceType | String | Query | Product type, e.g.: BCC, BOS, etc. | Optional |
| queryAccountId | String | Query | Account ID for query: Only the root account of an enterprise organization can query the bills of sub-accounts added to the financial group; other query scenarios will prompt “AccessDenied” | Optional |
| pageNo | int | Query | Page number for paginated query, default is 1 | Optional |
| pageSize | int | Query | Maximum number of items included per page, maximum: 100, default: 20. | Optional |
Note: Upon a single request, return the information of 100 bills at most.
Response headers
There are no special headers required beyond the common headers.
Response parameters
| Name | Types | Description |
|---|---|---|
| billMonth | String | Month for which to query bills, in yyyy-MM format, e.g.: 2019-02 |
| beginTime | String | Earliest date for daily bill query range, in yyyy-MM-dd format, e.g.: 2019-02-01 |
| endTime | String | Latest date for daily bill query range, in yyyy-MM-dd format, e.g.: 2019-02-18 |
| accountId | String | When the current account is not a financial group sub-account, returns the current account’s accountId; when it is a financial group sub-account, returns the accountId of the current account’s root account |
| loginName | String | When the current account is not a financial group sub-account, returns the current account’s login name; when it is a financial group sub-account, returns the login name of the current account’s root account |
| subAccountId | String | When the current account is not a financial group sub-account, returns "/"; when it is a financial group sub-account, returns the current account’s accountId |
| subLoginName | String | When the current account is not a financial group sub-account, returns "/"; when it is a financial group sub-account, returns the current account’s login name |
| ouName | String | When the current account is not a financial group sub-account, returns "/"; when it is a financial group sub-account, returns the unit name of the organization unit where the current account resides |
| pageNo | Integer | Paginated query number |
| pageSize | Integer | Paginated query page size |
| totalCount | Integer | Total number of items under current query conditions |
| bills | List< [ResourceMonthInstanceBill](Finance/API Reference/Bill Related Interfaces/Appendix.md#ResourceMonthInstanceBill) > | Resource monthly bill list |
Response example
1 HTTP/1.1 200 OK
2 x-bce-request-id: d4591fcf-025b-46bc-81eb-91ddda4e27bc
3 Server: BWS
4 Date: Tue, 09 Apr 2019 11:01:10 GMT
5 Content-Type: application/json;charset=UTF-8
6 {
7 "billMonth":"2019-02",
8 "beginTime":"2019-02-01",
9 "endTime":"2019-02-18",
10 "accountId":"xxx",
11 "loginName":"xxx",
12 "subAccountId":"/",
13 "subLoginName":"/",
14 "ouName":"/",
15 "pageNo":1,
16 "pageSize":20,
17 "totalCount":1,
18 "bills":[
19 {
20 "vendor": "Baidu AI Cloud",
21 "accountId":"xxx",
22 "serviceType":"SCS",
23 "serviceTypeName": "Simple Cache Service",
24 "productType":"postpay",
25 "region":"bj",
26 "instanceId":"30749",
27 "orderId":"/",
28 "orderType":"/",
29 "orderTypeDesc":"/",
30 "orderPurchaseTime":"2018-01-07T07:10:24.000Z",
31 "startTime":"2019-01-31T16:00:00.000Z",
32 "endTime":"2019-02-28T15:59:59.000Z",
33 "configurationCH": "Capacity: 1 G",
34 "tag":"tag:value",
35 "duration":"/",
36 "chargeItem":"RunningTimeMinutes",
37 "chargeItemDesc": "Running Time",
38 "amount":"35909",
39 "amountUnit": "Minute",
40 "discountAmount":"",
41 "unitPrice": "RMB 0.003333/minute",
42 "pricingUnit": "Minute",
43 "discountUnit":"100.00",
44 "tex":6,
45 "catalogPrice":119.68,
46 "originPrice":119.68,
47 "financePrice":119.68,
48 "cash":119.68,
49 "rebate":0,
50 "creditCost":0,
51 "creditRefund":0,
52 "debt":0,
53 "noPaidPrice":0,
54 "couponPrice":0,
55 "discountCouponPrice":0,
56 "discountPrice":0,
57 "sysGold":0
58 }
59 ]
60 }
Note: The naming rule for JSON request response items is camelcase convention with the first letter lowercase.
