ListConsumeSummary

Updated at:
Copy as MD

Queries the consumption summary for a specified billing month or billing date, and supports viewing expenses by dimensions such as billing item, resource, product, and account.

Operation description

  1. The final billing details for the current month will be issued at 12:00 on the 3rd day of the following month. Query results before this time are for reference only and should not be used as the basis for reconciliation. Minor scenarios may occur during the month, including but not limited to delayed billing, refunds, adjustments, and overdue payment write-offs.

  2. Billing details are updated with a 24-hour delay compared to actual consumption. Information related to instance IDs, such as resource names, is updated with a 48-hour delay.

  3. Billing data does not support providing specific expenses for individual attached resources, such as domain names, buckets, and EIPs, of split-type cloud products, such as CDN, OSS, and Internet Shared Bandwidth. To view data that includes attached resources, go to the split bill details.

  4. Data for the last 18 months is supported.

  5. Amounts, usage, and durations are returned as character strings. Use decimal numeric types to process amounts to avoid precision loss caused by binary floating-point numbers.

  6. Whether a field has a value depends on the aggregation dimension, product billable methods, and billing data. Null values or unreturned fields do not indicate that the value is zero.

  7. This operation uses the field Glossary of the new version of bills. For related concepts, see Differences and field descriptions of the new version of bills. The English paths in the help documentation refer to OSS subscribe fields. For the parameter names, field names, and return structure of this operation, refer to this topic.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

bss:DescribeBill

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

DimensionType

string

No

The aggregation dimension.

Valid values:

  • BILLING_ITEM: aggregates by billing item. This is the default value.

  • RESOURCE: aggregates by resource.

  • PRODUCT: aggregates by product.

  • ACCOUNT: aggregates by account.

BILLING_ITEM

CommonFilters

array<object>

No

The common filter conditions. Valid conditions for different fields take effect simultaneously. For supported fields and operations, see "Common filtering" in the supplementary description of request parameters.

[{"FilterField":"ProductCode","Operation":"IN","Values":["ecs"]}]

object

No

A single common filter condition, which includes the filter field FilterField, the operator Operation, and the string array Values.

{"FilterField":"ProductCode","Operation":"IN","Values":["ecs"]}

Operation

string

No

The operator. Default value: IN. IN indicates inclusion or exact match, NOT indicates exclusion, and PREFIX indicates prefix match. For the specific support scope, see "Common filtering" in the supplementary description of request parameters.

IN

FilterField

string

No

The name of the filter field. For supported fields and operations, see "Common filtering" in the supplementary description of request parameters.

ProductCode

Values

array

No

Filter values always use string arrays, including single values, Boolean values, and account IDs.

["ecs"]

string

No

A single filter value. Account IDs and Boolean values are also passed as strings.

ecs

Period

object

No

The query time range, which specifies the time granularity, start time, and end time.

{"Granularity":"DAILY","StartTime":"2026-10-01","EndTime":"2026-10-07"}

Granularity

string

No

The time granularity. Valid values:

  • MONTHLY: aggregates by month.

  • DAILY: aggregates by day.

DAILY

StartTime

string

No

If you query by month, the format is yyyy-MM.

If you query by day, the format is yyyy-MM-dd.

2026-10-01

EndTime

string

No

If you query by month, only one month is supported per query. The value must be the same as the start month and formatted as yyyy-MM.

If you query by day, this parameter is required and formatted as yyyy-MM-dd. The end date cannot be earlier than the start date, and the start and end dates must be in the same month.

2026-10-07

NextToken

string

No

The token for the next page of query. Do not specify this parameter for the first request. For subsequent requests, pass the value returned in the previous response.

example-next-token

MaxResults

integer

No

The maximum number of records expected to be returned per query. We recommend that you explicitly pass a positive integer. Keep this value unchanged during pagination. The actual number of returned records may be less than this value.

20

EcIdAccountIds

array<object>

No

The query scope for enterprises and accounts. If this parameter is not specified, the default billing scope of the current calling account is used. You can specify only one enterprise object per request, and the actual scope is limited by permissions.

