调用QuerySettleBill查询用户某个账期内结算账单。支持账单条目超过50000条的中国内地账号。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String QuerySettleBill

系统规定参数。取值:QuerySettleBill

BillingCycle String 2018-07

账期,YYYY-MM。

Type String SubscriptionOrder

类型。取值:

  • SubscriptionOrder 预付费订单
  • PayAsYouGoBill 后付费账单
  • Refund 退款账单
  • Adjustment 调账账单
ProductCode String rds

产品代码。

ProductType String rds

产品类型。

SubscriptionType String Subscription

订阅类型。取值:

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

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

  • true:是。
  • false:否。
NextToken String CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U

用来标记当前开始读取的位置,置空表示从头开始。

MaxResults Integer 20

本次读取的最大数据记录数量。默认值:20,最大值:300。

BillOwnerId Long 123

子账号ID。设置可查看财务云子账号账单,不填默认查看当前调用账号。

RecordID String 12233

订单号、账单号。

返回数据

名称 类型 示例值 描述
Code String Success

状态码

Message String Successful!

错误信息。

RequestId String AE3F4057-DFC9-4B81-8858-F620651010C9

请求ID。

Success Boolean true

是否成功。

Data Object

返回数据。

NextToken String CAESEgoQCg4KCmdtdF9jcmVhdGUQARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U

用来表示当前调用返回读取到的位置,空代表数据已经读取完毕。

BillingCycle String 2020-02

账期,YYYY-MM。

MaxResults Integer 20

本次请求所返回的最大记录条数。

AccountID String 185xxxxx489

账号ID。

TotalCount Integer 200

总记录数。

AccountName String test@test.aliyunid.com

账号。

Items Array of Item

账单详情。

Item
Status String PayFinish

支付状态。取值:

  • PayFinish:已支付
  • PayUnclear:未结清
  • PayUnsettle:未结算
  • NoSettle:免结算
RoundDownDiscount String 0

抹零优惠。

Item String SubscriptionOrder

账单类型:

  • Subscription
  • OrderPayAsYouGoBill
  • Refund
  • Adjustment
Currency String CNY

币种。

  • CNY
  • USD
  • JPY
BillAccountName String test@test.aliyunid.com

账单所属账号名称。

DeductedByCashCoupons Float 0

代金券抵扣。

SubscriptionType String PayAsYouGo

订阅类型。取值:

  • Subscription
  • PayAsYouGo
UsageStartTime String 2020-03-11 07:00:00

账单开始时间。

BizType String trusteeship

业务类型。

UsageEndTime String 2020-03-11 08:00:00

账单结束时间。

DeductedByCoupons Float 0

优惠券抵扣。

SubOrderId String 325345254353

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

AfterTaxAmount Float 0

税后金额。

OutstandingAmount Float 0

未结清金额。

PaymentTime String 2020-03-11 08:00:00

订单支付时间。

Tax Float 0

税费。

PretaxAmountLocal Float 0

本币金额。

PipCode String rds

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

PaymentTransactionID String 2O3AADJFEAF2PDKSFAMFCB11918

交易号。

PretaxAmount Float 100

应付金额。

CommodityCode String rds

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

ProductName String 云数据库RDS

产品名称。

RecordID String 2020xxxx5912

订单号、账单号。

AdjustAmount Float 0

信用额度退款抵扣。

ProductDetail String 关系型数据库RDS(包月)

产品明细。

PaymentCurrency String USD

支付币种。

OwnerID String 3532535235

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

DeductedByPrepaidCard Float 0

储值卡抵扣。

BillAccountID String 185xxxxx489

账单所属账号ID。

PaymentAmount Float 0

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

InvoiceDiscount Float 0

优惠金额。

ProductType String rds

产品类型。

PretaxGrossAmount Float 0

原始金额。

CashAmount Float 0

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

ProductCode String rds

产品代码。

示例

请求示例

http(s)://[Endpoint]/?Action=QuerySettleBill
&BillingCycle=2018-07
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

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

错误码

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