Queries the settlement bills of an account for a specific billing cycle. This operation is available for accounts on the Alibaba Cloud China Website that have more than 50,000 bill entries.
Operation description
Data queried for the current month is for reference only and cannot be used for reconciliation. This is because events such as delayed billing, refunds, bill adjustments, and write-offs for overdue payments may occur during the month. The final bill for the current month is available for viewing and export after 12:00 on the second day of the next month.
Bill data is updated about 5 hours after the actual resource consumption.
The status of an unpaid bill from a previous billing cycle is updated to "Paid" 5 hours after payment. The status of an unpaid bill from the current month is updated to "Paid" when the final bill is generated at 12:00 on the second day of the next month.
This API supports graceful backoff. The request rate is 600 requests per 60 seconds.
Each user is limited to 10 requests per second. If a timeout occurs, retry the request.
Try it now
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
bssapi:QuerySettleBill | get | *All Resource
|
| None |
Request parameters
Parameter | Type | Required | Description | Example |
BillingCycle | string | Yes | The billing cycle, in YYYY-MM format. | 2018-07 |
Type | string | No | The type. Valid values:
| SubscriptionOrder |
ProductCode | string | No | The product code. | rds |
ProductType | string | No | The product type. | rds |
SubscriptionType | string | No | The subscription type. Valid values:
Note This parameter must be used with the ProductCode parameter. | Subscription |
IsHideZeroCharge | boolean | No | Specifies whether to filter out bills with a pretax gross amount of 0. The default value is false to ensure backward compatibility.
| true |
NextToken | string | No | The token that specifies the position from which the query starts. If you leave this parameter empty, the query starts from the beginning. | CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U |
MaxResults | integer | No | The maximum number of records to return. Default value: 20. Maximum value: 300. | 20 |
BillOwnerId | integer | No | The ID of the account that owns the resource. The resource owner is the account that uses the resource. | 123 |
RecordID | string | No | The order number or bill number. | 12233 |
Response elements
Element | Type | Description | Example |
object | |||
Code | string | The status code. | Success |
Message | string | The error message. | Successful! |
RequestId | string | The request ID. | AE3F4057-DFC9-4B81-8858-F620651010C9 |
Success | boolean | Indicates whether the request was successful. | true |
| Data | object | The returned data. | |
NextToken | string | The token that indicates the position where the current query stopped. An empty value indicates that all data has been returned. | CAESEgoQCg4KCmdtdF9jcmVhdGUQARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U |
BillingCycle | string | The billing cycle, in YYYY-MM format. | 2020-02 |
MaxResults | integer | The maximum number of records returned for the current request. | 20 |
AccountID | string | The account ID. | 185xxxxx489 |
TotalCount | integer | The total number of records. | 200 |
AccountName | string | The account name. | test@test.aliyunid.com |
| Items | object | ||
| Item | array<object> | The bill details. | |
object | |||
Status | string | The payment status. Valid values:
| PayFinish |
RoundDownDiscount | string | The discount from rounding down. | 0 |
Item | string | The bill type:
| Subscription |
Currency | string | The currency.
| CNY |
BillAccountName | string | The name of the account to which the bill belongs. | test@test.aliyunid.com |
DeductedByCashCoupons | number | The amount deducted using cash coupons. | 0 |
SubscriptionType | string | The subscription type. Valid values:
| PayAsYouGo |
UsageStartTime | string | The start time of the billing. | 2020-03-11 07:00:00 |
BizType | string | The business type. | trusteeship |
UsageEndTime | string | The end time of the billing. | 2020-03-11 08:00:00 |
DeductedByCoupons | number | The amount deducted using coupons. | 0 |
SubOrderId | string | The ID of the order item that corresponds to the bill. | 325345254353 |
OutstandingAmount | number | The outstanding amount. | 0 |
PaymentTime | string | The time when the order was paid. | 2020-03-11 08:00:00 |
PipCode | string | The product code. This code is the same as the product code on the Bills page in the User Center. | rds |
PretaxAmount | number | The amount payable. | 100 |
CommodityCode | string | The commodity code. This code is the same as the product detail code in the User Center. | rds |
ProductName | string | The product name. | 云数据库RDS |
RecordID | string | The order number or bill number. | 2020xxxx5912 |
AdjustAmount | number | The amount deducted from a credit refund. | 0 |
ProductDetail | string | The product details. | 关系型数据库RDS(包月) |
OwnerID | string | The ID of the RAM user. This parameter is used in multi-account payment scenarios. | 3532535235 |
DeductedByPrepaidCard | number | The amount deducted using a prepaid card. | 0 |
BillAccountID | string | The ID of the account to which the bill belongs. | 185xxxxx489 |
PaymentAmount | number | The amount paid in cash. This includes deductions from credit refunds. | 0 |
InvoiceDiscount | number | The discount amount. | 0 |
ProductType | string | The product type. | rds |
PretaxGrossAmount | number | The original amount. | 0 |
CashAmount | number | The amount paid in cash. This does not include deductions from credit refunds. | 0 |
ProductCode | string | The product code. | rds |
Examples
Success response
JSON format
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "AE3F4057-DFC9-4B81-8858-F620651010C9",
"Success": true,
"Data": {
"NextToken": "CAESEgoQCg4KCmdtdF9jcmVhdGUQARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U",
"BillingCycle": "2020-02",
"MaxResults": 20,
"AccountID": "185xxxxx489",
"TotalCount": 200,
"AccountName": "test@test.aliyunid.com",
"Items": {
"Item": [
{
"Status": "PayFinish",
"RoundDownDiscount": "0",
"Item": "Subscription",
"Currency": "CNY",
"BillAccountName": "test@test.aliyunid.com",
"DeductedByCashCoupons": 0,
"SubscriptionType": "PayAsYouGo",
"UsageStartTime": "2020-03-11 07:00:00",
"BizType": "trusteeship",
"UsageEndTime": "2020-03-11 08:00:00",
"DeductedByCoupons": 0,
"SubOrderId": "325345254353",
"OutstandingAmount": 0,
"PaymentTime": "2020-03-11 08:00:00",
"PipCode": "rds",
"PretaxAmount": 100,
"CommodityCode": "rds",
"ProductName": "云数据库RDS",
"RecordID": "2020xxxx5912",
"AdjustAmount": 0,
"ProductDetail": "关系型数据库RDS(包月)",
"OwnerID": "3532535235",
"DeductedByPrepaidCard": 0,
"BillAccountID": "185xxxxx489",
"PaymentAmount": 0,
"InvoiceDiscount": 0,
"ProductType": "rds",
"PretaxGrossAmount": 0,
"CashAmount": 0,
"ProductCode": "rds"
}
]
}
}
}Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.