[{"EcId":"123456","AccountIds":[1234567890123456]}]

object

No

The query scope for an enterprise and its accounts. You can specify only one enterprise object per request, and the actual query scope is limited by account permissions.

{"EcId":"123456","AccountIds":[1234567890123456]}

EcId

string

No

The ID of the enterprise entity.

123456

AccountIds

array

No

The list of account IDs to query. This parameter is required when an enterprise object is specified. If the entire EcIdAccountIds parameter is omitted, the data of the current calling account is queried by default.

[1234567890123456]

integer

No

The ID of the account to query, which is an int64 integer. The actual query scope is limited by account authorization.

1234567890123456

The enterprise, account, and resource identifiers in the examples are demonstration data. Replace them with actual values that you have permission to access when making a call. The JSON shows the logical structure of the request parameters. When making an actual call, pass them according to the parameter serialization method of the SDK or OpenAPI.

Omit NextToken in the first request. For subsequent pagination, pass the non-empty NextToken from the previous response as-is, and keep other query conditions and MaxResults unchanged. The example-next-token in the field examples is only a placeholder and cannot be used in actual requests.

Query billing item summary by day

{
  "Action": "ListConsumeSummary",
  "Version": "2023-09-30",
  "Period": {
    "Granularity": "DAILY",
    "StartTime": "2026-10-01",
    "EndTime": "2026-10-07"
  },
  "DimensionType": "BILLING_ITEM",
  "EcIdAccountIds": [
    {
      "EcId": "123456",
      "AccountIds": [
        1234567890123456
      ]
    }
  ],
  "CommonFilters": [
    {
      "FilterField": "ProductCode",
      "Operation": "IN",
      "Values": [
        "ecs"
      ]
    }
  ],
  "MaxResults": 20
}

Query billing item summary by month

{
  "Action": "ListConsumeSummary",
  "Version": "2023-09-30",
  "Period": {
    "Granularity": "MONTHLY",
    "StartTime": "2026-10"
  },
  "DimensionType": "BILLING_ITEM",
  "MaxResults": 20
}

General filtering

The following names are the values of FilterField and are passed in CommonFilters.

FilterFieldOperationNumber of valuesDescriptionExample values
ProductCodeIN, NOTMultiple valuesThe product code, which uniquely identifies a specific cloud service.["ecs","oss"]
CommodityCodeIN, NOTMultiple valuesThe commodity code, which uniquely identifies a specific commodity under a cloud service.["ecs"]
RegionCodeIN, NOTMultiple values, up to 100The region code, which represents the code of the logical region where the cloud resource is located.["cn-hangzhou"]
BillingItemCodeIN, NOTMultiple values, up to 100The billing item code, which identifies the billing item to which the fee belongs. This condition is not supported for RESOURCE aggregation.["example_billing_item"]
ServiceEntityCodeINMultiple values, up to 100The service entity code, which identifies the company that provides the product or service. Pass the code instead of the company display name. This condition is not supported for RESOURCE aggregation.["example_service_entity_code"]
InstanceIdIN, PREFIXSingle valueThe instance ID at the billing granularity. Filters by the instance ID that aggregates fees in the bill. Supports exact match or prefix match. Used for BILLING_ITEM and RESOURCE aggregation.["i-example001"] or ["i-example"]
ResourceIdIN, PREFIXSingle valueThe resource ID. Filters by the ID that uniquely identifies the resource in the cloud service. Supports exact match or prefix match. Used only for BILLING_ITEM and RESOURCE aggregation in the new bill.["i-example001"] or ["i-example"]
InstanceNameINSingle valueThe resource name, which is the name configured by the user for the cloud resource. Used for BILLING_ITEM and RESOURCE aggregation. The query capability depends on whether the service supports related resource information queries.["example-resource"]
ResourceOwnerAccountIdINMultiple valuesThe resource owner account ID, which is the ID of the account that actually uses the resource. Each value must be a valid int64 decimal string and must not contain whitespace or non-numeric characters.["1234567890123456"]
FilterZeroBillsINSingle valueSpecifies whether to filter out aggregated records with a payable amount of zero. "true" means to filter out, and "false" means not to filter out. If not specified, no filtering is performed.["true"]

