Queries the renewal price of a subscription Elastic Compute Service (ECS) resource. Only the renewal prices of subscription resources can be queried.

Description

  • You can call this operation to query the price for renewing a subscription instance for a specific period of time or to a synchronized expiration date.
  • Take note of the following items:
    • If you set only the required parameters, the price for renewing a specified instance for one month is queried by default.
    • The renewal period-related parameter pair (Period andPeriodUnit) and the synchronized expiration date-related parameter (ExpectedRenewDay) are mutually exclusive. You cannot set these parameters together to query the prices for renewing a specified instance for a period of time and to a synchronized expiration date at the same time.

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 DescribeRenewalPrice

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

RegionId String Yes cn-hangzhou

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

ResourceType String No instance

The type of the resource. Set the value to instance.

Default value: instance.

ResourceId String Yes i-bp1f2o4ldh8l29zv****

The ID of the resource. When the ResourceType parameter is set to instance, ResourceId is interpreted as InstanceId.

Period Integer No 1

The renewal period. Valid values:

  • Valid values when PriceUnit is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, and 9.
  • Valid values when PriceUnit is set to Year: 1, 2, 3.

Default value: 1.

Note The renewal period-related parameter pair (Period and PeriodUnit) and the ExpectedRenewDay parameter are mutually exclusive.
PriceUnit String No Month

The unit of the renewal period. Valid values:

  • Month
  • Year

Default value: Month.

ExpectedRenewDay Integer No 5

The synchronized expiration date. If you set this parameter, the price for renewing a specified instance to the specified synchronized expiration date is queried. Valid values: 1 to 28.

For information about how to synchronize the expiration dates of instances, see Synchronize the expiration dates of instances.

Note The renewal period-related parameter pair (Period and PeriodUnit) and the ExpectedRenewDay parameter are mutually exclusive.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

The ID of the request.

PriceInfo Object

Details about the prices and discount rules.

Rules Array of Rule

Details about the promotion rules.

Rule
Description String Receive a 15% discount on a 1-year subscription

The description of the promotion rule.

RuleId Long 1234567890

The ID of the promotion rule.

Price Object

The price.

OriginalPrice Float 4368

The original price.

DiscountPrice Float 655.2

The discount.

Currency String CNY

The currency unit.

Alibaba Cloud China site (aliyun.com): CNY.

Alibaba Cloud International site (alibabacloud.com): USD.

TradePrice Float 3712.8

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

DetailInfos Array of ResourcePriceModel

Details about the resource prices.

ResourcePriceModel
Resource String instance

The name of the resource that corresponds to the price.

OriginalPrice Float 4368

The original price.

DiscountPrice Float 655.2

The discount.

TradePrice Float 3712.8

The transaction price.

SubRules Array of Rule

Details about the pricing rules.

Rule
Description String Receive a 15% discount on a 1-year subscription

The description of the pricing rule.

RuleId Long 1234567890

The ID of the pricing rule.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=DescribeRenewalPrice
&RegionId=cn-hangzhou
&ResourceType=instance
&ResourceId=i-bp1f2o4ldh8l29zv****
&Period=1
&PriceUnit=Month
&Common request parameters

Sample success responses

XML format

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

<DescribeRenewalPriceResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
    <PriceInfo>
        <Rules>
            <Rule>
                <Description>Receive a 15% discount on a 1-year subscription. </Description>
                <RuleId>1234567890</RuleId>
            </Rule>
        </Rules>
    </PriceInfo>
    <Price>
        <OriginalPrice>4368</OriginalPrice>
        <DiscountPrice>655.2</DiscountPrice>
        <Currency>CNY</Currency>
        <TradePrice>3712.8</TradePrice>
        <DetailInfos>
            <DetailInfo>
                <Resource>instance</Resource>
                <OriginalPrice>4368</OriginalPrice>
                <DiscountPrice>655.2</DiscountPrice>
                <TradePrice>3712.8</TradePrice>
                <SubRules>
                    <SubRule>
                        <Description>Receive a 15% discount on a 1-year subscription. </Description>
                        <RuleId>1234567890</RuleId>
                    </SubRule>
                </SubRules>
            </DetailInfo>
        </DetailInfos>
    </Price>
</DescribeRenewalPriceResponse>

JSON format

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

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PriceInfo" : {
    "Rules" : {
      "Rule" : [ {
        "Description" : "Receive a 15% discount on 1-year subscription.",
        "RuleId" : 1234567890
      } ]
    }
  },
  "Price" : {
    "OriginalPrice" : 4368,
    "DiscountPrice" : 655.2,
    "Currency" : "CNY",
    "TradePrice" : 3712.8,
    "DetailInfos" : {
      "DetailInfo" : [ {
        "Resource" : "instance",
        "OriginalPrice" : 4368,
        "DiscountPrice" : 655.2,
        "TradePrice" : 3712.8,
        "SubRules" : {
          "SubRule" : [ {
            "Description" : "Receive a 15% discount on 1-year subscription.",
            "RuleId" : 1234567890
          } ]
        }
      } ]
    }
  }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidResourceType.ValueNotSupported The specified parameter ResourceType is not valid. The error message returned because the specified ResourceType parameter is invalid.
400 InvalidPeriod The specified period is not valid. The error message returned because the specified Period parameter is invalid.
400 InvalidPriceUnit.ValueNotSupported The specified parameter PriceUnit is not valid. The error message returned because the specified PriceUnit parameter is invalid.
400 Throttling Request was denied due to request throttling. The error message returned because your request is throttled. Try again later.
400 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Try again later.
500 InternalError %s The error message returned because an internal error has occurred.
403 ChargeTypeViolation The operation is not permitted due to charge type of the instance. The error message returned because the operation is not supported while the instance uses the current billing method.
403 InvalidAction.Unauthorized The specified action is not valid. The error message returned because the specified operation is invalid.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. The error message returned because the specified instance ID is invalid.

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