Changes the billing method of a specified PolarDB cluster.

Note
  • PolarDB clusters support the subscription and pay-as-you-go billing methods. You can change the billing method from subscription to pay-as-you-go or from pay-as-you-go to subscription based on your business requirements. For more information, see Change the billing method from subscription to pay-as-you-go and Change the billing method from pay-as-you-go to subscription.
  • You cannot change the billing method from pay-as-you-go to subscription if your account balance is insufficient.
  • If you change the billing method from subscription to pay-as-you-go, the system automatically refunds the balance of the prepaid subscription fees.

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 No TransformDBClusterPayType

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

DBClusterId String Yes pc-bp10gr51qasnl****

The ID of the cluster.

PayType String Yes Prepaid

The billing method of the cluster. Valid values:

  • Postpaid: the pay-as-you-go billing method
  • Prepaid: the subscription billing method
RegionId String Yes cn-hangzhou

The ID of the region where the cluster is deployed.

UsedTime String No 1

The subscription period. The values that are valid for this parameter depend on the value specified in the Period parameter.

  • If Period is set to Year, UsedTime can be set to 1, 2, or 3.
  • If Period is set to Month, UsedTime can be set to 1, 2, 3, 4, 5, 6, 7, 8, or 9.
Note This parameter is required if you set the PayType parameter to Prepaid.
Period String No Month

The renewal cycle of the cluster. Valid values:

  • Year: yearly subscription
  • Month: monthly subscription
Note This parameter is required if you set the PayType parameter to Prepaid.
ResourceGroupId String No rg-acfm3f4un32****

The ID of the resource group.

ClientToken String No 6000170000591aed949d0f5********************

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

Response parameters

Parameter Type Example Description
RequestId String 5E71541A-6007-4DCC-A38A-F872C31FEB45

The ID of the request.

ChargeType String Prepaid

The billing method of the cluster. Valid values:

  • Postpaid: the pay-as-you-go billing method
  • Prepaid: the subscription billing method
DBClusterId String pc-bp10gr51qasnl****

The ID of the cluster.

ExpiredTime String 2020-04-20T10:00:00Z

The expiration time of the cluster.

Note This parameter is returned if you set the PayType parameter to Prepaid.
OrderId String 205157600280623

The ID of the order.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/?Action=TransformDBClusterPayType
&DBClusterId=pc-bp10gr51qasnl****
&PayType=Prepaid
&RegionId=cn-hangzhou
&UsedTime=1
&Period=Month
&ResourceGroupId=rg-acfm3f4un32****
&ClientToken=6000170000591aed949d0f5********************
&Common request parameters

Sample success responses

XML format

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

<TransformDBClusterPayTypeResponse>
    <RequestId>5E71541A-6007-4DCC-A38A-F872C31FEB45</RequestId>
    <ChargeType>Prepaid</ChargeType>
    <DBClusterId>pc-bp10gr51qasnl****</DBClusterId>
    <ExpiredTime>2020-04-20T10:00:00Z</ExpiredTime>
    <OrderId>205157600280623</OrderId>
</TransformDBClusterPayTypeResponse>

JSON format

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

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

Error codes

HttpCode Error code Error message Description
400 InvalidOrderCharge.NotSupport The specified order charge does not support in PolarDB. The error message returned because PolarDB does not support the payment method.
400 InvalidOrderTask.NotSupport The Current ClusterId exist Order Task in PolarDB. The error message returned because the cluster has unfinished orders. Try again later.
400 InvalidPaymentMethod.Incomplete No payment method is specified for your account. We recommend that you add a payment method. The error message returned because no valid payment method is specified for your Alibaba Cloud account. Specify a valid payment method and try again.
403 OperationDenied.LockMode The operation is not permitted when the instance is locked. The error message returned because the cluster is locked.
404 InvalidDBCluster.NotFound The specified DBClusterId is not found. The error message returned because the specified cluster ID does not exist.

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