> 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/sdn/pricing/querydatacenterportprices.md).

# QueryDataCenterPortPrices

## 1. API Description

This API (QueryDataCenterPortPrices) is used to batch Inquiry Data Center Port Prices

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name                | Required | Type            | Description                                                                                                                                                                                                                                                                           |
| ----------------------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dcIds                         | Yes      | Array of String | <p>List of data center IDs. The latest list of data centers can be obtained via the <a href="/api-reference/sdn/location/describedatacenters.md">DescribeDataCenters</a> API.</p><p>Up to 100 IDs supported per query.</p>                                                            |
| portType                      | Yes      | String          | Port spec. The latest port spec list can be obtained via the [DescribeDataCenterPortPrice](/api-reference/sdn/data-center-port/describedatacenterportprice.md) API.                                                                                                                   |
| buildCrossConnectWithAssisted | No       | Boolean         | <p>Whether Zenlayer-assisted Cross Connect construction is required.</p><p>If true, the price includes the Cross Connect patch cord fee and the one-time construction fee.</p><p>Default: false, meaning the user builds the Cross Connect themselves.</p><p>Default value: false</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> |
| prices         | Array of [DatacenterPortPrice](/api-reference/sdn/datastructure.md#datacenterportprice) | List of data center port prices.                                                                                      |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Batch inquire prices for data center ports, using Zenlayer-assisted Cross Connect construction.**

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

Request:
{
    "dcIds": [
        "822b9bd9-44f0-4279-a64d-568f5bc4a77b",
        "eab1caab-4970-4d34-9e79-c75ecd7eb1ee"
    ],
    "portType": "10G",
    "buildCrossConnectWithAssisted": true
}

Response:
{
    "requestId": "TFAC9662F-EE4D-4CF5-A6D1-CA51AB0A8D54",
    "response": {
        "requestId": "TFAC9662F-EE4D-4CF5-A6D1-CA51AB0A8D54",
        "prices": [
            {
                "crossConnectOneTimeConstructionPrice": null,
                "dcId": "eab1caab-4970-4d34-9e79-c75ecd7eb1ee",
                "price": {
                    "unitPrice": 0.750000,
                    "originalPrice": null,
                    "discountPrice": null,
                    "discount": 100,
                    "stepPrices": null,
                    "discountUnitPrice": 0.750000,
                    "chargeUnit": "DAY",
                    "amountUnit": null
                },
                "stock": 13,
                "crossConnectPrice": null
            },
            {
                "crossConnectOneTimeConstructionPrice": {
                    "unitPrice": 500.000000,
                    "originalPrice": null,
                    "discountPrice": null,
                    "discount": null,
                    "stepPrices": null,
                    "discountUnitPrice": 500.000000,
                    "chargeUnit": "MONTH",
                    "amountUnit": null
                },
                "dcId": "822b9bd9-44f0-4279-a64d-568f5bc4a77b",
                "price": {
                    "unitPrice": 0.550000,
                    "originalPrice": null,
                    "discountPrice": null,
                    "discount": 100,
                    "stepPrices": null,
                    "discountUnitPrice": 0.550000,
                    "chargeUnit": "DAY",
                    "amountUnit": null
                },
                "stock": 11,
                "crossConnectPrice": {
                    "unitPrice": 15.000000,
                    "originalPrice": null,
                    "discountPrice": null,
                    "discount": 100,
                    "stepPrices": null,
                    "discountUnitPrice": 15.000000,
                    "chargeUnit": "MONTH",
                    "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\_DATACENTER\_NOT\_FOUND | The specified data center does not exist. |
