The content of this article is about how to change the billing method of one or multiple instances. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
ModifyInstanceChargeType
Change the billing method of one or more instances. Supports conversion between pay-as-you-go instances and prepaid (annual and monthly) instances. At the same time, all pay-as-you-go cloud disks attached to the instances can be converted to prepaid (annual and monthly) cloud disks.
Description
When calling this interface, you need to pay attention:
Members who have reached a certain level can use prepaid transfer Pay-as-you-go functionality.
The status of the target instance must be Running or Stopped, and the billing method can be modified only if there is no outstanding payment.
If the pay-as-you-go instance has a release time set, this interface cannot be called.
Supports batch operations, and can modify the billing method of up to 20 instances at a time.
Supports the simultaneous conversion of all pay-as-you-go data disks attached to the instance into annual and monthly subscription data disks.
When you convert an annual or monthly instance to a mortgage instance, the new billing method will cover the entire life cycle of the instance. You will receive a refund for the price difference between the instance billing before and after the modification, which will be refunded to your original account. In payment channels, used vouchers will not be returned.
After changing the billing method, the fee will be automatically deducted by default. You need to ensure that your account balance is sufficient, otherwise an abnormal order will be generated, and the order can only be canceled at this time. If your account balance is insufficient, you can set the parameter AutoPay to false. At this time, a normal unpaid order will be generated, and you can log in to the ECS management console to pay.
Request parameters
## Return parameters
Example
Request example
https://ecs.aliyuncs.com/?Action=ModifyInstanceChargeType &RegionId=cn-hangzhou &InstanceIds=["i-xxxxx1","i-xxxxx2"] &Period=1 &PeriodUnit=Month &AutoPay=false &IncludeAllDisks=true &ClientToken=xxxxxxxxxxxxxx &<公共请求参数>
Return example
XML format
<ModifyInstanceConfigurationResponse> <RequestId>04F0F334-1335-436C-A1D7-6C044FExxxxx</RequestId> <OrderId>10111111111xxxxx</OrderId> </ModifyInstanceConfigurationResponse>
JSON format
{ "RequestId": "04F0F334-1335-436C-A1D7-6C044FExxxxx", "OrderId": 1011111111111111, }
Error codes
The following are the error codes unique to this interface. For more error codes, please visit the API Error Center.The above is the detailed content of How to change the billing method of one or more instances. For more information, please follow other related articles on the PHP Chinese website!