tencent cloud

Feedback

DescribeCostSummaryByRegion

Last updated: 2024-05-28 17:27:11

1. API Description

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

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

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: DescribeCostSummaryByRegion.
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.

3. Output Parameters

Parameter Name Type Description
Ready Integer Data readiness, 0 for not ready, 1 for ready
Total ConsumptionSummaryTotal Consumption details
Data Array of ConsumptionRegionSummaryDataItem Consumption details summarized by region
RecordNum Integer Record count. The system returns null when NeedRecordNum is 0.Note: 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 region

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

Input Example

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

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

Output Example

{
    "Response": {
        "Ready": 1,
        "RecordNum": 0,
        "Total": {
            "RealTotalCost": "91.04"
        },
        "Data": [
            {
                "RegionId": "18",
                "RegionName": "Asia Pacific (Seoul)",
                "RealTotalCost": "67.00",
                "CashPayAmount": "66.99654091",
                "VoucherPayAmount": "0.00000000",
                "IncentivePayAmount": "0.00000000",
                "TransferPayAmount": "0.00000000",
                "Trend": {
                    "Type": "none",
                    "Value": null
                },
                "Business": [
                    {
                        "BusinessCode": "p_cos",
                        "BusinessCodeName": "Cloud Object Storage",
                        "RegionName": "Asia Pacific (Seoul)",
                        "RealTotalCost": "66.99654091",
                        "CashPayAmount": "66.99654091",
                        "IncentivePayAmount": "0.00000000",
                        "VoucherPayAmount": "0.00000000",
                        "TransferPayAmount": "0.00000000",
                        "Trend": {
                            "Type": "none",
                            "Value": null
                        }
                    }
                ]
            }
        ],
        "RequestId": "cdf3ef28-5ec7-4915-9cc8-a07210dc1f28"
    }
}

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

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support