Filtering rules:

  1. Different fields are combined with the AND operator. For the same multi-value field, when IN is used, it matches any value in the list. When NOT is used, it excludes the values in the list.

  2. Specify field names with the exact case shown in the table. The fields and operators in the table support case normalization. Matching for resource IDs, instance IDs, and prefixes remains case-sensitive.

  3. Conditions without a field name or valid values generally do not participate in filtering. Unrecognized field names may be ignored. Do not use an empty array to indicate "match null values", and do not rely on unlisted fields or operators.

  4. PREFIX matches by literal prefix. * and ? are treated as regular characters, not wildcards. Matching for inclusion at any position is not supported.

Response elements

Element

Type

Description

Example

object

A successful response is an object where Data is an array of summary records. The field path Data[].FieldName indicates a field within an array element. The actual JSON uses the corresponding field names.

{}

NextToken

string

The query token for the next page. If a non-empty value is returned, pass it as-is in the next request and keep other query conditions unchanged. If it is not returned or is empty, pagination ends.

example-next-token

MaxResults

integer

The maximum number of records per page used in this query.

20

Data

array<object>

The consumption summary records returned in this request. An empty array is returned if no matching records are found.

[]

object

A single consumption summary record. It includes billing, account, product, resource, usage, price, and amount information. Whether a field is populated depends on the summary dimension, product Billable methods, and billing data.

{}

ChargeType

string

The billing method. Returns the display name, such as subscription or pay-as-you-go.

Pay-as-you-go

ListUnitPrice

string

The list price on the official website, which is the unit list price of the commodity. It differs from the total list price ListPrice. In scenarios such as tiered pricing, you cannot recalculate the fee by simply multiplying a single unit price by the total usage.

1

ListPriceUnit

string

The price unit, which is the unit corresponding to the list price ListUnitPrice on the official website, such as CNY/GB.

CNY/GB/Hour

BillingQuantity

string

The usage that is ultimately used for fee calculation. If usage deduction applies, this is the usage before deduction minus the usage deducted by resource plans, free quotas, and other deductions.

100

BillingQuantityUnit

string

The usage unit, used in conjunction with BillingQuantity.

GB

ChargeDuration

string

The duration, which represents the purchase or usage duration involved in billing. It has a value only when the billing formula involves time. If duration deduction applies, this is the duration before deduction minus the deducted duration.

1

ChargeDurationUnit

string

The duration unit, used in conjunction with ChargeDuration.

Hour

BillingFormula

string

The billing formula, which describes how the total list price is calculated. It should be understood in combination with the list price on the official website, usage, duration, and other billing factors.

List price × Usage × Duration

SavingPlanDeductAmount

string

The savings plan deduction amount, which is the committed spend of the savings plan consumed to complete this deduction. It is not the list price amount of the deducted resource and cannot replace SavingPlanDeductListPrice for deduction from the total list price.

8

AmountAfterSavingPlanDeduction

string

The amount after savings plan deduction, which is the remaining amount after deducting the list price portion covered by the savings plan. When all related fields are available, it equals ListPrice - SavingPlanDeductListPrice.

80

AmountAfterPromotionDeduction

string

The amount after discount, which represents the amount after applying official website discounts, contract discounts, and other promotions, before deducting coupons. When all related fields are available, it equals AmountAfterSavingPlanDeduction - PromotionAmount.

70

AmountAfterCouponDeduction

string

The amount after coupon deduction, which is the result of deducting coupons from the amount after discount. When all related fields are available, it equals AmountAfterPromotionDeduction - CouponAmount.

65

HashKey

string

The summary record identifier, used as an opaque string. It can be empty.

example-summary-key

ResourceId

string

The resource ID, used to uniquely identify a cloud resource in the corresponding cloud product or service.

i-example001

InstanceId

string

