All Products
Search
Document Center

Elastic Compute Service:DescribeRenewalPrice

Last Updated:Aug 26, 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 the price for renewing an instance to a unified expiration date is supported.

  • Precautions for parameter settings:
    • If only the required parameters are set, the price for renewing the instance for one month is queried by default.

    • You cannot query the renewal duration price and the renewal-to-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 for which to query the renewal price. Valid values: instance.

Default value: instance.

instance

ResourceId

string

Yes

The ID of the resource for which to query the renewal price. 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. If you specify this parameter, the price for renewing the instance to the unified expiration date is queried. Valid values: 1 to 28.

For more information about the unified expiration date feature, see Unified instance expiration date.

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>

The promotion rule.

object

Description

string

The description of the promotion rule.

Get a 15% discount off the list price for a one-year subscription

RuleId

integer

The ID of the promotion.

1234567890

Price

object

The price.

OriginalPrice

number

The original price.

4368

DiscountPrice

number

The discount.

655.2

Currency

string

The currency unit.

China site: CNY.

International site: USD.

CNY

TradePrice

number

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

3712.8

DetailInfos

object

DetailInfo

array<object>

The pricing details of the resource.

array<object>

Resource

string

The name of the resource that corresponds to the price.

instance

OriginalPrice

number

The original price.

4368

DiscountPrice

number

The discount price.

655.2

TradePrice

number

The transaction price.

3712.8

SubRules

object

Rule

array<object>

The subset of pricing rules.

object

Description

string

The description of the pricing rule.

Get a 15% discount off the list price for a one-year subscription

RuleId

integer

The ID of the pricing rule.

1234567890

RelatedPrice

object

The related price.

MarketplaceImagePrice

object

The Alibaba Cloud Marketplace image price.

Currency

string

The currency unit.

China site: CNY.

International site: USD.

CNY

OriginalPrice

number

The original price.

200

DiscountPrice

number

The discount.

0

TradePrice

number

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

200

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PriceInfo": {
    "Rules": {
      "Rule": [
        {
          "Description": "Get a 15% discount off the list price for a one-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": {
              "Rule": [
                {
                  "Description": "Get a 15% discount off the list price for a one-year subscription",
                  "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. The request is throttled.
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
400 InvalidOperation.ClassicNetworkTypeNotSupported The classic network instance does not support this operation. Sorry, the instance you renewed based on the classic network architecture cannot be renewed. You need to migrate to a VPC for normal renewal.
400 LastOrderProcessing The previous order is still processing, please try again later. The order is being processed. Try again later.
400 InvalidParam.ExpectedRenewDay The specified parameter ExpectedRenewDay is not valid. The specified parameter ExpectedRenewDay is not valid.
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.
403 InvalidStatus.DiskNotReady This specified disk is not ready, status needs to be either In_use or Available. The status of the specified disk must be In_use or Available.
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.