All Products
Document Center


Last Updated:Feb 20, 2024

Changes the billing method of an ApsaraDB for Redis instance from subscription to pay-as-you-go or from pay-as-you-go to subscription.

Operation description

Before you call this operation, make sure that you understand relevant precautions and billing rules. For more information, see the following topics:


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
  • All Resources

Request parameters


The ID of the instance. You can call the DescribeInstances operation to query the ID of the instance.


The subscription duration. Unit: months. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36.

Note This parameter is valid and required only if you set the ChargeType parameter to PrePaid.

Specifies whether to enable automatic payment. Default value: true. Valid values:

  • true: Automatic payment is enabled.
  • false: Automatic payment is disabled. If automatic payment is disabled, you must perform the following steps to complete the payment: In the top navigation bar of the ApsaraDB for Redis console, choose Expenses > Renewal Management. In the left-side navigation pane of the Billing Management console, click Orders. On the Orders page, find the order and complete the payment.

The new billing method. Valid values:

  • PrePaid: subscription. If you set this parameter to PrePaid, you must also specify the Period parameter.
  • PostPaid: pay-as-you-go

Specifies whether to enable auto-renewal for the instance. Valid values:

  • true: enables auto-renewal.
  • false (default): disables auto-renewal.

The subscription duration that is supported by auto-renewal. Unit: month. Valid values: 1, 2, 3, 6, and 12.

Note This parameter is required if the AutoRenew parameter is set to true.

Response parameters


The time when the instance expires.

Note A value is returned for this parameter only if the instance was changed from pay-as-you-go to subscription.

The ID of the request.


The ID of the order.



Sample success responses


  "EndTime": "2021-05-13T00:00:00Z",
  "RequestId": "82C791FB-8979-489E-853D-706D7743****",
  "OrderId": "20881824000****"

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterPeriod is mandatory for this action.-
400InvalidParamPeriod is invalidThe specified subscription duration is invalid.
400ResourceNotAvailableResource you requested is not available for finance user.The requested resource is unavailable to users of Alibaba Finance Cloud.
400InsufficientBalanceYour account does not have enough balance.Your account balance is insufficient. Add funds to your account and try again.
400Order.LatestOrderIsHandingLatest order is handing, please retry later.-
403RealNameAuthenticationErrorYour account has not passed the real-name authentication yet.Your account has not completed real-name verification.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-21The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: AutoRenew
    Added Input Parameters: AutoRenewPeriod
2023-07-20API Description Update. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403