tencent cloud

TencentDB for MongoDB

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Strengths
Use Cases
Cluster Architecture
Product Specifications
Features
Regions and AZs
Terms
Service Regions and Service Providers
Purchase Guide
Billing Overview
MongoDB Pricing
Billing Formula
Payment Overdue
Backup Space Billing
Configuration Adjustment Billing
Getting Started
Quickly Creating an Instance
Connecting to a TencentDB for MongoDB Instance
Reading/Writing Database
Operation Guide
Access Management
Instance Management
Node Management
Version Upgrade
Network Configuration
Monitoring
Backup and Rollback
Database Audit
Data Security
SSL Authentication
Log Management
Database Management
Multi-AZ Deployment
Disaster Recovery/Read-Only Instances
Parameter Configuration
Recycle Bin
Task Management
Performance Optimization
Data Migration Guide
Practical Tutorial
Optimizing Indexes to Break Through Read/Write Performance Bottlenecks
Troubleshooting Mongos Load Imbalance in Sharded Cluster
Considerations for Using Shard Clusters
Sample of Reading and Writing Data in MongoDB Instance
Methods for Importing and Exporting Data Based on CVM Connected with MongoDB
What to Do for Errors of Repeated Instance Creation and Deletion of Databases with the Same Names?
Troubleshooting MongoDB Connection Failures
Shard Removal Task: Guide for Confirming the Progress and Troubleshooting Issues
Performance Fine-Tuning
Ops and Development Guide
Development Specifications
Command Support in Sharded Cluster v3.2
Command Support in v3.6
Development Ops
Troubleshooting
Increased Slow Queries
Number of Connections Exceeding Limit
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Backup APIs
Account APIs
Other APIs
Task APIs
Introduction
Data Types
Error Codes
Instance Connection
Shell Connection Sample
PHP Connection Sample
Node.js Connection Sample
Java Connection Sample
Python Connection Sample
Python Read/Write Sample
Go Connection Sample
PHP Reconnection Sample
Product Performance
Test Environment
Test Method
Test Result
FAQs
Cost
Features
Sharded Cluster
Instance
Rollback and Backup
Connection
Data Migration
Others
Service Agreement
Service Level Agreement
Terms of Service
Glossary
Contact Us

InquirePriceCreateDBInstances

PDF
Focus Mode
Font Size
Last updated: 2026-01-13 21:48:08

1. API Description

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

This API is used to query price of instance creation. The region parameter must be passed in this API, otherwise verification will fail. This API allows queries only for purchasable instance specifications.

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: InquirePriceCreateDBInstances.
Version Yes String Common Params. The value used for this API: 2019-07-25.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Zone Yes String Region and AZ information of the instance. For details, see Regions and AZs.
NodeNum Yes Integer -Specifies the number of primary and secondary nodes for each replica set during replica set instance creation. call the DescribeSpecInfo API to obtain the maximum and minimum number of nodes supported for each replica set.
- Specifies the number of primary and secondary nodes for each shard during sharded cluster instance creation. Call the DescribeSpecInfo API to obtain the maximum and minimum number of nodes supported for each shard.
Memory Yes Integer Instance memory size.

- Unit: GB.
- For the value range, call the DescribeSpecInfo API. The CPU and Memory parameters in the returned data structure SpecItems correspond to the number of CPU cores and the memory specification, respectively.
Volume Yes Integer Instance disk size.
- Unit: GB.
- For the value range, call the DescribeSpecInfo API. The MinStorage and MaxStorage parameters in the returned data structure SpecItems correspond to the minimum and maximum disk specifications, respectively.
MongoVersion Yes String Instance version information. The DescribeSpecInfo API can be called to obtain specific supported versions. The MongoVersionCode parameter in the returned data structure SpecItems indicates the information on versions supported by instances. The corresponding relationship between version information and version number is as follows:
- MONGO_40_WT: version of the MongoDB 4.0 WiredTiger storage engine.
- MONGO_42_WT: version of the MongoDB 4.2 WiredTiger storage engine.
- MONGO_44_WT: version of the MongoDB 4.4 WiredTiger storage engine.
- MONGO_50_WT: version of the MongoDB 5.0 WiredTiger storage engine.
- MONGO_60_WT: version of the MongoDB 6.0 WiredTiger storage engine.
- MONGO_70_WT: version of the MongoDB 7.0 WiredTiger storage engine.
MachineCode Yes String Product specification type.
- HIO10G: general high-I/O 10GE type.
- HCD: cloud disk.
GoodsNum Yes Integer Number of instances. Minimum value: 1. Maximum value: 10.
ClusterType Yes String Instance type.

