Help Center/ NAT Gateway/ API Reference/ APIs for Public NAT Gateways/ Public NAT Gateways/ Changing the Billing Mode of a Public NAT Gateway from Pay-per-Use to Yearly/Monthly
Updated on 2026-03-19 GMT+08:00

Changing the Billing Mode of a Public NAT Gateway from Pay-per-Use to Yearly/Monthly

Function

This API is used to change the billing mode of a public NAT gateway from pay-per-use to yearly/monthly.

Calling Method

For details, see Calling APIs.

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 /v2/{project_id}/nat_gateways/{nat_gateway_id}/change_to_period

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

nat_gateway_id

Yes

String

Specifies the public NAT gateway ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

prepaid_options

No

PrepaidOptions object

Specifies the payment attributes.

Table 3 PrepaidOptions

Parameter

Mandatory

Type

Description

period_type

Yes

String

Specifies the subscription period type. Both monthly and yearly subscriptions are supported.

  • month: monthly subscriptions

  • year: yearly subscriptions

period_num

Yes

Integer

Number of subscription periods. The value varies depending on the operations policy.

  • The value ranges from 1 to 9, if period_type is set to month.

  • The value ranges from 1 to 3, if period_type is set to year.

is_auto_renew

No

Boolean

Whether to enable auto renewal.

  • true: Auto renewal is enabled.

  • false: Auto renewal is disabled.

is_auto_pay

No

Boolean

Whether the payment will be automatically deducted from your account balance when an order is submitted.

  • true: The order will be automatically paid.

  • false: The order will not be automatically paid.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

order_id

String

Specifies the order ID.

Example Requests

POST https://{NAT_endpoint}/v2/70505c941b9b4dfd82fd351932328a2f/nat_gateways/e1cacb3c-46a0-4c8e-9c4a-91eb63635f62/change_to_period

{
  "prepaid_options" : {
    "period_type" : "month",
    "period_num" : 1,
    "is_auto_renew" : false,
    "is_auto_pay" : true
  }
}

Example Responses

Status code: 200

Successful request.

{
  "order_id" : "CS2304211201WYELB"
}

Status Codes

Status Code

Description

200

Successful request.

Error Codes

See Error Codes.