文档

QueryInstanceBill - 实例账单查询服务

更新时间:
一键部署

查询用户某个账期内所有商品实例或计费项的消费汇总。API已升级为DescribeInstanceBill,此API不再提供50000行以后数据的查询。

接口说明

API 描述

在调用本接口时,请注意:

  • 实例账单 API 已升级,请使用新版 API: DescribeInstanceBill 。此 API 不再提供 50000 行以后数据的查询。
  • 实例账单是根据账单数据拆分生成,一般会有一天延迟。
  • 实例信息在账期内会变化,月汇总的实例 Config 和 Spec 对应记录生成时间信息,如需详情可参考对应明细账单。
  • 云通信产品可查询从 2020 年 6 月以后的数据; 万网产品可查询从 2020 年 11 月以后的数据。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
bssapi:QueryInstanceBillREAD
  • 全部资源
    *
  • bssapi:ProductCode
  • bssapi:ProductType

请求参数

名称类型必填描述示例值
BillingCyclestring

账期 YYYY-MM。仅支持最近 18 个月账期。

2020-03
ProductCodestring

产品代码。

rds
ProductTypestring

产品类型。当 ProductCode 为云市场产品 code 时,此参数必填。

rds
SubscriptionTypestring

订阅类型。取值:

  • Subscription:预付费。
  • PayAsYouGo:后付费。
说明 必须和 ProductCode 参数一起使用。
PayAsYouGo
IsBillingItemboolean

是否按照计费项维度拉取数据。

  • false。与“费用中心-费用账单-账单明细-实例”账单一致。
  • true。与“费用中心-费用账单-账单明细-计费项”账单一致。

默认 false。

false
PageNuminteger

页码,默认值为 1。

1
PageSizeinteger

每页数量,默认值:20,最大值:300。

20
IsHideZeroChargeboolean

根据原价(PretaxGrossAmount)和应付(PretaxAmount)是否都为 0 做过滤。取值:

  • false。
  • true。
false
BillingDatestring

账单日期,仅当 Granularity 为 DAILY 时必填,格式为 YYYY-MM-DD。

2020-03-03
Granularitystring

查询账单的颗粒度。取值:

  • MONTHLY:月。与“费用中心-费用账单-账单明细-账期”账单一致。
  • DAILY:日。与“费用中心-费用账单-账单明细-按天”账单一致。

选择 DAILY 需指定 BillingDate

MONTHLY
BillOwnerIdlong

资源归属账号 ID,资源归属账号是实际使用资源的账号。

122

返回参数

名称类型描述示例值
object
Codestring

状态码。

Success
Messagestring

错误信息。

Successful!
RequestIdstring

请求 ID。

79EE7556-0CFD-44EB-9CD6-B3B526E3A85F
Successboolean

是否成功。

true
Dataobject

返回数据。

PageNuminteger

页码。

1
BillingCyclestring

账单日期,格式:YYYY-MM。

2020-03
AccountIDstring

账号 ID。

185xxxx3489
PageSizeinteger

每页数量。

20
TotalCountinteger

总记录数。

2
AccountNamestring

用户账号。

test@test.aliyunid.com
Itemsobject []

账单详情。

BillingDatestring

账单日期,仅当 Granularity 为 DAILY 时有值,格式为 YYYY-MM-DD。

2020-03
InstanceConfigstring

实例详细配置。

CPU:12
InternetIPstring

公网 IP。

34.xx.x.x
Itemstring

账单类型:

  • SubscriptionOrder (预付订单)。
  • PayAsYouGoBill (后付账单)。
  • Refund (退款)。
  • Adjustment (调账)。
PayAsYouGoBill
Tagstring

标签。

tag
InstanceIDstring

实例 ID。

i-kjhdskjgshfdlkjfdh
Currencystring

币种,取值:

  • CNY。
  • USD。
  • JPY。
CNY
DeductedByCashCouponsfloat

代金券抵扣。

0
SubscriptionTypestring

订阅类型,取值:

  • Subscription:预付费。
  • PayAsYouGo:后付费。
说明 必须和 ProductCode 参数一起使用。
PayAsYouGo
InstanceSpecstring

