# QueryCloudRouterBandwidthPrice

## 1. API Description

This API is used to query the price of backbone bandwidth of the cloud router.

## 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 router.</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="182.3203125">Parameter Name</th><th width="100.65478958711435">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 backbone bandwidth of the cloud router.</td></tr><tr><td>stock</td><td>Integer</td><td>Available stock of backbone bandwidth of the cloud router. Unit: Mbps.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the price of backbone bandwidth of the cloud router. The backbone bandwidth is `10 Mbps`.**

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

Request：
{
    "dcId": "SIN1",
    "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": 10000
  }
}
```

{% 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_ROUTER_POINT_NOT_SELLABLE</td><td>Cloud router is not supported for the current data center.</td></tr></tbody></table>
