You can call the DescribePrice operation to query the price of an instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribePrice

The operation that you want to perform. Set the value to DescribePrice.

ClientToken String No ETnLKlblzczshOTUbOCz*****

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the generated token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

CommodityCode String No rds

The commodity code of the instance. Valid values:

  • bards: The instance is a pay-as-you-go primary instance. This value is available at the China site (aliyun.com).
  • rds: The instance is a subscription primary instance. This is the default value. This value is available at the China site (aliyun.com).
  • rords: The instance is a pay-as-you-go read-only instance. This value is available at the China site (aliyun.com).
  • rds_rordspre_public_cn: The instance is a subscription read-only instance. This value is available at the China site (aliyun.com).
  • bards_intl: The instance is a pay-as-you-go primary instance. This value is available at the International site (alibabacloud.com).
  • rds_intl: The instance is a subscription primary instance. This value is available at the International site (alibabacloud.com).
  • rords_intl: The instance is a pay-as-you-go read-only instance. This value is available at the International site (alibabacloud.com).
  • rds_rordspre_public_intl: The instance is a subscription read-only instance. This value is available at the International site (alibabacloud.com).
Note If the instance is a read-only instance, you must specify the CommodityCode parameter.
RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

Engine String Yes MySQL

The database engine of the instance. Valid values:

  • MySQL
  • SQLServer
  • PostgreSQL
  • MariaDB
EngineVersion String Yes 5.5

The database engine version of the instance.

  • Valid values when you set the Engine parameter to MySQL: 5.5, 5.6, 5.7, and 8.0
  • Valid values when you set the Engine parameter to SQLServer: 2008r2, 2012, 2012_ent_ha, 2012_std_ha, 2012_web, 2014_std_ha, 2016_ent_ha, 2016_std_ha, 2016_web, 2017_std_ha, 2017_ent, 2019_std_ha, and 2019_ent
  • Valid values when you set the Engine parameter to PostgreSQL: 10.0, 11.0, 12.0, 13.0, 14.0, and 15.0
  • Valid values when you set the Engine parameter to MariaDB: 10.3
DBInstanceClass String Yes rds.mysql.s1.small

The instance type of the instance. For more information, see Primary ApsaraDB RDS instance types.

DBInstanceStorage Integer Yes 20

The storage capacity of the instance. Unit: GB. You can adjust the storage capacity at a step size of 5 GB. For more information, see Primary ApsaraDB RDS instance types.

PayType String No Prepaid

The billing method of the instance. Valid values:

  • Prepaid: subscription
  • Postpaid: pay-as-you-go
ZoneId String No cn-hangzhou-b

The zone ID of the primary instance. You can call the DescribeRegions operation to query the most recent zone list.

Note If you specify a virtual private cloud (VPC) and a vSwitch, you must also specify this parameter.
UsedTime Integer No 1

The subscription duration of the instance.

  • If you set the TimeType parameter to Year, the value of the UsedTime parameter ranges from 1 to 100.
  • If you set the TimeType parameter to Month, the value of the UsedTime parameter ranges from 1 to 999.

Default value: 1.

TimeType String No Year

The unit that is used to calculate the subscription duration of the instance. If you set the CommodityCode parameter to RDS, rds_rordspre_public_cn, rds_intl, or rds_rordspre_public_intl, you must also specify this parameter. Valid values:

  • Year
  • Month
Quantity Integer Yes 10

The number of instances that you want to purchase. Valid values: 0 to 30.

InstanceUsedType Integer No 0

The role of the instance. Valid values:

  • 0: primary instance
  • 3: read-only instance
OrderType String No BUY

The type of the order. Valid values:

  • BUY: purchase order
  • UPGRADE: specification change order
  • RENEW: renewal order
DBInstanceStorageType String No local_ssd

The storage type of the instance. Valid values:

  • local_ssd: local SSD
  • cloud_ssd: standard SSD
  • cloud_essd: enhanced SSD (ESSD) of performance level 1 (PL1)
  • cloud_essd2: ESSD of PL2
  • cloud_essd3: ESSD of PL3
DBInstanceId String No rm-*****

The ID of the instance for which you want to change the specifications or the instance that you want to renew.

Note
  • If you want to query the price of an specification change order or a renewal order, you must specify this parameter.
  • If the instance is a read-only instance, you must set this parameter to the ID of its primary instance.
DBNode Array No

The information about the node.

Note This parameter is available for ApsaraDB RDS for MySQL clusters.
ClassCode String No mysql.n2.small.xc

