DescribeBillDetail

最后更新时间:2021-12-03 16:58:02

1. API Description

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

This API is used to query bill details.

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 parameter. The value used for this API: DescribeBillDetail.
Version Yes String Common parameter. The value used for this API: 2018-07-09.
Region No String Common parameter. This parameter is not required for this API.
Offset Yes Integer Offset
Limit Yes Integer Quantity, maximum is 100
PeriodType No String The period type. byUsedTime: By usage period; byPayTime: By payment period. Must be the same as the period of the current monthly bill of the Billing Center. You can check your bill statistics period type at the top of the Bill Overview page.
Month No String Month; format: yyyy-mm. You only have to enter either Month or BeginTime and EndTime. When you enter values for BeginTime and EndTime, Month becomes invalid. This value must be no earlier than the month when Bill 2.0 is activated; last 24 months data are available.
BeginTime No String The start time of the period; format: Y-m-d H:i:s. You only have to enter either Month or BeginTime and EndTime. When you enter values for BeginTime and EndTime, Month becomes invalid. BeginTime and EndTime must be inputted as a pair. This value must be no earlier than the month when Bill 2.0 is activated; last 24 months data are available.
EndTime No String The end time of the period; format: Y-m-d H:i:s. You only have to enter either Month or BeginTime and EndTime. When you enter values for BeginTime and EndTime, Month becomes invalid. BeginTime and EndTime must be inputted as a pair. This value must be no earlier than the month when Bill 2.0 is activated; last 24 months data are available.
NeedRecordNum No Integer Indicates whether or not the total number of records of accessing the list is required, used for frontend pages.
1 = yes, 0 = no
ProductCode No String Queries information on a specified product
PayMode No String Billing mode: prePay/postPay
ResourceId No String Queries information on a specified resource
ActionType No String Action type to query. Valid values:
Purchase
Renewal
Modify
Refund
Deduction
Hourly settlement
Daily settlement
Monthly settlement
Offline project deduction
Offline deduction
adjust-CR
adjust-DR
One-off RI Fee
Spot
Hourly RI fee
New monthly subscription
Monthly subscription renewal
Monthly subscription specification adjustment
Monthly subscription specification adjustment
Monthly subscription refund
ProjectId No Integer Project ID: ID of the project to which the resource belongs
BusinessCode No String Business code
Note: To query business codes used in the current month, call DescribeBillSummaryByProduct.

3. Output Parameters

Parameter Name Type Description
DetailSet Array of BillDetail Details list
Total Integer Total number of records
Note: This field may return null, indicating that no valid value was found.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Getting bill details

Input Example

https://billing.tencentcloudapi.com/?Action=DescribeBillDetail
&Month=2018-07
&PeriodType=byPayTime
&Offset=0
&Limit=1
&BeginTime=2018-11-0100:00:00
&EndTime=2018-11-0123:59:59
&NeedRecordNum=1
&ResourceId=ins-49zhx6z1
&<Common request parameters>

Output Example

{
    "Response": {
        "DetailSet": [
            {
                "PayerUin": "909619400",
                "OwnerUin": "909619400",
                "OperateUin": "909619400",
                "BusinessCodeName": "CVM",
                "BusinessCode": "p_cvm",
                "ProductCodeName": "CVM – Standard SA2",
                "ProductCode": "sp_cvm_sa2",
                "PayModeName": "Monthly subscription",
                "ProjectName": "Default project",
                "ProjectId": "0",
                "RegionName": "Southwest China (Chengdu)"
                "RegionId": "16",
                "ZoneName":"Chengdu Zone 1",
                "ResourceId": "ins-m1okcccv",
                "ResourceName": "windows-1GB-cd-1880",
                "ActionType": "prepay_renew",
                "ActionTypeName": "Monthly subscription renewal",
                "OrderId": "20201102400000425173641",
                "BillId": "20201102400000425173641",
                "PayTime": "2020-11-02 02:29:57",
                "FeeBeginTime": "2020-11-02 12:05:15",
                "FeeEndTime": "2020-12-02 12:05:15",
                "ComponentSet": [
                    {
                        "ComponentCodeName": "Bandwidth",
                        "ComponentCode": "v_cvm_bandwidth",
                        "ItemCodeName":"Bandwidth – Bill-by-bandwidth",
                        "ItemCode": "sv_cvm_bandwidth_prepay",
                        "SinglePrice": "18",
                        "ContractPrice": "17.46",
                        "SpecifiedPrice": "18",
                        "PriceUnit":"USD/Mbps/Month",
                        "UsedAmount": "1",
                        "UsedAmountUnit": "Mbps",
                        "TimeSpan": "1",
                        "TimeUnitName": "Month",
                        "Cost": "18",
                        "Discount": "0.97",
                        "ReduceType":"Discount",
                        "RealCost": "17.46",
                        "VoucherPayAmount": "0",
                        "CashPayAmount": "17.46",
                        "IncentivePayAmount": "0"
                    },
                    {
                        "ComponentCodeName":"Computing component",
                        "ComponentCode": "virtual_v_cvm_compute",
                        "ItemCodeName":"Computing component – Standard SA2 – 1 CPU core and 1 GB memory",
                        "ItemCode": "virtual_v_cvm_compute_sa2",
                        "SinglePrice": "18",
                        "ContractPrice": "17.46",
                        "SpecifiedPrice": "18",
                        "PriceUnit": "USD/Count/Month",
                        "UsedAmount": "1",
                        "UsedAmountUnit": "Count",
                        "TimeSpan": "1",
                        "TimeUnitName": "Month",
                        "Cost": "18",
                        "Discount": "0.97",
                        "ReduceType":"Discount",
                        "RealCost": "17.46",
                        "VoucherPayAmount": "0",
                        "CashPayAmount": "17.46",
                        "IncentivePayAmount": "0"
                    },
                    {
                        "ComponentCodeName":"System disk",
                        "ComponentCode": "v_cvm_rootdisk",
                        "ItemCodeName":"Premium Cloud Storage",
                        "ItemCode": "sv_cvm_rootdisk_cbspremium",
                        "SinglePrice": "0.35",
                        "ContractPrice": "0.3395",
                        "SpecifiedPrice": "0.35",
                        "PriceUnit":"USD/GB/Month",
                        "UsedAmount": "50",
                        "UsedAmountUnit": "GB",
                        "TimeSpan": "1",
                        "TimeUnitName": "Month",
                        "Cost": "17.5",
                        "Discount": "0.97",
                        "ReduceType":"Discount",
                        "RealCost": "16.98",
                        "VoucherPayAmount": "0",
                        "CashPayAmount": "16.98",
                        "IncentivePayAmount": "0"
                    }
                ],
                "Tags": null
            }
        ],
        "Total": 11841,
        "RequestId": "eb914214-778b-470e-93a1-f1e03d58c47b"
    }
}

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 Internal error.
InternalError.GatewayError Gateway error.
InvalidParameter Invalid parameter.
InvalidParameterValue Invalid parameter value.
UnsupportedOperation Operation unsupported.