The instance ID at the billing granularity, which represents the instance identity used to aggregate fees when a cloud product generates a bill. The billing granularity may differ from the resource management granularity, so it may differ from ResourceId.

i-example001

InstanceName

string

The resource name, which is the name set by the user for the cloud resource. Whether it is returned depends on whether the product supports querying and whether the resource information is available.

example-resource

InstanceSpec

string

The specifications, used to describe the specification information corresponding to the billing item.

example.spec

RegionName

string

The region, which represents the display name of the region where the cloud resource is located. For products sold by region, it usually corresponds to the region selected when placing the order.

China (Hangzhou)

RegionCode

string

The region code, which represents the code of the logical region where the cloud resource is located.

cn-hangzhou

BillingMonth

string

The billing month, which represents the billing month to which the fee belongs, in the format of yyyy-MM.

2026-10

BillingDate

string

The billing date, which is the consumption date of the cloud product, in the format of yyyy-MM-dd. It has a value only when summarized by day.

2026-10-01

LineItemType

string

The line item type, which describes the nature of the fee, such as subscription prepaid fee, subscription postpaid fee, subscription unsubscription fee, pay-as-you-go fee for cloud resources, adjustment fee, or round-down fee. Returns the display name.

Pay-as-you-go fee for cloud resources

ConsumeType

string

The transaction type, which describes the transaction behavior that generated the bill, such as new purchase, renewal, upgrade, downgrade, unsubscription, pay-as-you-go, or adjustment. Returns the display name.

Pay-as-you-go

ServiceEntity

string

The service entity, which is the name of the company that actually provides the product or service. Different products may correspond to different companies.

Sample service entity

ResourceOwnerAccountId

string

The resource ownership account ID, which is the ID of the account that actually uses the cloud resource instance. It may differ from the purchasing account.

1234567890123456

ResourceOwnerAccountName

string

The resource ownership account, which is the name of the account that actually uses the cloud resource instance. It may differ from the purchasing account.

owner@example.com

ResourcePurchaseAccountId

string

The resource purchasing account ID, which is the ID of the account that placed the order to purchase the cloud resource instance.

1234567890123456

ResourcePurchaseAccountName

string

The resource purchasing account, which is the name of the account that placed the order to purchase the cloud resource instance.

buyer@example.com

ProductCode

string

The product code, used to uniquely identify a specific cloud product.

ecs

ProductName

string

The product name, which is the display name of the cloud product.

Elastic Compute Service

CommodityCode

string

The commodity code, used to uniquely identify a specific commodity under a cloud product.

ecs

CommodityName

string

The commodity name, which is the display name of a specific commodity under a cloud product.

Sample commodity

BillingItemCode

string

The billing item code, which identifies the billing item to which the fee belongs.

example_billing_item

BillingItemName

string

The billing item name, which is the display name of the billing item to which the fee belongs.

Sample billing item

Currency

string

The currency, which represents the currency used for the list price and amounts in this record. For example, CNY indicates Chinese Yuan.

CNY

ListPrice

string

The total list price, which represents the total amount calculated based on the list price for the purchased cloud resource configuration, before deducting savings plan deductions, discounts, and coupons. Note that ListPrice in this API is the total amount. For the unit list price, see ListUnitPrice.

100

PromotionAmount

string

The discount amount, which represents the total discounts from official website promotions, contract discounts, and other offers. Coupon deductions are separately recorded in CouponAmount.

10

CouponAmount

string

The coupon deduction amount, which is the fee covered by coupons. This amount cannot be used for invoicing.

5

RequireAmount

string

The payable amount, which is the fee to be paid after savings plan deductions, discounts, and coupon deductions. In the new version of bills, this corresponds to the payable amount (tax-inclusive) caliber. For fee verification, refer to the actual return value of this field.

65

SavingPlanDeductListPrice

string

The savings plan deduction list price, which is the amount calculated based on the list price for the pay-as-you-go resource fees deducted by the savings plan.

20

PurchaseConfiguration

string

The configuration, used to describe the configuration options corresponding to the billing item.

