> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/compute/zec/elastic-ip/changeeipinternetchargetype.md).

# ChangeEipInternetChargeType

## 1. API Description

This API (ChangeEipInternetChargeType) is used to change the network billing method of an elastic IP.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name     | Required | Type                                                                                 | Description                                                                                                                                                                                                   |
| ------------------ | -------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| eipId              | Yes      | String                                                                               | ID of the elastic IP.                                                                                                                                                                                         |
| internetChargeType | Yes      | [InternetChargeType](/api-reference/compute/zec/datastructure.md#internetchargetype) | Network billing methods.                                                                                                                                                                                      |
| flowPackage        | No       | Float                                                                                | <p>Traffic package size.</p><p>Unit: TB.</p><p>The network charging method is traffic package-based (ByTrafficPackage), and it needs to be specified when using this method.</p><p>Value range: \[0.0, +)</p> |
| bandwidth          | No       | Integer                                                                              | <p>Bandwidth limit.</p><p>Unit: Mbps.</p><p>When the network billing method is set to "By Bandwidth" (based on bandwidth), a specification is required.</p><p>Value range: \[1, +)</p>                        |
| bandwidthCap       | No       | Integer                                                                              | Burst bandwidth cap. Only applicable to legacy Remote IPT (RIPT) type EIPs. Unit: Mbps.                                                                                                                       |
| clusterId          | No       | String                                                                               | <p>Bandwidth cluster ID.</p><p>Must be specified if changing to bandwidth cluster billing.</p>                                                                                                                |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                                           |
| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| orderNumber    | String | Order No.                                                                                                             |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Change the network billing method of an elastic IP.**

<pre class="language-json"><code class="lang-json"><strong>POST /api/v2/zec HTTP/1.1
</strong>Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ChangeEipInternetChargeType


Request:
{
  "eipId": "xxx",
  "internetChargeType": "ByTrafficPackage"
}

Response:
{
  "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
  "response": {
    "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
    "orderNumber": "xxx"
  }
}
</code></pre>

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                                                            | Description                                                                                                    |
| ---------------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| 404              | INVALID\_EIP\_NOT\_FOUND                                              | Elastic IP does not exist.                                                                                     |
| 404              | INVALID\_REGION\_NOT\_FOUND                                           | Specified availability zone does not exist.                                                                    |
| 400              | OPERATION\_DENIED\_EIP\_IN\_RISK\_CONTROL                             | This operation is not supported for elastic IPs under risk control.                                            |
| 500              | OPERATION\_DENIED\_EIP\_STATUS\_NOT\_SUPPORT                          | Operation is not supported for the elastic IP in current status.                                               |
| 400              | OPERATION\_DENIED\_LATEST\_OPERATION\_NOT\_FINISHED                   | The previous operation has not been completed or has failed. Please try again later.                           |
| 400              | OPERATION\_DENIED\_EIP\_UNSUPPORTED\_INTERNET\_CHARGE\_TYPE           | The target network billing method is not supported.                                                            |
| 400              | OPERATION\_DENIED\_INTERNET\_CHARGE\_TYPE\_NOT\_SUPPORT               | IP network billing type is not supported.                                                                      |
| 400              | OPERATION\_DENIED\_FIXED\_BANDWIDTH\_NOT\_SUPPORTED\_FOR\_PATH\_BASED | PathBasedBandwidthIP does not support fixed bandwidth billing.                                                 |
| 400              | OPERATION\_DENIED\_FLOW\_PACKAGE\_NOT\_SUPPORTED\_HOUR\_PERIOD        | The current product cycle is based on hourly billing and does not support setting a minimum data package size. |
| 400              | INVALID\_PARAMETER\_BANDWIDTH\_ERROR                                  | Bandwidth size is below the minimum limit.                                                                     |
| 400              | INVALID\_PARAMETER\_BANDWIDTH\_EXCEED                                 | Bandwidth size exceeds the upper limit.                                                                        |
| 400              | INVALID\_BANDWIDTH\_CAP\_LESS\_THAN\_BANDWIDTH                        | The value of bandwidthCap must not be less than bandwidth.                                                     |
| 400              | INVALID\_BANDWIDTH\_CAP\_EXCEED\_BURST\_LIMIT                         | The bandwidthCap has exceeded the burst limit.                                                                 |
| 400              | INVALID\_BANDWIDTH\_CAP\_OUT\_OF\_LADDER\_RANGE                       | The bandwidthCap has exceeded the range of the tiers.                                                          |
| 400              | INVALID\_BANDWIDTH\_COMMIT\_NOT\_IN\_RANGE                            | The bandwidth is not within the valid range of steps.                                                          |
| 400              | INVALID\_PARAMETER\_TRAFFIC\_PACKAGE\_EXCEED                          | Data traffic package exceeds the maximum limit.                                                                |
| 400              | INVALID\_PARAMETER\_FLOW\_TRAFFIC\_PACKAGE                            | Data transfer package size is invalid.                                                                         |
| 400              | INVALID\_PARAMETER\_TRAFFIC\_PACKAGE                                  | The size of the data package must be a multiple of 0.1.                                                        |
| 400              | INVALID\_PARAMETER\_FLOW\_PACKAGE\_NOT\_SUPPORTED\_FOR\_PATH\_BASED   | PathBasedBandwidthIP does not support custom traffic package sizes. Pass 0 or omit this parameter.             |
