All Products
Search
Document Center

ApsaraDB RDS:ModifyDBInstancePayType

Last Updated:May 16, 2023

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

Operation Description

This operation is used to change only the billing method of an instance from pay-as-you-go to subscription.

The following requirements must be met:

  • The instance belongs to the current account.

  • The instance uses one of the most recent instance types. For more information, see Instance types.

    **

    NoteYou cannot change the billing method of an instance that uses a phased-out instance type from pay-as-you-go to subscription. If you want to change the billing method of an instance that uses a phased-out instance type from pay-as-you-go to subscription, you must change the instance type of the instance to one of the most recent instance types. Then, you can change the billing method of the instance from pay-as-you-go to subscription. To change the instance type of an instance, you can change the instance specifications of the instance. For more information, see Change the specifications of an ApsaraDB RDS instance.

  • The instance uses the pay-as-you-go billing method and is in the Running state.

  • Your Alibaba Cloud account has no unpaid orders for the instance for which you want to change the billing method.

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
rds:ModifyDBInstancePayTypeWRITE
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the instance.

rm-bp1842vmucoa5w874
UsedTimeintegerNo

Valid values when Period is set to Year: 1 to 9. Valid values when Period is set to Month: 1, 2, and 3.

2
PayTypestringYes

The billing method of the instance. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
Prepaid
PeriodstringYes

The subscription method of the instance. This parameter must be specified when PayType is set to Prepaid.

  • Year
  • Month
Year

Response parameters

ParameterTypeDescriptionExample
object
OrderIdlong

The ID of the order.

100789370230206

Examples

Sample success responses

JSONformat

{
  "OrderId": 100789370230206
}

Error codes

HTTP status codeError codeError messageDescription
400IncompleteAccountInfoYour information is incomplete. Complete your information before the operation.The operation failed. Items that are marked with an asterisk (*) in the account information must be specified. Make sure that you specify these items on the Basic Information page in Account Center.
400IncompleteTaxInfo Your tax information is incomplete. Complete your information before the operation.-
400InvalidPaymentMethod.Incomplete No payment method is specified for your account. We recommend that you add a payment method.-
400InvalidPaymentMethod.Missing Your payment method is incomplete. We recommend that you add a payment method.-
400InsuffcientBalanceOrBankAccountAdd a payment method or add funds to the prepayment balance. Get started by creating an instance.No valid payment method is specified within your Alibaba Cloud account. Add a valid payment method or add funds to your Alibaba Cloud account.
400InvalidPaymentMethod.NoAccessNo payment method is specified for your account. Please contact your Customer Manager or open a ticket.-
400InvalidPaymentMethod.MissingNo payment method is specified for your account. We recommend that you add a payment method.No valid payment method is specified for your Alibaba Cloud account. Add a valid payment method.
400InvalidPaymentMethod.InsufficientBalanceNo payment method is specified for your account. We recommend that you add a payment method or add funds to the prepayment balance.-
400OrderTaskAlreadyExistsOrder task already exists.The specified order task already exists.
400ReadOnlyInstanceNotSupportSpecified ReadOnly Instance not support this operation.Read-only instances do not support the operation.

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

Change history

Change timeSummary of changesOperation
2022-06-23API Description Update,The error codes of the API operation change.
Change itemChange content
API DescriptionAPI Description Update
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400