查詢使用者某個帳期內所有商品執行個體或計費項的消費匯總。
介面說明
當月資料查詢結果僅供參考,不作為對帳依據;當月最終帳單在次月 3 日 12 點後支援檢視/匯出(月中會發生包括但不限於以下少數場景:延遲出帳、退款、調帳、欠費核銷等)。
當月帳單資料中不包含未結算(未出帳、累帳中)的後付費資料。
支援近 18 個月資料。
帳單資料相對於實際費用消耗延遲 24 小時更新,其中執行個體 ID 相關的資訊(執行個體組態、執行個體規格、執行個體暱稱、資源群組、公網 IP、私網 IP、可用區)延遲 48 小時更新。
帳單資料不支援提供分拆型雲端產品(例如:CDN、OSS、共享頻寬等)各個分拆項(例如:網域、Bucket、EIP 等)的具體費用(如需統計含分拆項資料,請前往分帳帳單)。
對於雲端通訊產品,僅支援查詢 2020 年 6 月及以後的明細資料,萬網產品(包括網域、商標等)僅支援查詢 2020 年 11 月及以後的明細資料。
單一使用者限流 10 筆/秒,如遇逾時,請重試。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
bssapi:DescribeInstanceBill |
get |
*全部資源。
|
|
無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| BillingCycle |
string |
是 |
帳期 YYYY-MM。僅支援最近 18 個月帳期。 |
2020-03 |
| ProductCode |
string |
否 |
產品代碼。 |
rds |
| ProductType |
string |
否 |
產品類型。 |
rds |
| SubscriptionType |
string |
否 |
訂閱類型。取值:
|
PayAsYouGo |
| IsBillingItem |
boolean |
否 |
是否按照計費項維度拉取資料。
|
false |
| NextToken |
string |
否 |
用來表示當前呼叫開始讀取的位置,參數值必須為空或者使用返回結果中的 NextToken 設值,否則會報錯。空代表從頭開始讀取。 |
CAESEgoQCg4KCm |
| MaxResults |
integer |
否 |
本次讀取的最大資料記錄數量。預設值:20,最大值:300。 |
20 |
| IsHideZeroCharge |
boolean |
否 |
根據原價(PretaxGrossAmount)和應付(PretaxAmount)是否都為 0 做過濾。取值:
|
false |
| BillingDate |
string |
否 |
帳單日期,僅當 Granularity 為 DAILY 時必填,格式為 YYYY-MM-DD。 說明
BillingDate 參數值需和 BillingCycle 參數月份保持一致,例如 BillingCycle 設定為 2020-03,BillingDate 需設定為 2020-03-DD。若月份設定不一致,查詢的結果按 BillingCycle 設定的時間返回。 |
2020-03-02 |
| Granularity |
string |
否 |
查詢帳單的顆粒度。取值如下:
說明
選擇 DAILY 需指定 BillingDate。 |
MONTHLY |
| BillOwnerId |
integer |
否 |
資源歸屬帳號 ID,資源歸屬帳號是實際使用資源的帳號。 |
122 |
| InstanceID |
string |
否 |
執行個體 ID。 |
abc |
| PipCode |
string |
否 |
產品 Code,與費用中心帳單產品 Code 一致。 |
rds |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| Code |
string |
狀態碼。 |
Success |
| Data |
object |
傳回資料。 |
|
| AccountID |
string |
帳號 ID。 |
122 |
| AccountName |
string |
使用者帳號。 |
test@test.aliyunid.com |
| BillingCycle |
string |
帳單日期,格式:YYYY-MM。 |
2020-03 |
| Items |
array<object> |
帳單詳情。 |
|
|
object |
|||
| AfterDiscountAmount |
number |
優惠後金額(包含折價券抵扣的應付金額資料。計算規則為:優惠後金額=官網目錄價-優惠金額)。 |
|
| BillAccountID |
string |
帳單所屬帳號 ID。 |
122 |
| BillAccountName |
string |
帳單所屬帳號名稱。 |
test@test.aliyunid.com |
| BillingDate |
string |
帳單日期,僅當 Granularity 為 DAILY 時有值,格式為 YYYY-MM-DD。 |
2020-03-20 |
| BillingItem |
string |
計費項目。僅當 IsBillingItem=true 時有值。 |
頻寬 |
| BillingItemCode |
string |
計費項目代碼。 |
disk |
| BillingType |
string |
計費方式。 |
其他 |
| BizType |
string |
業務類型。 |
trusteeship |
| CommodityCode |
string |
商品 Code,與費用中心產品明細 Code 一致。 |
rds |
| CostUnit |
string |
財務單元。 |
未分配 |
| Currency |
string |
幣別,取值:
|
CNY |
| DeductedByCoupons |
number |
優惠券優惠金額。 |
0.1 |
| DeductedByResourcePackage |
string |
資源套件抵扣,僅當 isBillingItem 為 true 時有效。 |
0.1 |
| InstanceConfig |
string |
執行個體詳細組態。 |
CPU:12 |
| InstanceID |
string |
執行個體 ID。 |
i-dadada |
| InstanceSpec |
string |
執行個體規格。 |
ecs.sn1ne.3xlarge |
| InternetIP |
string |
公網 IP。 |
34.xx.x.x |
| IntranetIP |
string |
內網 IP。 |
192.xx.xx.xx |
| InvoiceDiscount |
number |
優惠金額。 |
0.1 |
| Item |
string |
帳單類型:
|
PayAsYouGoBill |
| ItemName |
string |
項目名稱。 |
iZ28bycvyb4Z |
| ListPrice |
string |
單價,僅當 isBillingItem 為 true 時有效。 |
100 |
| ListPriceUnit |
string |
單價單位,僅當 isBillingItem 為 true 時有效。 |
元 |
| NickName |
string |
執行個體暱稱。 |
test |
| OwnerID |
string |
資源 Owner 帳號 AccountID(多帳號代付場景)。 |
123 |
| PipCode |
string |
產品 Code,與費用中心帳單產品 Code 一致。 |
rds |
| PretaxAmount |
number |
應付金額。 |
0.1 |
| PretaxGrossAmount |
number |
原始金額。 |
0.1 |
| ProductCode |
string |
產品代碼。 |
rds |
| ProductDetail |
string |
產品明細。 |
雲端資料庫 RDS |
| ProductName |
string |
產品名稱。 |
雲端資料庫 RDS |
| ProductType |
string |
產品類型。 |
rds |
| Region |
string |
地域。 |
杭州 |
| ResourceGroup |
string |
資源群組。 |
預設資源群組 |
| ServicePeriod |
string |
服務時長。 |
3600 |
| ServicePeriodUnit |
string |
服務時長單位。 |
秒 |
| SubscriptionType |
string |
訂閱類型,取值:
|
PayAsYouGo |
| Tag |
string |
資源標籤。 |
key:testKey value:testValue; key:testKey1 value:testValues1 |
| Usage |
string |
用量。 說明
僅當 isBillingItem 為 true 時有效。用量資料為該週期內所有帳單的用量總和並非客戶的實際購買量。如使用了 1G 的儲存,每小時出帳,則每小時用量為 1G,按天彙總的帳單用量為 1G*24=24G。 |
100 |
| UsageUnit |
string |
用量單位,僅當 isBillingItem 為 true 時有效。 |
GB |
| Zone |
string |
可用區。 |
杭州 1 |
| MaxResults |
integer |
本次請求所傳回的最大記錄筆數。 |
20 |
| NextToken |
string |
用來表示目前呼叫傳回讀取到的位置,空代表資料已經讀取完畢。下次呼叫時,需要將此設定到入參 NextToken 中。 |
CAESEgoQCg4KCm |
| TotalCount |
integer |
總記錄數。 |
20 |
| Message |
string |
錯誤資訊。 |
Successful! |
| RequestId |
string |
請求 ID。 |
79EE7556-0CFD-44EB-9CD6-B3B526E3A85F |
| Success |
boolean |
是否成功。 |
true |
樣本
正常返回樣本
JSON格式
{
"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": "带宽",
"BillingItemCode": "disk",
"BillingType": "其它",
"BizType": "trusteeship",
"CommodityCode": "rds",
"CostUnit": "未分配\t",
"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": "元",
"NickName": "test",
"OwnerID": "123",
"PipCode": "rds",
"PretaxAmount": 0.1,
"PretaxGrossAmount": 0.1,
"ProductCode": "rds",
"ProductDetail": "云数据库RDS\t",
"ProductName": "云数据库RDS\t",
"ProductType": "rds",
"Region": "杭州",
"ResourceGroup": "默认资源组\t",
"ServicePeriod": "3600",
"ServicePeriodUnit": "秒",
"SubscriptionType": "PayAsYouGo",
"Tag": "key:testKey value:testValue; key:testKey1 value:testValues1",
"Usage": "100",
"UsageUnit": "GB",
"Zone": "杭州1"
}
],
"MaxResults": 20,
"NextToken": "CAESEgoQCg4KCm",
"TotalCount": 20
},
"Message": "Successful!",
"RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
"Success": true
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。