QuerySettleBill
Queries the settlement bills of a user within a specific billing cycle. Supports domestic accounts with more than 50,000 bill entries.
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 2nd day of the next month. During the month, a few scenarios may occur, including but not limited to delayed billing, refunds, adjustments, and overdue payment write-offs.
Bill data is updated with a 5-hour delay compared to actual expense consumption.
For bills in the "Uncleared" status from historical billing cycles, the status is updated to "Cleared" 5 hours after repayment. For bills in the "Uncleared" status for the current month, the status is updated to "Cleared" when the bill is generated at 12:00 on the 2nd day of the next month after repayment.
This API supports graceful backoff. The request rate is 600 requests per 60 seconds.
The rate limit for a single user is 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. Format: YYYY-MM. |
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 together with the ProductCode parameter. |
Subscription |
| IsHideZeroCharge |
boolean |
No |
Specifies whether to filter out records whose original price (PretaxGrossAmount) is 0. Default value: false (for compatibility with existing logic). Valid values:
|
true |
| NextToken |
string |
No |
The token that specifies the position from which to start reading. If this parameter is left empty, the reading starts from the beginning. |
CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U |
| MaxResults |
integer |
No |
The maximum number of data records to return in the current request. Default value: 20. Maximum value: 300. |
20 |
| BillOwnerId |
integer |
No |
The ID of the resource ownership account. The resource ownership account is the account that actually uses the resource. |
123 |
| RecordID |
string |
No |
The order ID or bill ID. |
12233 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. |
Success |
| Data |
object |
The returned data. |
|
| AccountID |
string |
The account ID. |
185xxxxx489 |
| AccountName |
string |
The account name. |
test@test.aliyunid.com |
| BillingCycle |
string |
The billing cycle. Format: YYYY-MM. |
2020-02 |
| Items |
object |
||
| Item |
array<object> |
The bill details. |
|
|
object |
|||
| AdjustAmount |
number |
The amount deducted by credit limit refunds. |
0 |
| AfterTaxAmount |
number |
||
| BillAccountID |
string |
The ID of the account to which the bill belongs. |
185xxxxx489 |
| BillAccountName |
string |
The name of the account to which the bill belongs. |
test@test.aliyunid.com |
| BizType |
string |
The business type. |
trusteeship |
| CashAmount |
number |
The cash payment amount, excluding deductions from credit limit refunds. |
0 |
| CommodityCode |
string |
The commodity code, which is consistent with the product detail code in the User Center. |
rds |
| Currency |
string |
The currency. Valid values:
|
CNY |
| DeductedByCoupons |
number |
The amount deducted by coupons. |
0 |
| InvoiceDiscount |
number |
The discount amount. |
0 |
| Item |
string |
The bill type. Valid values:
|
Subscription |
| OutstandingAmount |
number |
The outstanding amount. |
0 |
| OwnerID |
string |
The ID of the member account in a multi-account payment scenario. |
3532535235 |
| PaymentAmount |
number |
The cash payment amount, including deductions from credit limit refunds. |
0 |
| PaymentCurrency |
string |
||
| PaymentTime |
string |
The payment time of the order. |
2020-03-11 08:00:00 |
| PaymentTransactionID |
string |
||
| PipCode |
string |
The product code, which is consistent with the bill product code in the User Center. |
rds |
| PretaxAmount |
number |
The payable amount. |
100 |
| PretaxAmountLocal |
number |
||
| PretaxGrossAmount |
number |
The original amount. |
0 |
| ProductCode |
string |
The product code. |
rds |
| ProductDetail |
string |
The product details. |
Relational database RDS (subscription) |
| ProductName |
string |
The product name. |
ApsaraDB RDS |
| ProductType |
string |
The product type. |
rds |
| RecordID |
string |
The order ID or bill ID. |
2020xxxx5912 |
| RoundDownDiscount |
string |
The round-down discount. |
0 |
| Status |
string |
The payment status. Valid values:
|
PayFinish |
| SubOrderId |
string |
The ID of the order detail corresponding to the bill. |
325345254353 |
| SubscriptionType |
string |
The subscription type. Valid values:
|
PayAsYouGo |
| Tax |
number |
||
| UsageEndTime |
string |
The end time of the bill. |
2020-03-11 08:00:00 |
| UsageStartTime |
string |
The start time of the bill. |
2020-03-11 07:00:00 |
| MaxResults |
integer |
The maximum number of records returned in the current request. |
20 |
| NextToken |
string |
The token that indicates the position where the current read operation ends. If this parameter is empty, all data has been read. |
CAESEgoQCg4KCmdtdF9jcmVhdGUQARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U |
| TotalCount |
integer |
The total number of records. |
200 |
| Message |
string |
The error message. |
Successful! |
| RequestId |
string |
The request ID. |
AE3F4057-DFC9-4B81-8858-F620651010C9 |
| Success |
boolean |
Indicates whether the request is successful. |
true |
Examples
Success response
JSON format
{
"Code": "Success",
"Data": {
"AccountID": "185xxxxx489",
"AccountName": "test@test.aliyunid.com",
"BillingCycle": "2020-02",
"Items": {
"Item": [
{
"AdjustAmount": 0,
"AfterTaxAmount": 0,
"BillAccountID": "185xxxxx489",
"BillAccountName": "test@test.aliyunid.com",
"BizType": "trusteeship",
"CashAmount": 0,
"CommodityCode": "rds",
"Currency": "CNY",
"DeductedByCoupons": 0,
"InvoiceDiscount": 0,
"Item": "Subscription",
"OutstandingAmount": 0,
"OwnerID": "3532535235",
"PaymentAmount": 0,
"PaymentCurrency": "",
"PaymentTime": "2020-03-11 08:00:00",
"PaymentTransactionID": "",
"PipCode": "rds",
"PretaxAmount": 100,
"PretaxAmountLocal": 0,
"PretaxGrossAmount": 0,
"ProductCode": "rds",
"ProductDetail": "Relational database RDS (subscription)",
"ProductName": "ApsaraDB RDS",
"ProductType": "rds",
"RecordID": "2020xxxx5912",
"RoundDownDiscount": "0",
"Status": "PayFinish",
"SubOrderId": "325345254353",
"SubscriptionType": "PayAsYouGo",
"Tax": 0,
"UsageEndTime": "2020-03-11 08:00:00",
"UsageStartTime": "2020-03-11 07:00:00"
}
]
},
"MaxResults": 20,
"NextToken": "CAESEgoQCg4KCmdtdF9jcmVhdGUQARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U",
"TotalCount": 200
},
"Message": "Successful!",
"RequestId": "AE3F4057-DFC9-4B81-8858-F620651010C9",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.