All Products
Search
Document Center

BSS OpenAPI:QueryBill

Last Updated:Jul 22, 2024

Queries the bills in a billing cycle.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
BillingCyclestringYes

The billing cycle, in the YYYY-MM format.

2018-07
TypestringNo

The type of the bill. Valid values:

  • SubscriptionOrder
  • PayAsYouGoBill
  • Refund
  • Adjustment
SubscriptionOrder
ProductCodestringNo

The code of the service.

rds
ProductTypestringNo

The type of the service.

rds
SubscriptionTypestringNo

The billing method. Valid values:

  • Subscription
  • PayAsYouGo

This parameter must be used together with the ProductCode parameter.

Subscription
IsHideZeroChargebooleanNo

Specifies whether to filter out a bill whose pretax gross amount is 0. By default, a bill whose pretax gross amount is 0 is not filtered out. Valid values:

  • true: filters out a bill whose pretax gross amount is 0.
  • false: does not filter out a bill whose pretax gross amount is 0.
true
IsDisplayLocalCurrencybooleanNo

Specifies whether to display local currency information in bills. The parameter will be discontinued.

false
PageNumintegerNo

The number of the page to return. Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page. Default value: 20. Maximum value: 300.

20
BillOwnerIdlongNo

The ID of the member.

123

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The status code returned.

Success
Messagestring

The message returned.

Successful!
RequestIdstring

The ID of the request.

AE3F4057-DFC9-4B81-8858-F620651010C9
Successboolean

Indicates whether the request is successful.

true
Dataobject

The returned data.

PageNuminteger

The page number of the returned page.

1
BillingCyclestring

The billing cycle, in the YYYY-MM format.

2020-02
AccountIDstring

The ID of the account.

185xxxxx489
PageSizeinteger

The number of entries returned per page.

1
TotalCountinteger

The total number of returned entries.

20
AccountNamestring

The name of the account.

test@test.aliyunid.com
Itemsarray<object>

The details of the bills.

object
Statusstring

The payment status of the bill. Valid values:

  • PayFinish: The bill is paid.
  • PayUnclear: The bill is not cleared.
  • PayUnsettle: The bill is not settled.
  • NoSettle: The bill is free of settlement.
PayFinish
RoundDownDiscountstring

The round down discount.

0
Itemstring

The type of the bill.

  • SubscriptionOrder
  • PayAsYouGoBill
  • Refund
  • Adjustment
SubscriptionOrder
Currencystring

The type of the currency.

  • CNY
  • USD
  • JPY
CNY
UsageStartTimestring

The time when the bill starts.

2020-03-11 07:00:00
SubscriptionTypestring

The billing method. Valid values:

  • Subscription
  • PayAsYouGo
PayAsYouGo
UsageEndTimestring

The time when the bill ends.

2020-03-11 08:00:00
DeductedByCouponsfloat

The amount deducted by using coupons.

0
SubOrderIdstring

The ID of the order corresponding to the bill.

325345254353
OutstandingAmountfloat

The unsettled amount of the bill.

0
AfterTaxAmountfloat

The amount paid after tax is deducted.

0
PaymentTimestring

The time when the order was paid.

2020-03-11 08:00:00
PretaxAmountLocalfloat

The pretax amount paid in local currency.

0
Taxfloat

The tax.

0
PipCodestring

The code of the service.

rds
PaymentTransactionIDstring

The ID of the transaction.

2O3AADJFEAF2PDKSFAMFCB11918
PretaxAmountfloat

The pretax amount

100
CommodityCodestring

The code of the commodity.

rds
ProductNamestring

The name of the service.

ApsaraDB RDS
RecordIDstring

The ID of the order or bill.

2020xxxx5912
AdjustAmountfloat

The amount deducted by using credit refunds.

0
ProductDetailstring

The details of the service.

ApsaraDB RDS (subscription)
PaymentCurrencystring

The currency used for payment.

USD
OwnerIDstring

The ID of the member. This parameter is returned in a multi-account payment scenario.

3532535235
ProductTypestring

The type of the service.

rds
InvoiceDiscountfloat

The discount amount.

0
PaymentAmountfloat

The amount paid with cash.

0
PretaxGrossAmountfloat

The pretax gross amount.

0
CashAmountfloat

The amount paid in cash. The amount that was deducted by using credit refunds is not included.

0
ProductCodestring

The code of the service.

rds

Examples

Sample success responses

JSONformat

{
  "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": "ApsaraDB RDS\n",
          "RecordID": "2020xxxx5912",
          "AdjustAmount": 0,
          "ProductDetail": "ApsaraDB RDS (subscription)\n",
          "PaymentCurrency": "USD",
          "OwnerID": "3532535235",
          "DeductedByPrepaidCard": 0,
          "ProductType": "rds",
          "InvoiceDiscount": 0,
          "PaymentAmount": 0,
          "PretaxGrossAmount": 0,
          "CashAmount": 0,
          "ProductCode": "rds"
        }
      ]
    }
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-03-28API Description UpdateView Change Details