Charge Item Bill
GetResourceChargeItemBillList API
API description
Retrieve details of postpaid resource item 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.
Description:
- Default API request frequency limit: 20 times/second.
- Bills for the previous day can be queried after 10:00 on the current day.
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
1POST /v{version}/bill/resource/chargeitem HTTP/1.1
2Host: billing.baidubce.com
3Authorization: authorization string
4{
5 "billMonth": "2023-03",
6 "serviceType" : "BCC",
7 "queryAccountId" : accountId,
8 "pageNo": 1,
9 "pageSize": 100
10}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| billMonth | String | No | RequestBody | Month for which to query bills, in yyyy-MM format, e.g.: 2019-02 |
| beginTime | String | No | RequestBody | Earliest date for daily bill query range, in yyyy-MM-dd format, e.g.: 2019-02-01 |
| endTime | String | No | RequestBody | Latest date for daily bill query range, in yyyy-MM-dd format, e.g.: 2019-02-18. If daily query parameters are not empty, daily query results will be returned first; daily query time ranges do not support crossing months; daily queries can retrieve bills from today up to the previous hour; |
| serviceType | String | No | RequestBody | Product type, e.g.: BCC, BOS, etc. |
| queryAccountId | String | No | RequestBody | Account ID to query. Root accounts of enterprise organizations/virtual merchants can query sub-account bills added to the financial group; other query scenarios will prompt AccessDenied |
| pageNo | int | No | RequestBody | Page number for paginated query, default is 1 |
| pageSize | int | No | RequestBody | Maximum number of items included per page, maximum: 100, default: 100. |
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 time for daily bill query range, in yyyy-MM-dd hh:mm:ss format, e.g.: 2019-02-01 00:00:00 |
| endTime | String | Latest time for daily bill query range, in yyyy-MM-dd hh:mm:ss format, e.g.: 2019-02-01 00:00:00 |
| 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< [ResourceChargeItemBill](Finance/API Reference/Bill Related Interfaces/Appendix.md#ResourceChargeItemBill) > | Resource bill item bill list |
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6{
7 "beginTime": "2023-03-29 00:00:00",
8 "endTime": "2023-03-29 23:59:59",
9 "accountId": "xxx",
10 "loginName": "xxx",
11 "subAccountId": "xxxxxxxx",
12 "subLoginName": "xxxx",
13 "ouName": "/",
14 "pageNo": 1,
15 "pageSize": 100,
16 "totalCount": 15849,
17 "bills": [{
18 "vendor": "Baidu AI Cloud",
19 "serviceType": "BCC",
20 "serviceTypeName": "Baidu Cloud Compute (BCC)",
21 "productType": "postpay",
22 "region": "bj",
23 "instanceId": "xxxx-xxxx-xxxx-xxxx-xxxx",
24 "shortId": "x-xxxxxx",
25 "startTime": "2023-03-29T01:00:00Z",
26 "endTime": "2023-03-29T01:59:59Z",
27 "configurationCH": "Type: Regular Type 5\nAvailability Zone: zoneD\nOperating System: windows\nCPU: 16\nMemory: 32G\ndisk: 0G\nSpecification: bcc.c5.c16m32",
28 "unitPrice": "RMB 0.05/minute",
29 "pricingUnit": "Minute",
30 "chargeItem": "RunningTimeMinutes",
31 "chargeItemDesc": "Postpaid by duration",
32 "amount": "5",
33 "amountUnit": "Minute",
34 "discountAmount": "0.0",
35 "originPrice": 0.25,
36 "catalogPrice": 0.25,
37 "financePrice": 0,
38 "couponPrice": 0.15,
39 "discountCouponPrice": 0,
40 "cashEquivalentCouponPrice": 0,
41 "discountPrice": 0.1,
42 "sysGold": 0
43 }]
44}
Note: The naming rule for JSON request response items is camelcase convention with the first letter lowercase.
