# QueryCloudOnrampPrice

## 1. API Description

This API is used to query the price of cloud connect.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="161.54296875">Parameter Name</th><th width="104.34482758620689">Required</th><th width="124.10546875">Type</th><th>Description</th></tr></thead><tbody><tr><td>dcId</td><td>Yes</td><td>String</td><td>Data center ID of the cloud connect.</td></tr><tr><td>cloudType</td><td>Yes</td><td>String</td><td><p>Cloud connect type.<br>Available values:</p><ul><li><code>AWS</code></li><li><code>TENCENT</code></li><li><code>GOOGLE</code></li><li><code>ALI_CLOUD</code></li><li><code>AZURE</code></li><li><code>HUAWEI_CLOUD</code></li></ul></td></tr><tr><td>vlanId</td><td>No</td><td>Integer</td><td>VLAN ID.</td></tr><tr><td>cloudRegionId</td><td>No</td><td>String</td><td>Region ID of public cloud.<br>Google Cloud requires no parameter passing.</td></tr><tr><td>bandwidthMbps</td><td>No</td><td>Integer</td><td>Bandwidth cap.<br>Default value: <code>10</code>.<br>Unit: Mbps.</td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="172.08203125">Parameter Name</th><th width="114.57666458711435">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required for locating a problem.</td></tr><tr><td>price</td><td><a href="../../datastructure#price">price</a></td><td>Price of the cloud connect.</td></tr><tr><td>stock</td><td>Integer</td><td>Available stock of cloud connect. Unit: Mbps.<br>Both <code>vlanId</code> and <code>cloudRegionId</code> are required to query available cloud connect stock; otherwise, the value will be empty.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the price of AWS cloud connect, including the stock.**

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

Request：
{
    "dcId": "SIN1",
    "cloudType": "AWS",
    "vlanId": 100,
    "cloudRegionId": "eu-west-1",
    "bandwidthMbps": 10
}

Response：
{   
  "requestId": "TDB181167-C39F-4C3E-8E88-B8FDE755FDC0",
  "response": {
    "requestId":"TDB181167-C39F-4C3E-8E88-B8FDE755FDC0",
    "price":        {
            "unitPrice":1.65,
            "originalPrice":null,
            "discountPrice":null,
            "discount":100,
            "stepPrices":null,
            "discountUnitPrice":1.65,
            "chargeUnit":"DAY"
        },
    "stock": 5000
  }
}
```

{% 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).​

<table><thead><tr><th width="167.53255208333331">HTTP Status Code</th><th width="310.3828125">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>404</td><td>INVALID_DATACENTER_NOT_FOUND</td><td>Data center does not exist.</td></tr><tr><td>400</td><td>INVALID_CLOUD_NOT_SELLABLE</td><td>Cloud connect is not supported for the current data center.</td></tr></tbody></table>
