tencent cloud

DescribeBillDetail

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2026-04-24 15:08:38

1. API Description

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

u200cThis API is used to get bill details.
Note:

  1. The API request may fail due to network instability or other exceptions. In this case, we recommend you manually retry the request when the API request fails.
    2.If the volume of your bill data is high (for example, if over 200 thousand bill entries are generated for a month), bill data query via APIs may be slow. We recommend you enable bill storage so that you can obtain bill files from COS buckets for analysis. For details, see Saving Bills to COS.

A maximum of 5 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: DescribeBillDetail.
Version Yes String Common Params. The value used for this API: 2018-07-09.
Region No String Common Params. This parameter is not required.
Offset Yes Integer Pagination offset. Offset=0 indicates the first page. If Limit=100, Offset=100 indicates the second page, Offset=200 indicates the third page, and so on.
Limit Yes Integer The number of entries returned at a time. The maximum value is 300.
Month No String The month is in the format of yyyy-mm. Either Month or BeginTime&EndTime must be specified. If BeginTime&EndTime is specified, the Month field is invalid. Data within the last 18 months can be pulled at most.
BeginTime No String The start time of the period in the format of yyyy-mm-dd hh:ii:ss. Either Month or BeginTime&EndTime must be specified. If BeginTime&EndTime is specified, the Month field is invalid. BeginTime and EndTime must be specified together and must be in the same month. Cross-month queries are not supported and the query results are data for the entire month. Data within the last 18 months can be pulled at most.
EndTime No String The end time of the period in the format of yyyy-mm-dd hh:ii:ss. Either Month or BeginTime&EndTime must be specified. If BeginTime&EndTime is specified, the Month field is invalid. BeginTime and EndTime must be specified together and must be in the same month. Cross-month queries are not supported and the query results are data for the entire month. Data within the last 18 months can be pulled at most.
NeedRecordNum No Integer Total number of records for access list needed for frontend pagination
1: needed, 0: not needed
PayMode No String Billing mode: prePay/postPay
ResourceId No String Queries information on a specified resource
ActionType No String Hourly settlement
Daily settlement
Yearly/monthly subscription
Spot
New yearly/monthly subscription
Yearly/monthly subscription renewal
Yearly/monthly subscription specification adjustment
Yearly/monthly subscription refund
Adjustment - deduction
Adjustment - refund
Hourly RI fee
One-off RI Fee
Hourly Savings Plan fee
Offline project deduction
Offline product deduction
ProjectId No Integer Project ID: Project ID of the resource
BusinessCode No String Product name code
Remark: If needed to obtain BusinessCode used in current month, invoke API: Get fee distribution by product
Context No String Context information returned from the last request. Paginated query of data for months with Month>=2023-05 can speed up query speed. Recommended for users with data volume at tens of thousands level. Query speed can be improved by 2-10x.
PayerUin No String Account ID of the payer (Account ID is the unique account identifier for the user in Tencent Cloud). By default, the query returns the account statement of the current account. If the group management account needs to query the self-pay bills of member accounts, enter the member account UIN in this field.

3. Output Parameters

Parameter Name Type Description
DetailSet Array of BillDetail Detail list
Total Integer Total record count, cached once every 24 hours, may be less than the actual total record count
Context String Context information of this request can be used in the request parameter of the next request to accelerate query speed.
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 Getting Bill Details

This example shows you how to get bill details.

Input Example

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

{
    "Offset": 0,
    "Limit": 1,
    "Month": "2023-07",
    "NeedRecordNum": 1,
    "ResourceId": "ins-wxf3fmq8"
}

Output Example

