# InquiryPriceCreateLoadBalancer

## 1. API Description

This API (InquiryPriceCreateLoadBalancer) is used to query the price for creating a load balancer.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name              | Required | Type                                                                                                              | Description                                                                                                                                                                                                                                   |
| --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| regionId                    | Yes      | String                                                                                                            | Region ID.                                                                                                                                                                                                                                    |
| internetChargeType          | No       | [InternetChargeType](https://docs.console.zenlayer.com/api-reference/networking/datastructure#internetchargetype) | IP network billing model.                                                                                                                                                                                                                     |
| ipNetworkType \[Deprecated] | No       | [EipNetworkType](https://docs.console.zenlayer.com/api-reference/networking/datastructure#eipnetworktype)         | <p>IP network type.</p><p>Deprecated. Please use networkLineType instead.</p>                                                                                                                                                                 |
| networkLineType             | No       | [NetworkLineType](https://docs.console.zenlayer.com/api-reference/networking/datastructure#networklinetype)       | IP network type.                                                                                                                                                                                                                              |
| bandwidthMbps               | No       | Integer                                                                                                           | <p>Maximum outbound bandwidth of the elastic IP.</p><p>Unit: Mbps.</p><p>The maximum limit is usually 10000 Mbps. If you have additional requirements, please contact Support.</p><p>Available range: \[1, +).</p><p>Value range: \[1, +)</p> |
| trafficPackageSize          | No       | Float                                                                                                             | <p>Data transfer package size.</p><p>The parameter is only required when internetChargeType is ByTrafficPackage.</p><p>Available range: \[0.0, 999999.0].</p><p>Value range: \[0.0, 999999.0]</p>                                             |
| bandwidthClusterId          | No       | String                                                                                                            | <p>ID of bandwidth cluster.</p><p>The parameter is only required when internetChargeType is BandwidthCluster.</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> |
| loadBalancerInstancePrice | [PriceItem](https://docs.console.zenlayer.com/api-reference/networking/datastructure#priceitem) | The price of the load balancer instance.                                                                              |
| eipPrice                  | [PriceItem](https://docs.console.zenlayer.com/api-reference/networking/datastructure#priceitem) | The price of the elastic IP.                                                                                          |
| eipNetworkPrice           | [PriceItem](https://docs.console.zenlayer.com/api-reference/networking/datastructure#priceitem) | The price of network billing for the elastic IP.                                                                      |
| lcuPrice                  | [PriceItem](https://docs.console.zenlayer.com/api-reference/networking/datastructure#priceitem) | The price of LCU for the load balance instance.                                                                       |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the price for creating a public network load balance instance.**

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

Request：
{
  "regionId" : "asia-east-1",
  "vpcId" : "<vpcId>",
  "internetChargeType" : "ByBandwidth",
  "ipNetworkType" : "BGPLine",
  "bandwidthMbps" : 2,
  "trafficPackageSize" : null,
  "number" : 1
}

Response：
{
  "requestId": "T775F300E-F989-4CC8-BB6E-0452A4C7EA03",
  "response": {
    "lcuPrice": {
      "unitPrice": null,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": [
        {
          "unitPrice": 1,
          "stepStart": 0,
          "discountUnitPrice": 1,
          "stepEnd": null
        }
      ],
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": null,
      "chargeUnit": "HOUR",
      "amountUnit": "LCU",
      "excessDiscountUnitPrice": null
    },
    "loadBalancerInstancePrice": {
      "unitPrice": 0.016806,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.016806,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "requestId": "T775F300E-F989-4CC8-BB6E-0452A4C7EA03",
    "eipPrice": {
      "unitPrice": 0.076389,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.076389,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipNetworkPrice": {
      "unitPrice": 0.061112,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.061112,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    }
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/api-reference/api-introduction/toolkit/api-sdk)，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](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode).

| HTTP Status Code | Error Code | Description |
| ---------------- | ---------- | ----------- |