The specification of the node.

ZoneId String No cn-hangzhou-j

The zone ID of the node.

Response parameters

Parameter Type Example Description
RequestId String CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6

The ID of the request.

PriceInfo Object

The information about the price.

OriginalPrice Float 2504

The original price that you need to pay.

DiscountPrice Float 0

The discount that is applied.

Currency String CNY

The unit of the currency.

TradePrice Float 2504

The transaction price, which is equal to the original price minus the discount.

Coupons Array of Coupon

An array that consists of information about coupons.

Coupon
IsSelected String true

Indicates whether the coupon is selected.

CouponNo String 123456

The ID of the coupon.

Name String test

The name of the coupon.

Description String test

The description of the coupon.

RuleIds Array of String 1001199213

The ID of the promotion rule.

ActivityInfo Object

The information about the promotion.

CheckErrMsg String Error description

The description of the error.

ErrorCode String 123456

The error code that is returned.

Success String Success

Indicates whether the request was successful.

Rules Array of Rule

The details about the promotion rule.

Rule
Name String Rule1

The name of the promotion rule.

Description String Activity Description

The description of the promotion rule.

RuleId Long 1020021003939076

The ID of the promotion rule.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=DescribePrice
&ClientToken=ETnLKlblzczshOTUbOCz*****
&CommodityCode=rds
&RegionId=cn-hangzhou
&Engine=MySQL
&EngineVersion=5.5
&DBInstanceClass=rds.mysql.s1.small
&DBInstanceStorage=20
&PayType=Prepaid
&ZoneId=cn-hangzhou-b
&UsedTime=1
&TimeType=Year
&Quantity=10
&InstanceUsedType=0
&OrderType=BUY
&DBInstanceStorageType=local_ssd
&DBInstanceId=rm-*****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribePriceResponse>
    <RequestId>CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6</RequestId>
    <PriceInfo>
        <OriginalPrice>2504</OriginalPrice>
        <DiscountPrice>0</DiscountPrice>
        <Currency>CNY</Currency>
        <TradePrice>2504</TradePrice>
        <Coupons>
            <IsSelected>true</IsSelected>
            <CouponNo>123456</CouponNo>
            <Name>test</Name>
            <Description>test</Description>
        </Coupons>
        <RuleIds>1001199213</RuleIds>
        <ActivityInfo>
            <CheckErrMsg>Error description</CheckErrMsg>
            <ErrorCode> 123456</ErrorCode>
            <Success>Success</Success>
        </ActivityInfo>
    </PriceInfo>
    <Rules>
        <Name>Rule1</Name>
        <Description>Activity Description</Description>
        <RuleId>1020021003939076</RuleId>
    </Rules>
</DescribePriceResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6",
  "PriceInfo" : {
    "OriginalPrice" : 2504,
    "DiscountPrice" : 0,
    "Currency" : "CNY",
    "TradePrice" : 2504,
    "Coupons" : [ {
      "IsSelected" : "true",
      "CouponNo" : "123456",
      "Name" : "test",
      "Description" : "test"
    } ],
    "RuleIds" : [ "1001199213" ],
    "ActivityInfo" : {
      "CheckErrMsg" : "Error description",
      "ErrorCode" : " 123456",
      "Success" : "Success"
    }
  },
  "Rules" : [ {
    "Name" : "Rule1",
    "Description" : "Activity Description",
    "RuleId" : 1020021003939076
  } ]
}

Error codes

HTTP status code Error code Error message Description
400 InvalidDBInstanceStorage.Format InvalidDBInstanceStorage.Format The error message returned because the storage capacity is invalid. Check the configuration of the storage capacity.
400 DBNodeParameter.InvalidClassCode The ClassCode of the item of the specified parameter DBNode is inconsistent. The error message returned because the ClassCode configuration is invalid for the DBNode parameter.
400 DBNodeParameter.Required The specified parameter DBNode is required. The error message returned because the DBNode parameter is not specified.
400 DBNodeParameter.TooFewItems The specified parameter DBNode has too few items. The error message returned because a small number of items are configured for the DBNode parameter.
400 DBNodeParameter.TooManyItems The specified parameter DBNode has too many items. The error message returned because a large number of items are configured for the DBNode parameter.
404 InvalidTimeType.NotFound The parameter timeType does not exist. The error message returned because the value of the TimeType parameter is invalid. The valid values of the TimeType parameter are Year, Month, and Day.

For a list of error codes, see Service error codes.