> 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/cn/compute/vm/disk/inquirypricecreatedisks.md).

# InquiryPriceCreateDisks

## 1. 接口描述

本接口(InquiryPriceCreateDisks)用于创建云硬盘询价。

{% hint style="info" %}
**注意事项**

* 本接口只能为数据类型的云硬盘询价。
* 如果客户是预付费类型，则只支持预付费询价，反之亦然。如需开通对应付费方式，请联系Support。
  {% endhint %}

## 2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

| 参数名称          | 必选 | 类型                                                                           | 描述                                                                             |
| ------------- | -- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| zoneId        | 是  | String                                                                       | <p>可用区ID。</p><p>可从DescribeZones接口中获取。</p>                                      |
| diskSize      | 是  | Integer                                                                      | <p>云硬盘大小，单位GB。</p><p>可选值范围：\[20, 20000]</p>                                    |
| chargeType    | 是  | [ChargeType](/api-reference/cn/compute/vm/datastructure.md#chargetype)       | <p>付费类型。</p><p>PREPAID：预付费，即包年包月。</p><p>POSTPAID：后付费。</p>                      |
| diskAmount    | 否  | Integer                                                                      | <p>云硬盘数量。</p><p>最小值与默认值均为1，最大值50。</p><p>可选值范围：\[1, 50]</p><p>默认值：1</p>         |
| chargePrepaid | 否  | [ChargePrepaid](/api-reference/cn/compute/vm/datastructure.md#chargeprepaid) | <p>预付费模式，即包年包月相关参数设置。</p><p>若指定云硬盘的付费类型为预付费则该参数必传。</p>                         |
| diskCategory  | 否  | String                                                                       | <p>云硬盘种类。</p><p>STANDARD：标准云盘。</p><p>SSD：固态硬盘。</p><p>默认为SSD。</p><p>默认值：SSD</p> |

## 3. 响应结果

| 参数名称          | 类型                                                                   | 描述                                                       |
| ------------- | -------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId     | String                                                               | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| dataDiskPrice | [PriceItem](/api-reference/cn/compute/vm/datastructure.md#priceitem) | 云硬盘价格。                                                   |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 创建云硬盘询价。**

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

Request:
{
  "zoneId": "HKG-A",
  "diskSize": 2000,
  "chargeType": "PREPAID",
  "chargePrepaid": {
    "period": 1,
    "periodUnit": "Month"
  }
}

Response:
{
  "requestId": "TF84F83D3-8F9B-4F49-952E-A7278F7C1183",
  "response": {
    "dataDiskPrice": {
      "discount": 100.0,
      "discountPrice": 2000.0,
      "originalPrice": 2000.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
    "requestId": "TF84F83D3-8F9B-4F49-952E-A7278F7C1183"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](/api-reference/cn/api-introduction/instruction/commonerrorcode.md)

| HTTP状态码 | 错误码 | 说明 |
| ------- | --- | -- |