实例规格。

ecs.sn1ne.3xlarge
DeductedByCouponsfloat

优惠券优惠金额。

0
BillingItemstring

计费项。仅当 IsBillingItem=true 有值。

其他
Regionstring

地域。

杭州
OutstandingAmountfloat

未结清金额

0
CostUnitstring

财务单元。

未分配
ListPriceUnitstring

单价单位, 仅当 isBillingItem 为 true 时有效。

ResourceGroupstring

资源组。

默认资源组
PipCodestring

产品 Code,与费用中心账单产品 Code 一致

rds
ServicePeriodUnitstring

服务周期单位

PretaxAmountfloat

应付金额。

0
CommodityCodestring

商品 Code,与费用中心产品明细 Code 一致

rds
ProductNamestring

产品名称。

云数据库RDS
AdjustAmountfloat

信用额度退款抵扣。

0
NickNamestring

实例昵称。

test
ProductDetailstring

产品明细。

云数据库RDS
Usagestring

用量, 仅当 isBillingItem 为 true 时有效。

100
IntranetIPstring

内网 IP。

192.xx.xx.xx
OwnerIDstring

子账号 AccountID(多账号代付场景)。

169***013
DeductedByPrepaidCardfloat

储值卡抵扣。

0
UsageUnitstring

用量单位, 仅当 isBillingItem 为 true 时有效。

GB
PaymentAmountfloat

现金支付。

0
InvoiceDiscountfloat

优惠金额。

0
DeductedByResourcePackagestring

资源包抵扣。

NULL
ProductTypestring

产品类型。

rds
ServicePeriodstring

服务周期。

10
Zonestring

可用区。

cn-hangzhou-h
ListPricestring

单价, 仅当 isBillingItem 为 true 时有效。

100
PretaxGrossAmountfloat

原始金额。

0
CashAmountfloat

现金支付(不包含信用额度退款抵扣)。

0
ProductCodestring

产品代码。

rds
BillingTypestring

计费方式。

其它

示例

正常返回示例

JSON格式

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
  "Success": true,
  "Data": {
    "PageNum": 1,
    "BillingCycle": "2020-03",
    "AccountID": "185xxxx3489",
    "PageSize": 20,
    "TotalCount": 2,
    "AccountName": "test@test.aliyunid.com",
    "Items": {
      "Item": [
        {
          "BillingDate": "2020-03",
          "InstanceConfig": "CPU:12",
          "InternetIP": "34.xx.x.x",
          "Item": "PayAsYouGoBill",
          "Tag": "tag",
          "InstanceID": "i-kjhdskjgshfdlkjfdh",
          "Currency": "CNY",
          "DeductedByCashCoupons": 0,
          "SubscriptionType": "PayAsYouGo",
          "InstanceSpec": "ecs.sn1ne.3xlarge",
          "DeductedByCoupons": 0,
          "BillingItem": "其他",
          "Region": "杭州",
          "OutstandingAmount": 0,
          "CostUnit": "未分配",
          "ListPriceUnit": "元",
          "ResourceGroup": "默认资源组",
          "PipCode": "rds",
          "ServicePeriodUnit": "秒",
          "PretaxAmount": 0,
          "CommodityCode": "rds",
          "ProductName": "云数据库RDS",
          "AdjustAmount": 0,
          "NickName": "test",
          "ProductDetail": "云数据库RDS",
          "Usage": "100",
          "IntranetIP": "192.xx.xx.xx",
          "OwnerID": "169***013",
          "DeductedByPrepaidCard": 0,
          "UsageUnit": "GB",
          "PaymentAmount": 0,
          "InvoiceDiscount": 0,
          "DeductedByResourcePackage": "NULL",
          "ProductType": "rds",
          "ServicePeriod": "10",
          "Zone": "cn-hangzhou-h",
          "ListPrice": "100",
          "PretaxGrossAmount": 0,
          "CashAmount": 0,
          "ProductCode": "rds",
          "BillingType": "其它"
        }
      ]
    }
  }
}

错误码

访问错误中心查看更多错误码。

  • 本页导读 (0)
文档反馈