Sample configuration

RequestId

string

The unique identifier of this request, used for troubleshooting.

00000000-0000-4000-8000-000000000001

The following is an example of a successful response for querying billing item aggregations by day. Accounts, resources, commodities, units, prices, and amounts are demonstration values used to illustrate the structure and calculation relationships, and do not represent actual product pricing. Whether a field has a value depends on the aggregation dimension, product billing method, and actual bill.

Amounts, usage, duration, and returned account IDs use JSON strings, while MaxResults uses an integer. In the example, the total list price is 1 × 100 × 1 = 100, and the payable amount is 100 - 20 - 10 - 5 = 65. The 8 in SavingPlanDeductAmount represents the consumed savings plan commitment and does not replace SavingPlanDeductListPrice in the deduction.

The NextToken in the example is only a placeholder value indicating that subsequent pages exist. Use the API return value for actual pagination. When there are no subsequent pages, NextToken is empty or not returned.

{
  "RequestId": "00000000-0000-4000-8000-000000000001",
  "MaxResults": 20,
  "NextToken": "example-next-token",
  "Data": [
    {
      "HashKey": "example-summary-key",
      "BillingMonth": "2026-10",
      "BillingDate": "2026-10-01",
      "ChargeType": "Pay-as-you-go",
      "LineItemType": "Pay-as-you-go cloud resource fee",
      "ConsumeType": "Pay-as-you-go",
      "ServiceEntity": "Example service entity",
      "ResourcePurchaseAccountId": "1234567890123456",
      "ResourcePurchaseAccountName": "buyer@example.com",
      "ResourceOwnerAccountId": "1234567890123456",
      "ResourceOwnerAccountName": "owner@example.com",
      "ProductCode": "ecs",
      "ProductName": "Elastic Compute Service",
      "CommodityCode": "ecs",
      "CommodityName": "Example commodity",
      "BillingItemCode": "example_billing_item",
      "BillingItemName": "Example billing item",
      "ResourceId": "i-example001",
      "InstanceId": "i-example001",
      "InstanceName": "example-resource",
      "InstanceSpec": "example.spec",
      "RegionCode": "cn-hangzhou",
      "RegionName": "China (Hangzhou)",
      "PurchaseConfiguration": "Example configuration",
      "BillingQuantity": "100",
      "BillingQuantityUnit": "GB",
      "ListUnitPrice": "1",
      "ListPriceUnit": "CNY/GB/hour",
      "BillingFormula": "List price × Usage × Duration",
      "Currency": "CNY",
      "ListPrice": "100",
      "SavingPlanDeductListPrice": "20",
      "SavingPlanDeductAmount": "8",
      "AmountAfterSavingPlanDeduction": "80",
      "PromotionAmount": "10",
      "AmountAfterPromotionDeduction": "70",
      "CouponAmount": "5",
      "AmountAfterCouponDeduction": "65",
      "RequireAmount": "65",
      "ChargeDuration": "1",
      "ChargeDurationUnit": "Hour"
    }
  ]
}

Field return conditions and amount calculation

Resource and instance information mainly applies to BILLING_ITEM and RESOURCE. Aggregation results without resource granularity do not guarantee the return of these fields.

Usage, duration, list unit price, and billing formula are mainly used for BILLING_ITEM aggregation. Other dimensions do not guarantee values. Usage must be understood in combination with the billing item, unit, and formula. Usage under different units or billing rules cannot be directly added together.

The amount example shows a billing item aggregation with complete fields. In the new bill aggregation, the deduction order is the total list price minus the subscription deduction list price, and then minus the promotion amount and coupon deduction amount. Do not use SavingPlanDeductAmount to replace SavingPlanDeductListPrice in this deduction.

When the subscription deduction list price is missing, the amount after subscription deduction may be empty, and the amount after promotion is calculated as ListPrice - PromotionAmount. Historical bills may lack some intermediate amount fields. Fee verification is subject to the actually returned RequireAmount. Do not treat missing amounts as zero to calculate the payable amount.

Examples

Success response

JSON format

{
  "NextToken": "example-next-token",
  "MaxResults": 20,
  "Data": [
    {
      "ChargeType": "Pay-as-you-go",
      "ListUnitPrice": "1",
      "ListPriceUnit": "CNY/GB/Hour",
      "BillingQuantity": "100",
      "BillingQuantityUnit": "GB",
      "ChargeDuration": "1",
      "ChargeDurationUnit": "Hour",
      "BillingFormula": "List price × Usage × Duration",
      "SavingPlanDeductAmount": "8",
      "AmountAfterSavingPlanDeduction": "80",
      "AmountAfterPromotionDeduction": "70",
      "AmountAfterCouponDeduction": "65",
      "HashKey": "example-summary-key",
      "ResourceId": "i-example001",
      "InstanceId": "i-example001",
      "InstanceName": "example-resource",
      "InstanceSpec": "example.spec",
      "RegionName": "China (Hangzhou)",
      "RegionCode": "cn-hangzhou",
      "BillingMonth": "2026-10",
      "BillingDate": "2026-10-01",
      "LineItemType": "Pay-as-you-go",
      "ConsumeType": "Pay-as-you-go",
      "ServiceEntity": "Sample service entity",
      "ResourceOwnerAccountId": "1234567890123456",
      "ResourceOwnerAccountName": "owner@example.com",
      "ResourcePurchaseAccountId": "1234567890123456",
      "ResourcePurchaseAccountName": "buyer@example.com",
      "ProductCode": "ecs",
      "ProductName": "Elastic Compute Service",
      "CommodityCode": "ecs",
      "CommodityName": "Sample commodity",
      "BillingItemCode": "example_billing_item",
      "BillingItemName": "Sample billing item",
      "Currency": "CNY",
      "ListPrice": "100",
      "PromotionAmount": "10",
      "CouponAmount": "5",
      "RequireAmount": "65",
      "SavingPlanDeductListPrice": "20",
      "PurchaseConfiguration": "Sample configuration"
    }
  ],
  "RequestId": "00000000-0000-4000-8000-000000000001"
}

Error codes

HTTP status code

Error code

Error message

Description

400 MultiAccountQueryNotSupported The historical month dimension summary does not support multi-account query. Under the "By Product/By Account" dimension, only single account viewing is supported for this month. Switch to other dimensions to view multiple accounts or obtain through export.
400 InnerSubAccountNoQueryPricePermission In view of data security and compliance requirements, please understand the inconvenience caused to you by controlling the amount-related information and permissions of the group's cloud account. Due to data security and compliance requirements, the Group's cloud account amount information permissions are controlled. Please understand the inconvenience caused. You can view it through HCRM/cloud platform. For details, please refer to: https://aliyuque.antfin.com/yunfei.xyf/kr0b8h/yvdm6izaeulmq8g2 。
400 SubAccountNoQueryPricePermission This page cannot be accessed because you do not have discount rights query permissions. Contact the main account to go to the RAM console for authorization. The Action to be authorized is bss:QueryPrice. This page cannot be accessed because you do not have discount rights query permissions. Contact the main account to go to the RAM console for authorization. The Action to be authorized is bss:QueryPrice.
400 AccountNoQueryPricePermission This page cannot be accessed because you do not have discount rights query permissions. Please contact the main account to go to the cost center for authorization. The permission point that needs authorization is queryprice. This page cannot be accessed because you do not have discount rights query permissions. Please contact the main account to go to the cost center for authorization. The permission point that needs authorization is queryprice.
400 InnerAccountNoQueryPricePermission In view of data security and compliance requirements, please understand the inconvenience caused to you by controlling the amount-related information and permissions of the group's cloud account. More questions please refer to the document. Due to data security and compliance requirements, the Group's cloud account amount information permissions are controlled. Please understand the inconvenience caused. You can view it through HCRM/cloud platform. For details, please refer to: https://aliyuque.antfin.com/yunfei.xyf/kr0b8h/yvdm6izaeulmq8g2 。

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.