{
    "Response": {
        "Context": "m7u3i6W6Xt6VmK1NGvNzCXEBwkmoH/Y3ROhw2ICs3RkxMDTe6z/M5dFHpIoeEc+MOBKEhnly44tsqyRJRRL0ZNpmtARd8SDzLfknCLcJtVkf6NJGoV8FXlYLQxABqcSt",
        "DetailSet": [
            {
                "ActionType": "pre_to_post",
"ActionTypeName": "Monthly subscription to pay-as-you-go",
                "AssociatedOrder": {
                    "PrepayPurchase": "20230707400000442656611",
                    "PrepayRenew": "20230707400000442695851,20230707400000442708571"
                },
                "BillDay": "2023-07-17 00:00:00",
                "BillId": "20230707400000442821061",
                "BusinessCode": "p_cvm",
"BusinessCodeName": "Cloud Virtual Machine CVM"
                "BillMonth": "2023-07-01 00:00:00",
                "ComponentSet": [
                    {
                        "BlendedDiscount": "1.00000000",
                        "CashPayAmount": "-80.43264806",
                        "ComponentCode": "virtual_v_cvm_compute",
"ComponentCodeName": "Computing component"
                        "ComponentConfig": [
                            {
"Name": "Project"
                                "Value": "element_test"
                            },
                            {
"Name": "Host"
                                "Value": "ins-wxf3fmq8"
                            },
                            {
"Name": "Private IP Address"
                                "Value": "10.12.0.42"
                            },
                            {
"Name": "Network"
"Value": "VPC"
                            },
                            {
"Name": "Availability Zone"
"Value": "Guangzhou Zone 2"
                            }
                        ],
                        "ContractPrice": "-80.89000000",
                        "Cost": "-80.89000000",
                        "DeductedMeasure": "1",
                        "Discount": "1",
                        "IncentivePayAmount": "-0.45735194",
                        "InstanceType": "ri",
                        "ItemCode": "virtual_v_cvm_compute_s2",
"ItemCodeName": "Computing Component-Standard S2-2 Core 4G"
                        "OriginalCostWithRI": "0.00000000",
                        "OriginalCostWithSP": "0.00000000",
"PriceUnit": "CNY/each/month",
                        "RealCost": "-80.89000000",
                        "RealTotalMeasure": "1",
"ReduceType": "Discount"
                        "RiTimeSpan": "0.00000000",
                        "SPDeduction": "0.00000000",
                        "SPDeductionRate": "0.00000000",
                        "SinglePrice": "-80.89000000",
                        "SpecifiedPrice": "-80.89000000",
                        "TimeSpan": "1",
"TimeUnitName": "Month"
                        "TransferPayAmount": "0",
                        "UsedAmount": "1",
"UsedAmountUnit": "unit"
                        "VoucherPayAmount": "0"
                    }
                ],
                "FeeBeginTime": "2023-07-07 16:14:21",
                "FeeEndTime": "2023-07-07 16:14:21",
"Formula": "Refund: 343.12 CNY, cash voucher: 0 CNY, vouchers/discount coupons are non-refundable (order number 20230707400000442656611: Component cvm: cash payment 88.81 CNY - Used first tier pay-as-you-go: 0.02 CNY = remaining 88.79 CNY; order number 20230707400000442656611: Component bandwidth: cash payment 0 CNY = remaining 0 CNY; order number 20230707400000442695851: Component cvm: cash payment 172.92 CNY = remaining 172.92 CNY; order number 20230707400000442695851: Component bandwidth: cash payment 0 CNY = remaining 0 CNY; order number 20230707400000442708571: Component cvm: cash payment 84.12 CNY - original price 95.6 * usage time 3.2258% * discount: 88 = remaining 81.41 CNY;",
                "FormulaUrl": "https://buy.tencentcloud.com/price/cvm",
                "Id": "1725547686519644160",
                "OperateUin": "909619400",
                "OrderId": "20230707400000442821061",
                "OwnerUin": "909619400",
"PayModeName": "Monthly Subscription",
                "PayTime": "2023-07-07 16:14:18",
                "PayerUin": "909619400",
                "PriceInfo": [
OS: linux
Continuous usage duration T: No tiers
Platform: Cloud Platform
                ],
                "ProductCode": "sp_cvm_s2",
"ProductCodeName": "Cloud Virtual Machine (CVM) - Standard S2"
                "ProjectId": 1002227,
                "ProjectName": "element_test",
                "RegionId": "1",
"RegionName": "South China (Guangzhou)",
                "ResourceId": "ins-wxf3fmq8",
                "ResourceName": "ins-wxf3fmq8",
                "Tags": [],
"ZoneName": "Guangzhou Zone 2"
            }
        ],
        "RequestId": "ca7573cb-473d-40f3-8c58-7be43ae60195",
        "Total": 14
    }
}

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
FailedOperation.QueryCountFailed Failed to get the number of data entries.
InternalError Internal error.
InternalError.GatewayError Gateway error.
InternalError.UnknownError Undefined exception.
InvalidParameter Invalid parameter.
InvalidParameterValue Invalid parameter value.
UnsupportedOperation Operation unsupported.

Ajuda e Suporte

Esta página foi útil?

comentários