> 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/ipt/ip-transit/inquirymodifyiptransitprice.md).

# InquiryModifyIPTransitPrice

## 1. API Description

This API (InquiryModifyIPTransitPrice) is used to queries the price of an IP Transit configuration change.

{% hint style="info" %}
**Notes**

* BFD and BGP related operations (`BFD`, `BGP_ROUTE_TYPE`, `BGP_ASN_AS_SET`, `BGP_PASSWORD`) and HA switchover operations (`HA_SWITCH_PRIMARY`, `HA_SWITCH_MODE`) do not involve pricing changes. Calling this API with these types returns the `INVALID_RIPT_CONFIG_TYPE_NO_PRICE_CHANGE` error; you can call `ModifyIPTransitConfig` directly without a price inquiry.
* When `type=BANDWIDTH`, `bandwidth` is required. Returns `privateConnectPrice` (private connect price) and `iptPrice` (bandwidth price).
* For IP Transits with 95th percentile billing (`internetType=ByInstanceBandwidth95`), the price is determined solely by `commitBandwidth`: when `type=BANDWIDTH`, `commitBandwidth` must be specified explicitly and cannot be replaced by `bandwidth`. If `commitBandwidth` is unchanged from the current value, the price does not change and the `INVALID_RIPT_CONFIG_TYPE_NO_PRICE_CHANGE` error is returned; you can call `ModifyIPTransitConfig` directly without a price inquiry. `bandwidth` must be greater than or equal to `commitBandwidth`; otherwise the `INVALID_RIPT_BANDWIDTH_LESS_THAN_COMMIT` error is returned.
* When `type=ADD_CIDR_BLOCK` or `EXPAND_CIDR_BLOCK`, `publicIPv4BlockSize` is required. Returns `iptIpPrices` (public IP block prices). IP Transits with the Standard BGP tier (`bgp.tier=STANDARD`) do not support `ADD_CIDR_BLOCK`; otherwise the `OPERATION_DENIED_STANDARD_BGP_ADD_CIDR` error is returned.
* When `type=DEL_CIDR_BLOCK` or `SHRINK_CIDR_BLOCK`, `ipUuid` is required, indicating the target IP block to unsubscribe from or shrink.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name      | Required | Type                                                                                 | Description                                                                                                                                                                                                   |
| ------------------- | -------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| iptId               | Yes      | String                                                                               | IP Transit instance ID.                                                                                                                                                                                       |
| type                | Yes      | [IPTransitConfigType](/api-reference/ipt/datastructure.md#iptransitconfigtype)       | <p>Configuration change type.</p><p>Supports BANDWIDTH, ADD\_CIDR\_BLOCK, DEL\_CIDR\_BLOCK, EXPAND\_CIDR\_BLOCK, and SHRINK\_CIDR\_BLOCK. BFD/BGP/HA operations incur no charge and are not allowed here.</p> |
| bandwidth           | No       | Integer                                                                              | <p>Target bandwidth (Mbps).</p><p>Required when type is BANDWIDTH.</p><p>Value range: \[5, +)</p>                                                                                                             |
| commitBandwidth     | No       | Integer                                                                              | <p>Committed bandwidth (Mbps).</p><p>Effective when type is BANDWIDTH. If not specified, defaults to the same value as bandwidth.</p><p>Value range: \[5, +)</p>                                              |
| publicIPv4BlockSize | No       | Integer                                                                              | <p>IPv4 CIDR netmask length (24-32).</p><p>Required when type is ADD\_CIDR\_BLOCK, EXPAND\_CIDR\_BLOCK, or SHRINK\_CIDR\_BLOCK.</p>                                                                           |
| ipUuid              | No       | String                                                                               | <p>UUID of the target IP block.</p><p>Required when type is DEL\_CIDR\_BLOCK, EXPAND\_CIDR\_BLOCK, or SHRINK\_CIDR\_BLOCK.</p>                                                                                |
| ipNetworkType       | No       | [IPTransitIpNetworkType](/api-reference/ipt/datastructure.md#iptransitipnetworktype) | <p>IP network type.</p><p>Effective when type is ADD\_CIDR\_BLOCK. Default: BGP\_IP.</p>                                                                                                                      |
| marketingInfo       | No       | [MarketingInfo](/api-reference/ipt/datastructure.md#marketinginfo)                   | <p>Marketing activity information, including whether to use a POC voucher.</p><p>Valid only when type is ADD\_CIDR\_BLOCK. The pricing inquiry must use the same settings as the actual order.</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> |
| privateConnectPrice       | [PriceItem](/api-reference/ipt/datastructure.md#priceitem)                                | <p>Private connect (VLL) price.</p><p>May have a value for the BANDWIDTH type; empty for Router RIPT.</p>             |
| privateConnectBandwidth   | Integer                                                                                   | <p>Private connect bandwidth (Mbps).</p><p>Has a value for the BANDWIDTH type.</p>                                    |
| iptPrice                  | [PriceItem](/api-reference/ipt/datastructure.md#priceitem)                                | IP Transit bandwidth price.                                                                                           |
| iptIpPrices               | Array of [IPTransitIpPriceItem](/api-reference/ipt/datastructure.md#iptransitippriceitem) | <p>List of public CIDR block prices.</p><p>Has a value for ADD\_CIDR\_BLOCK and EXPAND\_CIDR\_BLOCK types.</p>        |
| publicInterconnectIpPrice | [IPTransitIpPriceItem](/api-reference/ipt/datastructure.md#iptransitippriceitem)          | <p>Public interconnect block price.</p><p>Populated when public interconnect is enabled; otherwise empty.</p>         |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query the cost of upgrading the bandwidth to 200 Mbps.**

```json
POST /api/v2/ipt HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: InquiryModifyIPTransitPrice
<Common Request Params>

Request:
{
  "iptId": "your-ipt-id",
  "type": "BANDWIDTH",
  "bandwidth": 200
}

Response:
{
  "requestId": "T12345678-ABCD-1234-EFGH-000000000002",
  "response": {
    "requestId": "T12345678-ABCD-1234-EFGH-000000000002",
    "privateConnectPrice": {
      "unitPrice": 8.250000,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "discountUnitPrice": 8.250000,
      "chargeUnit": "DAY",
      "amountUnit": null
    },
    "privateConnectBandwidth": 200,
    "iptPrice": {
      "unitPrice": 6.666668,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "discountUnitPrice": 6.666668,
      "chargeUnit": "DAY",
      "amountUnit": null
    },
    "iptIpPrices": null,
    "publicInterconnectIpPrice": null
  }
}
```

**2. Query the cost of adding a /28 public IPv4 CIDR block.**

```json
POST /api/v2/ipt HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: InquiryModifyIPTransitPrice
<Common Request Params>

Request:
{
  "iptId": "your-ipt-id",
  "type": "ADD_CIDR_BLOCK",
  "publicIPv4BlockSize": 28
}

Response:
{
  "requestId": "T12345678-ABCD-1234-EFGH-000000000003",
  "response": {
    "requestId": "T12345678-ABCD-1234-EFGH-000000000003",
    "privateConnectPrice": null,
    "privateConnectBandwidth": null,
    "iptPrice": null,
    "iptIpPrices": [
      {
        "netmask": 28,
        "amount": 1,
        "ipNetworkType": "BGP_IP",
        "price": {
          "unitPrice": 0.233334,
          "originalPrice": null,
          "discountPrice": null,
          "discount": 100,
          "stepPrices": null,
          "discountUnitPrice": 0.233334,
          "chargeUnit": "DAY",
          "amountUnit": null
        }
      }
    ],
    "publicInterconnectIpPrice": null
  }
}
```

{% 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                                                                                                |
| ---------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| 400              | INVALID\_RIPT\_CONFIG\_TYPE\_NO\_PRICE\_CHANGE | This configuration type does not involve a price change; there is no need to call this price inquiry API.  |
| 400              | INVALID\_RIPT\_BANDWIDTH\_LESS\_THAN\_COMMIT   | `bandwidth` must be greater than or equal to `commitBandwidth` when internetType is ByInstanceBandwidth95. |
| 404              | INVALID\_RIPT\_NOT\_FOUND                      | The IP Transit instance does not exist.                                                                    |
| 403              | OPERATION\_DENIED\_STANDARD\_BGP\_ADD\_CIDR    | IP Transits with the Standard BGP tier do not support adding public IP blocks.                             |
