> 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/inquirycreateiptransitprice.md).

# InquiryCreateIPTransitPrice

## 1. API Description

This API (InquiryCreateIPTransitPrice) is used to queries the price of creating an IP Transit.

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

* When `internetType=ByInstanceBandwidth95` (95th percentile billing), `commitBandwidth` is required. If `bandwidth` is also specified, it must be greater than or equal to `commitBandwidth`; otherwise the `INVALID_RIPT_BANDWIDTH_LESS_THAN_COMMIT` error is returned.
* When `routingType=BGP`, you can pass `bgpTier` to specify the BGP tier (`PREMIUM` for Premium, the default, or `STANDARD` for Standard). The two tiers use different SKUs and prices. The Standard tier supports fixed bandwidth billing only, and `bandwidth` must be one of the fixed tier levels of that data center (for example, 10000/50000/100000 Mbps). `STANDARD` is not supported when `zbgRegionId` is specified (router-based IP Transit).
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name            | Required | Type                                                                                  | Description                                                                                                                                                                                    |
| ------------------------- | -------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| peerPortId                | Yes      | String                                                                                | Port ID.                                                                                                                                                                                       |
| routingType               | Yes      | [IPTransitRouteType](/api-reference/ipt/datastructure.md#iptransitroutetype)          | Routing type.                                                                                                                                                                                  |
| iptDcId                   | No       | String                                                                                | <p>IP Transit destination data center ID.</p><p>If not specified, it means the IP Transit is in the same data center as the port.</p>                                                          |
| internetType              | No       | [InternetType](/api-reference/ipt/datastructure.md#internettype)                      | <p>Bandwidth billing method of the IP Transit.</p><p>Default value: ByBandwidth</p>                                                                                                            |
| commitBandwidth           | No       | Integer                                                                               | <p>Committed bandwidth.</p><p>Unit: Mbps.</p><p>This field is required if and only if internetType is ByInstanceBandwidth95.</p><p>Value range: \[5, +)</p>                                    |
| bandwidth                 | No       | Integer                                                                               | <p>Bandwidth cap.</p><p>Unit: Mbps.</p><p>Minimum value: 5 Mbps.</p><p>Default value: 5 Mbps.</p><p>Value range: \[5, +)</p>                                                                   |
| publicIPv4BlockSize       | No       | Array of Integer                                                                      | <p>Public IPv4 address block.</p><p>Netmask range: 24-30.</p><p>This field is required if and only if routing type is Static or Gateway.</p><p>Currently, only one public CIDR is allowed.</p> |
| bgpRouteType              | No       | [RiptBgpRouteType](/api-reference/ipt/datastructure.md#riptbgproutetype)              | BGP inbound route type.                                                                                                                                                                        |
| bgpTier                   | No       | [RiptBgpTier](/api-reference/ipt/datastructure.md#riptbgptier)                        | <p>BGP tier.</p><p>Defaults to PREMIUM if not specified.</p><p>STANDARD is not supported when <code>zbgRegionId</code> is specified (router-based IP Transit).</p>                             |
| ipType                    | No       | [IPTransitIpType](/api-reference/ipt/datastructure.md#iptransitiptype)                | <p>IP type (IPV4 / IPV6).</p><p>Default: IPV4.</p>                                                                                                                                             |
| publicIpList              | No       | Array of [IPTransitIpRequest](/api-reference/ipt/datastructure.md#iptransitiprequest) | <p>List of public IP allocations.</p><p>Mutually exclusive with publicIPv4BlockSize and takes precedence.</p><p>If this field is specified, publicIPv4BlockSize is ignored.</p>                |
| zbgRegionId               | No       | String                                                                                | <p>ZBG access node ID.</p><p>If specified, the Router RIPT price inquiry process is used.</p>                                                                                                  |
| haConfig                  | No       | [IPTransitHaConfig](/api-reference/ipt/datastructure.md#iptransithaconfig)            | <p>HA configuration.</p><p>If specified, the price inquiry includes the prices of two VLLs.</p>                                                                                                |
| publicInterconnectNetmask | No       | Integer                                                                               | <p>Public interconnect block netmask.</p><p>If specified, the response includes the public interconnect IP block price.</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 price of the IP Transit.</p><p>If the IP Transit and port are in the same data center, the value is empty.</p> |
| iptBandwidthPrice         | [PriceItem](/api-reference/ipt/datastructure.md#priceitem)      | Public bandwidth price of the IP Transit.                                                                                         |
| publicIpPrices            | Array of [IPPrice](/api-reference/ipt/datastructure.md#ipprice) | Public IP prices of the IP Transit.                                                                                               |
| publicInterconnectIpPrice | [IPPrice](/api-reference/ipt/datastructure.md#ipprice)          | <p>Public interconnect IP price.</p><p>Returned only when publicInterconnectNetmask is specified.</p>                             |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query the price of creating an IP Transit with a /25 public CIDR. Bandwidth cap is 50 Mbps, billing method is fixed bandwidth.**

```json
POST /api/v2/ipt HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: InquiryCreateIPTransitPrice
Request：
{
  "iptDescription": "test_ipt_desc",
  "peerPortId": "your-port-id",
  "internetType": "ByBandwidth",
  "bandwidth": 50,
  "iptDcId": "AMS1",
  "routingType": "Static",
  "publicIPv4BlockSize": [
    25
  ]
}
Response：
{
    "requestId": "TBE062689-3CF2-429C-BD2A-6CB7BAB39C11",
    "response": {
        "publicIpPrices": [
            {
                "netmask": 25,
                "price": {
                    "unitPrice": 0.233334,
                    "originalPrice": null,
                    "discountPrice": null,
                    "discount": 100,
                    "stepPrices": null,
                    "discountUnitPrice": 0.233334,
                    "chargeUnit": "DAY",
                    "amountUnit": null
                },
                "qty": 1
            }
        ],
        "requestId": "TBE062689-3CF2-429C-BD2A-6CB7BAB39C11",
        "privateConnectPrice": {
            "unitPrice": 8.250000,
            "originalPrice": null,
            "discountPrice": null,
            "discount": 100,
            "stepPrices": null,
            "discountUnitPrice": 8.250000,
            "chargeUnit": "DAY",
            "amountUnit": null
        },
        "iptBandwidthPrice": {
            "unitPrice": 3.333334,
            "originalPrice": null,
            "discountPrice": null,
            "discount": 100,
            "stepPrices": null,
            "discountUnitPrice": 3.333334,
            "chargeUnit": "DAY",
            "amountUnit": 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                                                                                                |
| ---------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| 404              | INVALID\_RIPT\_NOT\_SELLABLE                   | This data center does not support IP Transit.                                                              |
| 403              | OPERATION\_DENIED\_ZBG\_RIPT\_SAME\_CITY       | ZBG and IPT cannot be in the same city.                                                                    |
| 400              | INVALID\_RIPT\_PUBLIC\_IP\_ALLOCATION\_MISSING | At least one of `publicIPv4BlockSize` and `publicIpList` must be specified.                                |
| 400              | INVALID\_RIPT\_BANDWIDTH\_LESS\_THAN\_COMMIT   | `bandwidth` must be greater than or equal to `commitBandwidth` when internetType is ByInstanceBandwidth95. |
