Queries the consumption summary of all product instances or billable items for a user within a specific billing cycle.
Operation description
The query results for the current month are for reference only and cannot be used as the basis for reconciliation. The final bill for the current month can be viewed or exported after 12:00 on the 3rd day of the next month. During the month, a few scenarios may occur, including but not limited to delayed billing, refunds, bill adjustments, and overdue payment write-offs.
The bill data for the current month does not include unsettled pay-as-you-go data that is unbilled or accumulating.
Data for the last 18 months is supported.
Bill data is updated with a 24-hour delay compared to actual consumption. Information related to the instance ID, such as instance configuration, instance type, instance alias, resource group, public IP address, private IP address, and zone, is updated with a 48-hour delay.
Bill data does not provide the specific costs of individual split items, such as domain names, buckets, and EIPs, for split-type cloud services, such as CDN, OSS, and Internet Shared Bandwidth. To view data that includes split items, go to the split bill page.
For cloud communication products, only detail data from June 2020 onwards is supported. For HiChina products, including domain names and trademarks, only detail data from November 2020 onwards is supported.
The rate limit is 10 requests per second per user. If a timeout occurs, retry the request.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
bssapi:DescribeInstanceBill |
get |
*All Resource
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| BillingCycle |
string |
Yes |
The billing cycle in the YYYY-MM format. Only the last 18 billing cycles are supported. |
2020-03 |
| ProductCode |
string |
No |
The product code. |
rds |
| ProductType |
string |
No |
The product type. |
rds |
| SubscriptionType |
string |
No |
The subscription type. Valid values:
|
PayAsYouGo |
| IsBillingItem |
boolean |
No |
Specifies whether to retrieve data by billable item. Valid values:
|
false |
| NextToken |
string |
No |
The position from which the current call starts to read data. The value must be empty or set to the NextToken value returned in the previous response. Otherwise, an error occurs. An empty value indicates that the reading starts from the beginning. |
CAESEgoQCg4KCm |
| MaxResults |
integer |
No |
The maximum number of data records to read in the current call. Default value: 20. Maximum value: 300. |
20 |
| IsHideZeroCharge |
boolean |
No |
Specifies whether to filter out records where both the original price (PretaxGrossAmount) and the payable amount (PretaxAmount) are 0. Valid values:
|
false |
| BillingDate |
string |
No |
The billing date. This parameter is required only when Granularity is set to DAILY. Format: YYYY-MM-DD. Note
The value of BillingDate must be in the same month as the value of BillingCycle. For example, if BillingCycle is set to 2020-03, BillingDate must be set to 2020-03-DD. If the months are inconsistent, the query results are returned based on the time specified by BillingCycle. |
2020-03-02 |
| Granularity |
string |
No |
The granularity at which bills are queried. Valid values:
Note
If you select DAILY, you must specify BillingDate. |
MONTHLY |
| BillOwnerId |
integer |
No |
The ID of the resource ownership account. The resource ownership account is the account that actually uses the resource. |
122 |
| InstanceID |
string |
No |
The instance ID. |
abc |
| PipCode |
string |
No |
The product code, which is consistent with the product code in the bills of the User Center. |
rds |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. |
Success |
| Data |
object |
The returned data. |
|
| AccountID |
string |
The account ID. |
122 |
| AccountName |
string |
The user account. |
test@test.aliyunid.com |
| BillingCycle |
string |
The billing date. Format: YYYY-MM. |
2020-03 |
| Items |
array<object> |
The bill details. |
|
|
object |
|||
| AfterDiscountAmount |
number |
The amount after discount, including the payable amount after coupon deduction. Calculation rule: Amount after discount = List price - Discount amount. |
0 |
| BillAccountID |
string |
The ID of the account to which the bill belongs. |
122 |
| BillAccountName |
string |
The name of the account to which the bill belongs. |
test@test.aliyunid.com |
| BillingDate |
string |
The billing date. This parameter has a value only when Granularity is set to DAILY. Format: YYYY-MM-DD. |
2020-03-20 |
| BillingItem |
string |
The billable item. This parameter has a value only when IsBillingItem is set to true. |
Bandwidth |
| BillingItemCode |
string |
The billable item code. |
disk |
| BillingType |
string |
The billing method. |
Other |
| BizType |
string |
The business type. |
trusteeship |
| CommodityCode |
string |
The commodity code, which is the same as the product detail code in the User Center. |
rds |
| CostUnit |
string |
The cost unit. |
Unallocated |
| Currency |
string |
The currency. Valid values:
|
CNY |
| DeductedByCoupons |
number |
The coupon discount amount. |
0.1 |
| DeductedByResourcePackage |
string |
The amount deducted by resource plans. This parameter is valid only when isBillingItem is set to true. |
0.1 |
| InstanceConfig |
string |
The detailed instance configuration. |
CPU:12 |
| InstanceID |
string |
The instance ID. |
i-dadada |
| InstanceSpec |
string |
The instance specifications. |
ecs.sn1ne.3xlarge |
| InternetIP |
string |
The public IP address. |
34.xx.x.x |
| IntranetIP |
string |
The internal IP address. |
192.xx.xx.xx |
| InvoiceDiscount |
number |
The discount amount. |
0.1 |
| Item |
string |
The bill type. Valid values:
|
PayAsYouGoBill |
| ItemName |
string |
The item name. |
iZ28bycvyb4Z |
| ListPrice |
string |
The unit price. This parameter is valid only when isBillingItem is set to true. |
100 |
| ListPriceUnit |
string |
The unit of the unit price. This parameter is valid only when isBillingItem is set to true. |
CNY |
| NickName |
string |
The instance nickname. |
test |
| OwnerID |
string |
The account ID of the resource owner in multi-account payment scenarios. |
123 |
| PipCode |
string |
The product code, which is consistent with the product code in the bills of the User Center. |
rds |
| PretaxAmount |
number |
The payable amount. |
0.1 |
| PretaxGrossAmount |
number |
The original amount. |
0.1 |
| ProductCode |
string |
The product code. |
rds |
| ProductDetail |
string |
The product detail. |
ApsaraDB RDS |
| ProductName |
string |
The product name. |
ApsaraDB RDS |
| ProductType |
string |
The product type. |
rds |
| Region |
string |
The region. |
Hangzhou |
| ResourceGroup |
string |
The resource group. |
Default resource group |
| ServicePeriod |
string |
The service duration. |
3600 |
| ServicePeriodUnit |
string |
The unit of the service duration. |
Seconds |
| SubscriptionType |
string |
The subscription type. Valid values:
|
PayAsYouGo |
| Tag |
string |
The resource tag. |
key:testKey value:testValue; key:testKey1 value:testValues1 |
| Usage |
string |
The usage. Note
This parameter is valid only when isBillingItem is set to true. The usage data is the sum of usage across all bills within the cycle, not the actual purchased amount. For example, if 1 GB of storage is used and billed hourly, the hourly usage is 1 GB, and the daily aggregated bill usage is 1 GB × 24 = 24 GB. |
100 |
| UsageUnit |
string |
The usage unit. This parameter is valid only when isBillingItem is set to true. |
GB |
| Zone |
string |
The zone. |
Hangzhou Zone 1 |
| MaxResults |
integer |
The maximum number of records returned for the current request. |
20 |
| NextToken |
string |
The token that indicates the position from which the current call resumes reading. An empty value indicates that all data has been read. For the next call, set this value to the NextToken request parameter. |
CAESEgoQCg4KCm |
| TotalCount |
integer |
The total number of records. |
20 |
| Message |
string |
The error message. |
Successful! |
| RequestId |
string |
The request ID. |
79EE7556-0CFD-44EB-9CD6-B3B526E3A85F |
| Success |
boolean |
Indicates whether the request is successful. |
true |
Examples
Success response
JSON format
{
"Code": "Success",
"Data": {
"AccountID": "122",
"AccountName": "test@test.aliyunid.com",
"BillingCycle": "2020-03",
"Items": [
{
"AfterDiscountAmount": 0,
"BillAccountID": "122",
"BillAccountName": "test@test.aliyunid.com",
"BillingDate": "2020-03-20",
"BillingItem": "Bandwidth",
"BillingItemCode": "disk",
"BillingType": "Other",
"BizType": "trusteeship",
"CommodityCode": "rds",
"CostUnit": "Unallocated",
"Currency": "CNY",
"DeductedByCoupons": 0.1,
"DeductedByResourcePackage": "0.1",
"InstanceConfig": "CPU:12",
"InstanceID": "i-dadada",
"InstanceSpec": "ecs.sn1ne.3xlarge\t",
"InternetIP": "34.xx.x.x\t",
"IntranetIP": "192.xx.xx.xx",
"InvoiceDiscount": 0.1,
"Item": "PayAsYouGoBill",
"ItemName": "iZ28bycvyb4Z",
"ListPrice": "100",
"ListPriceUnit": "CNY",
"NickName": "test",
"OwnerID": "123",
"PipCode": "rds",
"PretaxAmount": 0.1,
"PretaxGrossAmount": 0.1,
"ProductCode": "rds",
"ProductDetail": "ApsaraDB RDS",
"ProductName": "ApsaraDB RDS",
"ProductType": "rds",
"Region": "Hangzhou",
"ResourceGroup": "Default resource group",
"ServicePeriod": "3600",
"ServicePeriodUnit": "Second",
"SubscriptionType": "PayAsYouGo",
"Tag": "key:testKey value:testValue; key:testKey1 value:testValues1",
"Usage": "100",
"UsageUnit": "GB",
"Zone": "Hangzhou Zone 1"
}
],
"MaxResults": 20,
"NextToken": "CAESEgoQCg4KCm",
"TotalCount": 20
},
"Message": "Successful!",
"RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.