Changing the Payment Mode
Function
This API is used to change the billing mode of a resource. Currently, only pay-per-use resources can be changed to yearly/monthly resources.
This API is in the open beta test (OBT) phase and may be unavailable in some regions.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
POST /v3/{project_id}/vaults/change-charge-mode
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
charging_mode |
No |
String |
Billing mode. Currently, only pre_paid is available, indicating yearly/monthly billing. |
|
period_type |
Yes |
String |
The unit of the subscription term. This parameter is mandatory only when charging_mode is pre_paid. Default value: N/A The value can be: |
|
period_num |
Yes |
Integer |
Subscription term. This parameter is mandatory only when charging_mode is pre_paid. Default value: N/A Range: [1-9] |
|
is_auto_renew |
No |
Boolean |
Specifies whether to automatically renew the subscription upon expiration. The default value is false. The options are as follows: |
|
is_auto_pay |
No |
Boolean |
Specifies whether to automatically pay for the order. The default value is false. The options are as follows: |
|
console_url |
No |
String |
Cloud service console URL. The URL used to switch to the cloud service console to view information after the subscription is complete. (This parameter is used only for manual payment.) Default value: N/A |
|
vault_ids |
Yes |
Array of strings |
Resource list. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
orderId |
String |
Order ID |
|
retCode |
Number |
Change status code |
|
retMsg |
String |
Change information |
Example Requests
Changing the billing mode of a pay-per-use vault to yearly/monthly
https://{endpoint}/v3/{project_id}/orders/change-to-period
{
"vault_ids" : [ "9dd8f8db-a926-440b-9af5-81b643618898" ],
"charging_mode" : "pre_paid",
"period_type" : "year",
"period_num" : 2,
"is_auto_renew" : true,
"is_auto_pay" : true,
"console_url" : "https://www.{endpoint}/v3/"
}
Example Responses
Status code: 200
OK
{
"orderId" : "CS2305291628MSG5A",
"retCode" : 0,
"retMsg" : "success"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot