tencent cloud

APIs

CreateBudget

Download
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-07-13 11:09:13

1. API Description

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

Create budget information

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: CreateBudget.
Version Yes String Common Params. The value used for this API: 2018-07-09.
Region No String Common Params. This parameter is not required for this API.
BudgetName Yes String Budget Name
CycleType Yes String DAY, MONTH, QUARTER, YEAR
PeriodBegin Yes String Validity start time 2025-01-01 (Period: day) / 2025-01 (Period: month)
PeriodEnd Yes String Validity end time 2025-12-01 (Period: day) / 2025-12 (Cycle: month)
PlanType Yes String FIX Fixed Budget, CYCLE Budget Planning
BudgetQuota Yes String Budget amount limit
Pass a fixed value when the schedule type is FIX (fixed budget).
When the schedule type is CYCLE (budget planning), pass [{"dateDesc":"2025-07","quota":"1000"},{"dateDesc":"2025-08","quota":"2000"}].
BillType Yes String BILL System bill, CONSUMPTION Consumption bill
FeeType Yes String COST Original price, REAL_COST Actual fee, CASH Cash, INCENTIVE Free credit, VOUCHER Voucher, TRANSFER Allocated fees (royalty amount), TAX Tax, AMOUNT_BEFORE_TAX Cash payment (before tax)
WarnJson.N Yes Array of BudgetWarn Threshold alert
BudgetNote No String Budget remark
DimensionsRange No BudgetConditionsForm Budget Dimension Range Condition
WaveThresholdJson.N No Array of WaveThresholdForm Fluctuation alert

3. Output Parameters

Parameter Name Type Description
Data BudgetInfoApiResponse Create budget return information
Message String create success
Code Integer Return code
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 Create a Budget Project

Input Example

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

{
"BudgetName": "API creation budget"
    "CycleType": "DAY",
    "PeriodBegin": "2025-01-01",
    "PeriodEnd": "2026-12-01",
    "PlanType": "FIX",
    "BudgetQuota": "1000",
    "BillType": "BILL",
    "FeeType": "COST",
    "WarnJson": [
        {
            "WarnType": "ACTUAL",
            "CalType": "PERCENTAGE",
            "ThresholdValue": "100"
        }
    ],
"BudgetNote": "Use api to create budget information"
    "DimensionsRange": {
        "Business": [
            "p_cvm"
        ],
        "PayMode": [
            "postPay"
        ],
        "ProductCodes": [
            "sp_cvm"
        ],
        "ComponentCodes": [
            "v_cpu"
        ],
        "ZoneIds": [
            "10001"
        ],
        "RegionIds": [
            "47"
        ],
        "ProjectIds": [
            "0"
        ],
        "ActionTypes": [
            "postpay_deduct_d"
        ],
        "ConsumptionTypes": [
            "prepay_purchase"
        ],
        "Tags": [
            {
"TagKey": "Business Unit",
                "TagValue": [
"Department 123"
                ]
            }
        ],
        "PayerUins": [
            "909619400"
        ],
        "OwnerUins": [
            "909619400"
        ],
        "TreeNodeUniqKeys": [
            "909619400-6872sdw23"
        ]
    },
    "WaveThresholdJson": [
        {
            "WarnType": "ACTUAL",
            "Threshold": "10",
            "MetaType": "chain",
            "PeriodType": "day"
        }
    ]
}

Output Example

{
    "Response": {
        "Code": 0,
        "Data": {
            "BudgetId": "1963509727611474000",
            "UpdateTime": "2025-09-04 15:49:33"
        },
        "Message": "create success",
        "RequestId": "922dcc4b-55b2-401d-8eb8-9160117d07d4"
    }
}

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.
InternalError.UnknownError Undefined exception.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan