All Products
Search
Document Center

Elastic Compute Service:DescribeRenewalPrice

Last Updated:Jun 18, 2026

Queries the renewal price of Elastic Compute Service (ECS) resources. Only subscription resources are supported.

Operation description

  • Only the price for renewing a subscription ECS instance for a specified duration or renewing it to a unified expiration date is supported.

  • Note the following when you set the parameters:
    • If you set only the required parameters, the price for renewing the instance for one month is returned by default.

    • You cannot query the renewal duration price and the unified expiration date price at the same time. The renewal duration parameters (Period and PeriodUnit) and the unified expiration date parameter (ExpectedRenewDay) cannot be set at the same time.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeRenewalPrice

get

DedicatedHost

acs:ecs:{#regionId}:{#accountId}:ddh/{#ddhId}

Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

cn-hangzhou

ResourceType

string

No

The type of the resource whose renewal price you want to query. Valid values: instance.

Default value: instance.

instance

ResourceId

string

Yes

The ID of the resource whose renewal price you want to query. When ResourceType is set to instance, ResourceId is equivalent to InstanceId.

i-bp1f2o4ldh8l29zv****

Period

integer

No

The renewal duration. Valid values:

  • When PriceUnit is set to Month: 1 to 9.

  • When PriceUnit is set to Year: 1 to 3.

Default value: 1.

Note

The renewal duration parameters (Period and PeriodUnit) and the unified expiration date parameter (ExpectedRenewDay) cannot be set at the same time.

1

PriceUnit

string

No

The unit of the renewal duration. Valid values:

  • Month: the renewal duration is measured in months.

  • Year: the renewal duration is measured in years.

Default value: Month.

Month

ExpectedRenewDay

integer

No

The unified expiration date. After you specify this parameter, the price for renewing the instance to the unified expiration date is returned. Valid values: 1 to 28.

For more information about the unified expiration date feature, see Settings for instance expires.

Note

The renewal duration parameters (Period and PeriodUnit) and the unified expiration date parameter (ExpectedRenewDay) cannot be set at the same time.

5

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

PriceInfo

object

The price information, including the price and discount rule details.

Rules

object

Rule

array<object>

Activity rules.

object

Description

string

Description of the activity rule.

买满1年,立享官网价格8.5折优惠。

RuleId

integer

Activity ID.

1234567890

Price

object

The price.

OriginalPrice

number

Original price.

4368

DiscountPrice

number

Discounted price.

655.2

Currency

string

Currency unit.

China site (aliyun.com): CNY.

International site (alibabacloud.com): USD.

CNY

TradePrice

number

Final price, calculated as the original price minus discounts.

3712.8

DetailInfos

object

DetailInfo

array<object>

Resource pricing details.

array<object>

Resource

string

Name of the resource corresponding to the price.

instance

OriginalPrice

number

Original price.

4368

DiscountPrice

number

Discounted price.

655.2

TradePrice

number

Transaction price.

3712.8

SubRules

object

Rule

array<object>

Subset of pricing rules.

object

Description

string

Description of the pricing rule.

买满1年,立享官网价格8.5折优惠。

RuleId

integer

Pricing rule ID.

1234567890

RelatedPrice

object

MarketplaceImagePrice

object

Currency

string

CNY

OriginalPrice

number

200

DiscountPrice

number

0

TradePrice

number

200

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PriceInfo": {
    "Rules": {
      "Rule": [
        {
          "Description": "买满1年,立享官网价格8.5折优惠。",
          "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": {
              "Rule": [
                {
                  "Description": "买满1年,立享官网价格8.5折优惠。",
                  "RuleId": 1234567890
                }
              ]
            }
          }
        ]
      }
    },
    "RelatedPrice": {
      "MarketplaceImagePrice": {
        "Currency": "CNY",
        "OriginalPrice": 200,
        "DiscountPrice": 0,
        "TradePrice": 200
      }
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidResourceType.ValueNotSupported The specified parameter ResourceType is not valid. The specified resource type is not supported.
400 InvalidPeriod The specified period is not valid. The specified period is invalid.
400 InvalidPriceUnit.ValueNotSupported The specified parameter PriceUnit is not valid. The specified PriceUnit parameter is invalid.
400 Throttling Request was denied due to request throttling.
400 Throttling.User Request was denied due to user flow control.
400 InternalError The request processing has failed due to some unknown error. An internal error has occurred. Try again later.
400 InvalidPeriod.ExceededMaximumExpirationDate The specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt. The specified renewal period exceeds the maximum allowed value. We recommend that you shorten the renewal period at your next attempt.
400 InvalidExpectedRenewDay.Conflict The specified expectedRenewDay is in conflict with period.
400 InvalidExpectedRenewDay.ValueNotSupported The specified parameter ExpectedRenewDay is not valid.
400 InvalidPeriod.ExceededDedicatedHost Instance expired date can not exceed dedicated host expired date. The expiration date of the instance is later than that of the dedicated host.
400 OperationRestricted.Renewal The renewal operation has been restricted because the zone is closed. %s
500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error has occurred. Try again later.
403 ChargeTypeViolation The operation is not permitted due to charge type of the instance.
403 InvalidAction.Unauthorized The specified action is not valid. The specified operation is invalid.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. The specified instanceId is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.