You can call DescribePrice to query the prices of creating, upgrading, and renewing ApsaraDB for Redis instances.

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

Name Type Required Example Description
Action String No DescribePrice

The operation that you want to perform. Set this parameter to DescribePrice.

OrderType String Yes BUY

The order type. Valid values:

  • BUY
  • UPGRADE
  • RENEW
InstanceId String No r-bp1xxxxxxxxxxxxx

The ID of the instance.

Capacity Long No 1024

The storage capacity of the instance. Unit: MB.

InstanceClass String No redis.master.small.default

The instance type. For more information, see Instance types.

ZoneId String No cn-hangzhou-e

The ID of the zone. CallDescribeZones to query it.

ChargeType String No PostPaid

The payment type. Valid values:

  • PostPaid: pay-as-you-go.
  • PrePaid: subscription.
Note Default value: PostPaid.
NodeType String No MASTER_SLAVE

The type of the node. A unique value of MASTER_SLAVE indicates that the instance has a master and a replica.

Period Long No 3

The subscription period. Unit: months. Valid values: 1 to 12, 24, and 36.

Quantity Long No 1

The number of instances to purchase. Valid values: 1 to 30. Default value: 1.

Instances String No Instances=[{"RegionId": "cn-hangzhou","ZoneId": "cn-hangzhou-b","InstanceClass": "redis.master.small.default","ChargeType": "PostPaid","OrderType": "BUY","Period": "1","Quantity": "1","Capacity": "4096"}]

A JSON string that contains multiple instances. For more information, seeFormat of Instances.

BusinessInfo String No 000000000000

Extended information such as activity ID or business information.

CouponNo String No youhuiquan_promotion_option_id_for_blank

The coupon code. Default value: youhuiquan_promotion_option_id_for_blank, indicating that no coupon code is used.

ForceUpgrade Boolean No true

Specifies whether to forcibly upgrade the instance. Valid values:

  • false
  • true
Note Default value: true
OrderParamOut String No "{\"autoPay\":false,\"autoUseCoupon\":false,\"bid\":\"26842\",\"buyerId\":xxxxxxxxxxxxxxx,\"commodities\":[{\"chargeType\":\"POSTPAY\",\"commodityCode\":\"kvstore\",\"components\":[{\"componentCode\":\"kvstore_instance_class\",\"free\":false,\"moduleAttrStatus\":1,\"moduleParams\":{},\"properties\":[{\"code\":\"kvstore_instance_class\",\"name\":\"redis.master.small.default\",\"value\":\"redis.master.small.default\"}]},{\"componentCode\":\"kvstore_region_no\",\"free\":false,\"moduleAttrStatus\":1...

Specifies whether to return order parameters. Valid values:

  • false
  • true
Note Default value: false.
RegionId String No cn-hangzhou

The ID of the region where the specified instance is located. You can call the DescribeRegions operation to query the latest regions.

Response parameters

Name Type Example Description
Order Struct

The order information.

Coupons Array

The coupon information.

Coupon
CouponNo String youhuiquan_promotion_option_id_for_blank

The coupon number.

Description String coupondemo

The description of the coupon.

IsSelected String true

Indicates whether the coupon was selected.

Name String Free for internal settlement

The name of the rule.

Currency String CNY

The currency of the coupon.

DiscountAmount Float 0.21

The discount amount of the order.

OriginalAmount Float 0.21

The original price of the order.

RuleIds List RuleId: 1111111111

The ID of the hit policy.

TradeAmount Float 10

The final price of the order.

SubOrders Array

The policy corresponding to the coupon.

SubOrder
DiscountAmount Float 0.21

The discount amount of the order.

InstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance.

OriginalAmount Float 0.21

The original price of the order.

RuleIds List RuleId: 1111111111

The ID of the hit policy.

TradeAmount Float 10

The actual price of the order.

Rules Array

The promotion rules.

Rule
Name String Free for internal settlement

The name of the rule.

RuleDescId Long 1111111111

The ID of the rule.

Title Integer demo

The title of the rule.

RequestId String 3 A40BE4 E-1890-4972-889C-FEFA37663635

The ID of the request.

OrderParams String String

Order parameters. When OrderParamOut is set to true, this parameter is returned.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=DescribePrice
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-b
&OrderType=BUY
&ChargeType=PostPaid
&Capacity=4096
&<Common request parameters>

Sample success responses

XML format

<DescribePriceResponse>
      <Order>
            <Currency>CNY</Currency>
            <RuleIds>
        </RuleIds>
            <TradeAmount>0</TradeAmount>
            <OriginalAmount>0</OriginalAmount>
            <Coupons>
        </Coupons>
            <DiscountAmount>0</DiscountAmount>
      </Order>
      <RequestId>3A40BE4E-1890-4972-889C-FEFA37663635</RequestId>
      <SubOrders>
            <SubOrder>
                  <RuleIds>
            </RuleIds>
                  <TradeAmount>0</TradeAmount>
                  <OriginalAmount>0</OriginalAmount>
                  <DiscountAmount>0</DiscountAmount>
            </SubOrder>
      </SubOrders>
      <Rules>
    </Rules>
</DescribePriceResponse>

JSON format

{
    "Order": {
        "Currency": "CNY",
        "RuleIds": {
            "RuleId": []
        },
        "TradeAmount": 0,
        "OriginalAmount": 0,
        "Coupons": {
            "Coupon": []
        },
        "DiscountAmount": 0
    },
    "RequestId": "3A40BE4E-1890-4972-889C-FEFA37663635",
    "SubOrders": {
        "SubOrder": [
            {
                "RuleIds": {
                    "RuleId": []
                },
                "TradeAmount": 0,
                "OriginalAmount": 0,
                "DiscountAmount": 0
            }
        ]
    },
    "Rules": {
        "Rule": []
    }
}

Error codes

HTTP status code Error code Error message Description
400 MissingParameter Period is mandatory for this action. The error message returned because the instance ID is required.
400 MissingParameter InstanceId is mandatory for this action. The error message returned because the name or password of the instance is required.

For a list of error codes, visit the API Error Center.