Queries the bills of your Alibaba Cloud account within a billing cycle. You can summarize the bills by resource owner.
Operation description
Before you call this operation, take note of the following items:
- Account bills are summarized based on instance bills. In most cases, the account bills do not include the data generated on the last day of the specified period.
- You can query the data generated in June 2020 or later for Cloud Communications services. However, the query results do not include the data of Alibaba Cloud Domains.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
bssapi:QueryAccountBill | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
BillingCycle | string | Yes | The billing cycle. Format: YYYY-MM. | 2018-07 |
PageNum | integer | No | The number of the page to return. Default value: 1. | 1 |
PageSize | integer | No | The number of entries to return on each page. Default value: 20. Maximum value: 300. | 20 |
IsGroupByProduct | boolean | No | Specifies whether to summarize bills based on service codes. Valid values:
Default value: false. | false |
ProductCode | string | No | The code of the service. | rds |
BillOwnerId | long | No | The ID of the member. If you specify a value for this parameter, you can query the bills of the specified member. If you leave this parameter empty, the bills of the current account are queried by default. | 122 |
Granularity | string | No | The granularity at which bills are queried. Valid values:
You must set the BillingDate parameter before you can set the Granularity parameter to DAILY. | Monthly |
BillingDate | string | No | The billing date. This parameter is required only if the Granularity parameter is set to DAILY. Format: YYYY-MM-DD. | 2021-06-01 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "3BFC23FE-A182-4D96-A1E4-7521B30B8E43",
"Success": true,
"Data": {
"PageNum": 1,
"BillingCycle": "2020-03",
"AccountID": "1857xxxxx489",
"PageSize": 20,
"TotalCount": 1,
"AccountName": "test@test.aliyunid.com",
"Items": {
"Item": [
{
"PipCode": "rds",
"PretaxAmount": 0,
"BillingDate": "2021-03-01",
"ProductName": "rds",
"AdjustAmount": 0,
"OwnerName": "aligzncloudtest2",
"Currency": "CNY",
"BillAccountName": "test@test.aliyunid.com",
"SubscriptionType": "PayAsYouGo",
"DeductedByCashCoupons": 0,
"BizType": "trusteeship",
"OwnerID": "325434254",
"DeductedByPrepaidCard": 0,
"DeductedByCoupons": 0,
"BillAccountID": "1857xxxxx489",
"PaymentAmount": 0,
"InvoiceDiscount": 0,
"OutstandingAmount": 0,
"CostUnit": "Not allocated\n",
"PretaxGrossAmount": 0,
"CashAmount": 0,
"ProductCode": "rds"
}
]
}
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2023-11-21 | API Description Update | see changesets | ||
|