Updated on 2026-08-10 GMT+08:00

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

charging_mode

No

String

Definition

Billing mode.

Constraints

N/A

Range

Currently, only pre_paid is available, indicating yearly/monthly billing.

Default Value

N/A

period_type

Yes

String

Definition

Subscription term unit.

Constraints

This parameter is valid and mandatory only when charging_mode is pre_paid.

Range

  • month

  • year

Default Value

N/A

period_num

Yes

Integer

Definition

Number of subscription terms.

Constraints

This parameter is valid and mandatory only when charging_mode is pre_paid.

Range

1–9

Default Value

N/A

is_auto_renew

No

Boolean

Definition

Whether to automatically renew the subscription upon expiration.

Constraints

N/A

Range

  • true: automatically renews the subscription.

  • false: does not automatically renew the subscription.

Default Value

false

is_auto_pay

No

Boolean

Definition

Automatic payment.

Constraints

N/A

Range

  • true: The payment is automatically made after the order is placed.

  • false: The payment is not automatically made after the order is placed.

Default Value

false

console_url

No

String

Definition

URL used to switch to the cloud service console to view information after the payment is made.

Constraints

This parameter is used only for manual payment.

Range

N/A

Default Value

N/A

vault_ids

Yes

Array of strings

Definition

Vault list. For details about how to obtain the vault ID, see Querying the Vault List.

Constraints

N/A

Range

A vault ID is a UUID. The value of this parameter can contain 1 to 60 vault IDs.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

orderId

String

Definition

Resource modification order ID.

Range

N/A

retCode

Number

Definition

Response code for the resource specification modification.

Range

N/A

retMsg

String

Definition

Response message for the modification.

Range

N/A

Example Requests

Changing the billing mode of a pay-per-use vault to yearly/monthly

POST https://{endpoint}/v3/{project_id}/vaults/change-charge-mode

{
  "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.