tencent cloud

Billing Center

Release Notes and Announcements
Release Notes
Product Announcements
Billing Details
Billing Mode
Frozen Funds
Balance Notifications
Refunds
Billing Mode
Yearly/Monthly Subscription Products
Purchase Guide
Purchasing Cloud Services
Payment Methods
Beneficiary Account Bank Transfer
Top-up
Payment Methods for Prepaid Products
Post-paid Account Payment
Auto-payment
Transactions
Promo Vouchers
Savings Plan
Renewal Management
Bill Management
View bills
Bill Introduction
Fields in Bills
Usage Details
Billing Export Center
Bill subscription
Saving Bills to COS
Granting Billing-related CAM Access
Self-Service Invoice
Tax Management
FOCUS 1.0
FOCUS 1.0 Conformance Gaps
Cost Management
Consumption Bill Overview
Consumption Bill Description
Anomaly Detection
Fields in Consumption Bill
Cost Explorer
Budget Management
Cost Allocation Management
Cost Allocation Units
Cost Allocation Bill
Cost Allocation Tags
Cost Allocation Backtracking
API Documentation
API Category
Funds Management APIs
Order Management APIs
Resource Management APIs
Bill Management APIs
Cost Allocation Management APIs
Cost Management APIs
Making API Requests
Organization Account APIs
Data Types
Error Codes
FAQs
Bills
Promo Vouchers
Renewal

DescribeCostSummaryByResource

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-11-13 20:46:17

1. API Description

Domain name for API request: billing.intl.tencentcloudapi.com.

This API is used to obtain consumption details summarized by resource.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeCostSummaryByResource.
Version Yes String Common Params. The value used for this API: 2018-07-09.
Region No String Common Params. This parameter is not required.
BeginTime Yes String The value must be of the same month as EndTime. The query period must start and end on the same month and the query result returned will be of the entire month. For example, if both BeginTime and EndTime are 2018-09, the data returned will be for the entire month of September 2018.
EndTime Yes String The value must be of the same month as BeginTime. The query period must start and end on the same month and the query result returned will be of the entire month. For example, if both BeginTime and EndTime are 2018-09, the data returned will be for the entire month of September 2018.
Limit Yes Integer Data quantity per fetch. The maximum value is 100.
Offset Yes Integer Offset, which starts from 0 by default
PayerUin No String UIN of the user querying the bill data
NeedRecordNum No Integer Whether to return the record count. 0 for no, 1 for yes. Default is no.
NeedConditionValue No Integer Whether to return filter criteria. 0 for no, 1 for yes. Default is no.
Conditions No Conditions Filter criteria. It only supports ResourceKeyword (resource keyword, which supports fuzzy query by resource ID or resource name), ProjectIds (project ID), RegionIds (region ID), PayModes (payment mode, prePay or postPay), HideFreeCost (whether to hide zero-amount transactions, 0 or 1), and OrderByCost (sorting rule by fees, desc or asc).

3. Output Parameters

Parameter Name Type Description
Ready Integer Data readiness, 0 for not ready, 1 for ready
Total ConsumptionSummaryTotal Consumption detailsNote: This field may return null, indicating that no valid values can be obtained.
ConditionValue ConsumptionResourceSummaryConditionValue Filter criteria
Note: This field may return null, indicating that no valid values can be obtained.
RecordNum Integer Record countNote: This field may return null, indicating that no valid values can be obtained.
Data Array of ConsumptionResourceSummaryDataItem Resource consumption detailsNote: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Obtaining consumption details summarized by resource

This example shows you how to obtain consumption details summarized by resource.

Input Example

POST / HTTP/1.1
Host: billing.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCostSummaryByResource
<Common request parameters>

{
    "EndTime": "2018-11",
    "Limit": "1",
    "BeginTime": "2018-11",
    "Offset": "0"
}

Output Example

{
    "Response": {
        "Ready": 1,
        "Total": {
            "RealTotalCost": "abc"
        },
        "ConditionValue": {
            "Business": [
                {
                    "BusinessCode": "abc",
                    "BusinessCodeName": "abc"
                }
            ],
            "Project": [
                {
                    "ProjectId": "abc",
                    "ProjectName": "abc"
                }
            ],
            "Region": [
                {
                    "RegionId": "abc",
                    "RegionName": "abc"
                }
            ],
            "PayMode": [
                {
                    "PayMode": "abc",
                    "PayModeName": "abc"
                }
            ]
        },
        "RecordNum": 1,
        "Data": [
            {
                "ResourceId": "abc",
                "ResourceName": "abc",
                "RealTotalCost": "abc",
                "CashPayAmount": "abc",
                "ProjectId": "abc",
                "ProjectName": "abc",
                "RegionId": "abc",
                "RegionName": "abc",
                "PayMode": "abc",
                "PayModeName": "abc",
                "BusinessCode": "abc",
                "BusinessCodeName": "abc",
                "ConsumptionTypeName": "abc",
                "RealCost": "abc",
                "FeeBeginTime": "abc",
                "FeeEndTime": "abc",
                "DayDiff": "abc",
                "DailyTotalCost": "abc",
                "OrderId": "abc",
                "VoucherPayAmount": "abc",
                "IncentivePayAmount": "abc",
                "TransferPayAmount": "abc",
                "PayerUin": "abc",
                "OwnerUin": "abc",
                "OperateUin": "abc",
                "ProductCode": "abc",
                "ProductCodeName": "abc",
                "RegionType": "abc",
                "RegionTypeName": "abc",
                "Extend1": "abc",
                "Extend2": "abc",
                "Extend3": "abc",
                "Extend4": "abc",
                "Extend5": "abc",
                "InstanceType": "abc",
                "InstanceTypeName": "abc",
                "PayTime": "abc",
                "ZoneName": "abc",
                "ComponentConfig": "abc"
            }
        ],
        "RequestId": "abc"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError.GatewayError Gateway error.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백