查詢使用者某個賬期內所有商品執行個體或計費項目的消費匯總。
介面說明
當月資料查詢結果僅供參考,不作為對賬依據;當月最終賬單在次月 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 |
*全部資源
|
bssapi:ProductCode
bssapi:ProductCode
bssapi:ProductType
bssapi:ProductType
|
無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| 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 |
| Message |
string |
錯誤資訊。 |
Successful! |
| RequestId |
string |
請求 ID。 |
79EE7556-0CFD-44EB-9CD6-B3B526E3A85F |
| Success |
boolean |
是否成功。 |
true |
| Data |
object |
返回資料。 |
|
| NextToken |
string |
用來表示當前調用返回讀取到的位置,空代表資料已經讀取完畢。下次調用時,需要將此設定到入參 NextToken 中。 |
CAESEgoQCg4KCm |
| BillingCycle |
string |
賬單日期,格式:YYYY-MM。 |
2020-03 |
| MaxResults |
integer |
本次請求所返回的最大記錄條數。 |
20 |
| AccountID |
string |
帳號 ID。 |
122 |
| TotalCount |
integer |
總記錄數。 |
20 |
| AccountName |
string |
使用者帳號。 |
test@test.aliyunid.com |
| Items |
array<object> |
賬單詳情。 |
|
|
object |
|||
| BillingDate |
string |
賬單日期,僅當 Granularity 為 DAILY 時有值,格式為 YYYY-MM-DD。 |
2020-03-20 |
| InstanceConfig |
string |
執行個體詳細配置。 |
CPU:12 |
| InternetIP |
string |
公網 IP。 |
34.xx.x.x |
| Item |
string |
賬單類型:
|
PayAsYouGoBill |
| Tag |
string |
資源標籤。 |
key:testKey value:testValue; key:testKey1 value:testValues1 |
| InstanceID |
string |
執行個體 ID。 |
i-dadada |
| Currency |
string |
幣種,取值:
|
CNY |
| BillAccountName |
string |
賬單所屬帳號名稱。 |
test@test.aliyunid.com |
| DeductedByCashCoupons |
number |
代金券抵扣。 |
0.1 |
| SubscriptionType |
string |
訂閱類型,取值:
|
PayAsYouGo |
| BizType |
string |
業務類型。 |
trusteeship |
| InstanceSpec |
string |
執行個體規格。 |
ecs.sn1ne.3xlarge |
| DeductedByCoupons |
number |
優惠券優惠金額。 |
0.1 |
| BillingItem |
string |
計費項目。僅當 IsBillingItem=true 有值。 |
頻寬 |
| BillingItemCode |
string |
計費項目代碼。 |
disk |
| Region |
string |
地區。 |
杭州 |
| OutstandingAmount |
number |
未結清金額。 |
0.1 |
| CostUnit |
string |
財務單元。 |
未分配 |
| ListPriceUnit |
string |
單價單位, 僅當 isBillingItem 為 true 時有效。 |
元 |
| ResourceGroup |
string |
資源群組。 |
預設資源群組 |
| PipCode |
string |
產品 Code,與費用中心賬單產品 Code 一致。 |
rds |
| ServicePeriodUnit |
string |
服務時間長度單位。 |
秒 |
| PretaxAmount |
number |
應付金額。 |
0.1 |
| CommodityCode |
string |
商品 Code,與費用中心產品明細 Code 一致。 |
rds |
| ProductName |
string |
產品名稱。 |
雲資料庫RDS |
| AdjustAmount |
number |
信用額度退款抵扣。 |
0 |
| NickName |
string |
執行個體暱稱。 |
test |
| ProductDetail |
string |
產品明細。 |
雲資料庫RDS |
| Usage |
string |
用量。 說明
僅當 isBillingItem 為 true 時有效。用量資料為該周期內所有賬單的用量總和並非客戶的實際購買量。如使用了 1G 的儲存,每小時出賬,則每小時用量為 1G,按天匯總的賬單用量為 1G*24=24G。 |
100 |
| IntranetIP |
string |
內網 IP。 |
192.xx.xx.xx |
| OwnerID |
string |
資源 Owner 帳號 AccountID(多帳號代付情境)。 |
123 |
| DeductedByPrepaidCard |
number |
儲值卡抵扣。 |
0.1 |
| UsageUnit |
string |
用量單位, 僅當 isBillingItem 為 true 時有效。 |
GB |
| BillAccountID |
string |
賬單所屬帳號 ID。 |
122 |
| PaymentAmount |
number |
現金支付(含信用額度退款抵扣)。 |
0.1 |
| InvoiceDiscount |
number |
優惠金額。 |
0.1 |
| DeductedByResourcePackage |
string |
資源套件抵扣, 僅當 isBillingItem 為 true 時有效。 |
0.1 |
| ProductType |
string |
產品類型。 |
rds |
| ServicePeriod |
string |
服務時間長度。 |
3600 |
| Zone |
string |
可用性區域。 |
杭州1 |
| ListPrice |
string |
單價, 僅當 isBillingItem 為 true 時有效。 |
100 |
| PretaxGrossAmount |
number |
原始金額。 |
0.1 |
| CashAmount |
number |
現金支付(不包含信用額度退款抵扣)。 |
0 |
| ProductCode |
string |
產品代碼。 |
rds |
| BillingType |
string |
計費方式。 |
其它 |
| ItemName |
string |
專案名稱。 |
iZ28bycvyb4Z |
| AfterDiscountAmount |
number |
優惠後金額(包含券抵扣的應付金額資料。計算規則為:優惠後金額=官網目錄價-優惠金額) |
樣本
正常返回樣本
JSON格式
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
"Success": true,
"Data": {
"NextToken": "CAESEgoQCg4KCm",
"BillingCycle": "2020-03",
"MaxResults": 20,
"AccountID": "122",
"TotalCount": 20,
"AccountName": "test@test.aliyunid.com",
"Items": [
{
"BillingDate": "2020-03-20",
"InstanceConfig": "CPU:12",
"InternetIP": "34.xx.x.x\t",
"Item": "PayAsYouGoBill",
"Tag": "key:testKey value:testValue; key:testKey1 value:testValues1",
"InstanceID": "i-dadada",
"Currency": "CNY",
"BillAccountName": "test@test.aliyunid.com",
"DeductedByCashCoupons": 0.1,
"SubscriptionType": "PayAsYouGo",
"BizType": "trusteeship",
"InstanceSpec": "ecs.sn1ne.3xlarge\t",
"DeductedByCoupons": 0.1,
"BillingItem": "頻寬",
"BillingItemCode": "disk",
"Region": "杭州",
"OutstandingAmount": 0.1,
"CostUnit": "未分配\t",
"ListPriceUnit": "元",
"ResourceGroup": "預設資源群組\t",
"PipCode": "rds",
"ServicePeriodUnit": "秒",
"PretaxAmount": 0.1,
"CommodityCode": "rds",
"ProductName": "雲資料庫RDS\t",
"AdjustAmount": 0,
"NickName": "test",
"ProductDetail": "雲資料庫RDS\t",
"Usage": "100",
"IntranetIP": "192.xx.xx.xx",
"OwnerID": "123",
"DeductedByPrepaidCard": 0.1,
"UsageUnit": "GB",
"BillAccountID": "122",
"PaymentAmount": 0.1,
"InvoiceDiscount": 0.1,
"DeductedByResourcePackage": "0.1",
"ProductType": "rds",
"ServicePeriod": "3600",
"Zone": "杭州1",
"ListPrice": "100",
"PretaxGrossAmount": 0.1,
"CashAmount": 0,
"ProductCode": "rds",
"BillingType": "其它",
"ItemName": "iZ28bycvyb4Z",
"AfterDiscountAmount": 0
}
]
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。