All Products
Search
Document Center

PolarDB:TransformDBClusterPayType

Last Updated:Sep 24, 2026

Changes the billing method of a PolarDB cluster.

Operation description

Note
  • PolarDB clusters support the subscription and pay-as-you-go billing methods. You can switch from subscription to pay-as-you-go or from pay-as-you-go to subscription based on your business requirements. For more information, see Switch from subscription to pay-as-you-go and Switch from pay-as-you-go to subscription.

  • If your Alibaba Cloud account balance is insufficient, the pay-as-you-go billing method cannot be switched to subscription.

  • When you switch from subscription to pay-as-you-go, the system automatically refunds the remaining balance of the fees that you have paid.

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

polardb:TransformDBClusterPayType

update

*DBCluster

acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The PolarDB cluster ID.

pc-bp10gr51qasnl****

PayType

string

Yes

The billing method of the instance. Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

Prepaid

RegionId

string

Yes

The region ID.

cn-hangzhou

UsedTime

string

No

The subscription duration. Valid values:

  • If Period is set to Year, set UsedTime to a value from 1 to 3.

  • If Period is set to Month, set UsedTime to a value from 1 to 9.

Note

This parameter is required when PayType is set to Prepaid.

1

Period

string

No

The unit of the subscription duration for the instance. Valid values:

  • Year: yearly subscription

  • Month: monthly subscription

Note

This parameter is required when PayType is set to Prepaid.

Month

ResourceGroupId

string

No

The resource group ID.

rg-acfm3f4un32****

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. The value of this parameter is generated by the client and must be unique among different requests. The token is case-sensitive and cannot exceed 64 ASCII characters in length.

6000170000591aed949d0f5********************

AutoUseCoupon

boolean

No

Specifies whether to automatically use coupons. Valid values:

  • true (default): Use coupons.

  • false: Do not use coupons.

PromotionCode

string

No

The coupon code. If you do not specify this parameter, the default coupon is used.

727xxxxxx934

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

5E71541A-6007-4DCC-A38A-F872C31FEB45

ChargeType

string

The billing method of the instance. Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

Prepaid

DBClusterId

string

The PolarDB cluster ID.

pc-bp10gr51qasnl****

ExpiredTime

string

The expiration time of the instance.

Note

This response parameter is returned only when PayType is set to Prepaid.

The time follows the ISO 8601 standard in the format of YYYY-MM-DDTHH:mm:ssZ. The time is displayed in UTC.

2020-04-20T10:00:00Z

OrderId

string

The order ID.

20515760028****

Examples

Success response

JSON format

{
  "RequestId": "5E71541A-6007-4DCC-A38A-F872C31FEB45",
  "ChargeType": "Prepaid",
  "DBClusterId": "pc-bp10gr51qasnl****",
  "ExpiredTime": "2020-04-20T10:00:00Z",
  "OrderId": "20515760028****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidOrderCharge.NotSupport The specified order charge does not support in PolarDB.
400 InvalidOrderTask.NotSupport The Current ClusterId exist Order Task in PolarDB.
400 InvalidPaymentMethod.Incomplete No payment method is specified for your account. We recommend that you add a payment method. The valid payment method of vouchers is not specified for your account. Add a valid payment method.
400 InvalidPayType.Malformed The specified parameter PayType is not valid. The specified PayType parameter is invalid.
400 InvalidPeriod.Malformed The specified parameter Period is not valid. The specified Period parameter is invalid.
400 InvalidUsedTime.Malformed The specified parameter UsedTime is not valid. The specified UsedTime parameter is invalid.
400 InvalidPeriodUnit.Malformed The specified parameter PeriodUnit is not valid. The specified PeriodUnit parameter is invalid.
403 OperationDenied.LockMode The operation is not permitted when the instance is locked. This operation is not supported while the cluster is in the locked state.
403 OperationDenied.DBClusterDeletionLock The operation is not permitted due to the deletion lock of cluster. This operation is not supported while a deletion lock exists in the cluster.
404 InvalidDBCluster.NotFound The specified DBClusterId is not found. The specified cluster ID does not exist.
404 InvalidDBClusterId.Malformed The specified parameter DBClusterId is not valid. The specified DBClusterId parameter is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.