QueryBill - 账单查询服务

更新时间: 2024-03-01 17:00:01

查询用户某个账期内结算账单。

调试

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

授权信息

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

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

请求参数

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

账期,YYYY-MM。

2018-07
Typestring

类型。取值:

  • SubscriptionOrder
  • PayAsYouGoBill
  • Refund
  • Adjustment
SubscriptionOrder
ProductCodestring

产品代码。

rds
ProductTypestring

产品类型。

rds
SubscriptionTypestring

订阅类型。取值:

  • Subscription
  • PayAsYouGo
说明 必须和 ProductCode 参数一起使用。
Subscription
IsHideZeroChargeboolean

根据原价(PretaxGrossAmount)是否为 0 做过滤,默认为否(兼容现有逻辑)。

  • true:是。
  • false:否。
true
PageNuminteger

页码,默认值为 1。

1
PageSizeinteger

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

20
BillOwnerIdlong

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

123

返回参数

名称类型描述示例值
object
Codestring

状态码。

Success
Messagestring

错误信息。

Successful!
RequestIdstring

请求 ID。

AE3F4057-DFC9-4B81-8858-F620651010C9
Successboolean

是否成功。

true
Dataobject

返回数据。

PageNuminteger

页码。

1
BillingCyclestring

账期,YYYY-MM。

2020-02
AccountIDstring

账号 ID。

185xxxxx489
PageSizeinteger

每页条数。

1
TotalCountinteger

总记录数。

20
AccountNamestring

账号。

test@test.aliyunid.com
Itemsobject []

账单详情。

Statusstring

支付状态。取值:

  • PayFinish:已支付
  • PayUnclear:未结清
  • PayUnsettle:未结算
  • NoSettle:免结算
PayFinish
RoundDownDiscountstring

抹零优惠。

0
Itemstring

账单类型:

  • SubscriptionOrder
  • PayAsYouGoBill
  • Refund
  • Adjustment
SubscriptionOrder
Currencystring

币种。

  • CNY
  • USD
  • JPY
CNY
UsageStartTimestring

账单开始时间。

2020-03-11 07:00:00
SubscriptionTypestring

订阅类型。取值:

  • Subscription
  • PayAsYouGo
PayAsYouGo
DeductedByCashCouponsfloat

代金券抵扣。

0
UsageEndTimestring

账单结束时间。

2020-03-11 08:00:00
DeductedByCouponsfloat

优惠券抵扣。

0
SubOrderIdstring

该条账单对应的订单明细 ID。

325345254353
OutstandingAmountfloat

未结清金额。

0
PaymentTimestring

订单支付时间。

2020-03-11 08:00:00
PipCodestring

产品 Code。

rds
PretaxAmountfloat

应付金额。

100
CommodityCodestring

商品 Code。

rds
ProductNamestring

产品名称。

云数据库RDS
RecordIDstring

订单号、账单号。

2020xxxx5912
AdjustAmountfloat

信用额度退款抵扣。

0
ProductDetailstring

产品明细。

关系型数据库RDS(包月)
OwnerIDstring

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

3532535235
DeductedByPrepaidCardfloat

储值卡抵扣。

0
ProductTypestring

产品类型。

rds
InvoiceDiscountfloat

优惠金额。

0
PaymentAmountfloat

现金支付。

0
PretaxGrossAmountfloat

原始金额。

0
CashAmountfloat

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

0
ProductCodestring

产品代码。

rds

示例

正常返回示例

JSON格式

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "AE3F4057-DFC9-4B81-8858-F620651010C9",
  "Success": true,
  "Data": {
    "PageNum": 1,
    "BillingCycle": "2020-02",
    "AccountID": "185xxxxx489",
    "PageSize": 1,
    "TotalCount": 20,
    "AccountName": "test@test.aliyunid.com",
    "Items": {
      "Item": [
        {
          "Status": "PayFinish",
          "RoundDownDiscount": "0",
          "Item": "SubscriptionOrder",
          "Currency": "CNY",
          "UsageStartTime": "2020-03-11 07:00:00",
          "SubscriptionType": "PayAsYouGo",
          "DeductedByCashCoupons": 0,
          "UsageEndTime": "2020-03-11 08:00:00",
          "DeductedByCoupons": 0,
          "SubOrderId": "325345254353",
          "OutstandingAmount": 0,
          "AfterTaxAmount": 0,
          "PaymentTime": "2020-03-11 08:00:00",
          "PretaxAmountLocal": 0,
          "Tax": 0,
          "PipCode": "rds",
          "PaymentTransactionID": "2O3AADJFEAF2PDKSFAMFCB11918",
          "PretaxAmount": 100,
          "CommodityCode": "rds",
          "ProductName": "云数据库RDS",
          "RecordID": "2020xxxx5912",
          "AdjustAmount": 0,
          "ProductDetail": "关系型数据库RDS(包月)",
          "PaymentCurrency": "USD",
          "OwnerID": "3532535235",
          "DeductedByPrepaidCard": 0,
          "ProductType": "rds",
          "InvoiceDiscount": 0,
          "PaymentAmount": 0,
          "PretaxGrossAmount": 0,
          "CashAmount": 0,
          "ProductCode": "rds"
        }
      ]
    }
  }
}

错误码

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

阿里云首页 阿里云交易和账单管理API 相关技术圈