- REPLSET: replica set.
- SHARD: sharded cluster.
ReplicateSetNum Yes Integer - Specifies the number of replica sets during replica set instance creation. This parameter can only be set to 1.
- Specifies the number of shards during sharded cluster instance creation. Call the DescribeSpecInfo API to query the range of shard quantity. The parameters MinReplicateSetNum and MaxReplicateSetNum in the returned data structure SpecItems correspond to the minimum value and maximum value, respectively.
Period No Integer - When the monthly subscription mode is selected, that is, when InstanceChargeType is set to PREPAID, this parameter is required for specifying the purchase duration of instances. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, and 36. Unit: months.
- When pay-as-you-go is selected, that is, when InstanceChargeType is set to POSTPAID_BY_HOUR, this parameter only can be set to 1.
InstanceChargeType No String Instance payment method.
- PREPAID: monthly subscription.
- POSTPAID_BY_HOUR: pay-as-you-go.
MongosCpu No Integer Number of Mongos node CPU cores. Valid values: 1, 2, 4, 8, and 16. This parameter is required during sharded cluster instance purchase. If this parameter is left blank, the default value 2 is used.
MongosMemory No Integer Mongos node memory size. - This parameter is required during sharded cluster instance purchase. - Unit: GB. Valid values: 2 (for 1 core), 4 (for 2 cores), 8 (for 4 cores), 16 (for 8 cores), and 32 (for 16 cores). If this parameter is left blank, the default value 4 is used.
MongosNum No Integer Specifies the number of Mongos nodes. Value range: [3,32]. For querying the price of sharded cluster instances, this parameter is required. If it is left blank, the default value 3 is used.
ConfigServerCpu No Integer Specifies the number of ConfigServer CPU cores. The value is fixed as 1.
ConfigServerMemory No Integer Specifies the ConfigServer memory size. The value is fixed as 2. Unit: GB. This parameter can be left blank.
ConfigServerVolume No Integer Specifies the ConfigServer disk size. The value is fixed as 20. Unit: GB. This parameter can be left blank.

3. Output Parameters

Parameter Name Type Description
Price DBInstancePrice Price.
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 Querying the Price for Purchasing Database Instances

Input Example

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

{
    "GoodsNum": 2,
    "Zone": "ap-guangzhou-4",
    "Memory": 4,
    "Period": 1,
    "ClusterType": "REPLSET",
    "Volume": 100,
    "NodeNum": 3,
    "ReplicateSetNum": 1,
    "MachineCode": "HIO10G",
    "MongoVersion": "MONGO_50_WT"
}

Output Example

{
    "Response": {
        "Price": {
            "DiscountPrice": 1340,
            "OriginalPrice": 1340,
            "UnitPrice": 670
        },
        "RequestId": "fb8b4646-389d-44cc-ab8c-98c081cbdad3"
    }
}

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
InvalidParameter Parameter error
InvalidParameter.PermissionDenied The current sub-account has no permission to perform this operation.
InvalidParameterValue.MachineTypeError Incorrect model.
InvalidParameterValue.MongoVersionError The instance version is incorrect.
InvalidParameterValue.ReplicaSetNumError Incorrect number of replica sets (shards).
InvalidParameterValue.SpecNotOnSale Incorrect purchasable specification.
InvalidParameterValue.ZoneClosed Instances are not purchasable in this AZ.
InvalidParameterValue.ZoneError Invalid availability zone

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback