You can call this operation to convert a pay-as-you-go ApsaraDB for MongoDB instance to a subscription instance.

  • Make sure that you fully understand the billing methods and Pricing of ApsaraDB for MongoDB before calling this operation.
  • The billing method of a subscription instance cannot be changed to pay-as-you-go. We recommend that you exercise caution when you change the billing method of an instance to pay-as-you-go.

Before you call this operation, make sure that the following requirements are met:

  • The instance must be in the Running state.
  • The billing method of the instance is pay-as-you-go.
  • The instance has no unpaid subscription orders.
  • The instance type cannot be historical specifications. For a list of historical specifications, see Instance specifications.
    Note To change the billing method of the historical specifications instance to subscription, call ModifyDBInstanceSpec or ModifyNodeSpec interface to change instance specifications.


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 Yes TransformToPrePaid

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

Period Long Yes 1

The subscription period. Unit: months. Value range: 1-9,12,24,36.

InstanceId String Yes dds-bpxxxxxxxx

The ID of the RDS instance.

AutoPay Boolean No true

Indicates whether the order is paid automatically. Valid values:

Note Default value: true.
FromApp String No OpenApi

The request source. Valid values:

  • OpenApi: The request is sent from an API.
  • mongo_buy: The request is sent from the console.
Note Default value: OpenApi.
BusinessInfo String No {"ActivityId":"000000000"}

The business information. It is an additional parameter.

AutoRenew String No true

Indicates whether to auto-renewal after expiration. Valid values:

  • true: enable
  • False: manual renewal
Note Default value: false.
CouponNo String No youhuiquan_promotion_option_id_for_blank

The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.

RegionId String No cn-hangzhou

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

Response parameters

Parameter Type Example Description
RequestId String EFD65226-08CC-4C4D-B6A4-CB3C382F67B0

The ID of the request.

OrderId String 2043xxxxxxxx

The ID of the order.


Sample requests

http(s):// Action=TransformToPrePaid
&<Common request parameters>

Sample success responses

XML format


JSON format

    "OrderId": "2043xxxxxxxx",
    "RequestId": "EFD65226-08CC-4C4D-B6A4-CB3C382F67B0"

Error codes

HTTP status code Error code Error message Description
400 InsufficientBalance Your account does not have enough balance. The error message returned when your account does not have sufficient balance. Top up and try again.
403 RealNameAuthenticationError Your account has not passed the real-name authentication yet. The error message returned when the specified user has not performed real-name authentication. Perform real-name authentication and try again.

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