You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Volumes
ModifyVolumeChargeType - Switch volume billing method
Copy page
Download PDF
ModifyVolumeChargeType - Switch volume billing method
Call the ModifyVolumeChargeType API to change the volume billing method.​
precautions​
  • Switch from pay-as-you-go to annual or monthly subscription​
  • Only pay-as-you-go data volumes mounted on annual or monthly ECS instances can be converted individually to annual or monthly subscription data volumes, and the expiration of the data volume will match the ECS instance.​
  • Switch from annual or monthly subscription to pay-as-you-go​
  • If an annual or monthly system volume needs to be converted to pay-as-you-go, it must be switched together with the attached ECS instance. For details, see Switch from annual or monthly subscription to pay-as-you-go. Annual or monthly data volumes can be converted individually to pay-as-you-go, or together with the instance.​
  • When a yearly or monthly volume is converted to pay-as-you-go, the platform will deduct the used amount and refund the remaining amount paid (in cash, excluding coupon deductions) to your Volcano Engine account balance. Used coupons are non-refundable. For detailed rules on refund calculation, see cancellation instructions.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
request parameters​
Only the unique request parameters and some common parameters for this interface are listed below. For more information, see common parameters.​
Action string required Example value: ModifyVolumeChargeType​
Operation to perform, value: ModifyVolumeChargeType.​
​
Version string required Example: 2020-04-01​
The version of the API is: 2020-04-01.​
​
InstanceId string required Example: i-bp1i778bq705cvx1****​
Mounted volume instance ID.​
warning​
Only pay-as-you-go data disks attached to subscription instances can be converted to subscription.​
​
DiskChargeType string required Example: PrePaid​
Volume billing method. Value descriptions are as follows:​
  • PrePaid: Convert pay-as-you-go data disks to subscription data disks.​
  • PostPaid: Convert subscription data disks to pay-as-you-go data disks.​
​
AutoPay boolean Optional Example: true​
Enable automatic payment. Value descriptions are as follows:​
  • true (default): Automatic payment. Ensure your account balance is sufficient, as insufficient funds will result in abnormal orders that can only be voided.​
  • false: Only generates an order without charging the account. If your account balance is insufficient, a normal unpaid order will be generated. You can log in to the ECS console to pay for this order.​
​
VolumeIds.N string[] required Example: VolumeIds.1=vol-3tiz8tg97u3vj0x0**** VolumeIds.2=vol-3tj20xxpd63vj0wy****​
List of volume IDs to be converted for billing method.​
tip​
Supports batch conversion. Only data volumes mounted on the same subscription instance can be converted in bulk.​
​
​
​
Response parameters​
Only the unique response parameters for this interface are listed below. For more details, refer to response structure.​
Number string Example value: Order708151602546642****​
The returned order number.​
​
​
​
Request example​
​
GET /?Action=ModifyVolumeChargeType&DiskChargeType=PrePaid&VolumeIds.1=vol-3tiz8tg97u3vj0x0****&VolumeIds.2=vol-3tj20xxpd63vj0wy****&InstanceId=i-l2soxrgan390t1dk**** HTTP/1.1​
Host: open.volcengineapi.com​
Region: cn-beijing​
X-TT-Logid: 202106232008120102251331430A0D7B20​
​
Back to example​
​
{​
"ResponseMetadata": {​
"RequestId": "2022040115591901022524315306A6****",​
"Action": "ModifyVolumeChargeType",​
"Version": "2020-04-01",​
"Service": "storage_ebs",​
"Region": "cn-beijing"​
},​
"Result": {​
"Number": "Order708151602546642****"​
}​
}​
​
error code​
The following table lists error codes related to this interface and business logic. For public error codes, refer to the Public Error Codes documentation.​
​
Status code​
error code​
error message​
Create Volume​
400​
InvalidInstanceType.ValueUnauthorized​
The specified InstanceType is not Supported.​
You do not have permission to operate this instance type.​
400​
Account.Arrearage​
Your account has been in arrears.​
Insufficient account balance. Please top up your account before proceeding.​
400​
InvalidInstance.UnPaidOrder​
The specified Instance has unpaid order.​
The specified instance has unpaid orders. Complete the payment first before proceeding.​
400​
InvalidInstanceId.Released​
The specified Instance is not exist.​
The specified instance does not exist. Check whether the instance ID is correct.​
400​
MissingParameter.InstanceIdNotSupported​
InstanceId should not be null.​
The InstanceId parameter cannot be empty.​
400​
OrderCreationFailed​
Create Order failed, please check your parameters and try it later.​
Failed to create order. Check your parameters and try again.​
​
Last updated: 2026.01.09 18:19:56