# InquiryPriceCreateDisks

## 1. API Description

This API (InquiryPriceCreateDisks) is used to query the price of creating a disk.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">Only operations on data disks are supported.</mark>
* <mark style="color:blue;">For a</mark> <mark style="color:blue;">`PREPAID`</mark> <mark style="color:blue;">disk, call this API to query the subscription price; for a</mark> <mark style="color:blue;">`POSTPAID`</mark> <mark style="color:blue;">disk, query the pay-as-you-go price. If you need to purchase specified disks, please contact Zenlayer Support.</mark>
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type                                                                      | Description                                                                                                                                         |
| -------------- | -------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| zoneId         | Yes      | String                                                                    | <p>ID of zone to which the disk belongs.</p><p>Call DescribeZones to obtain.</p>                                                                    |
| diskSize       | Yes      | Integer                                                                   | <p>Storage space.</p><p>Unit: GB.</p><p>Value range: \[20, 20000]</p>                                                                               |
| chargeType     | Yes      | [ChargeType](/api-reference/compute/vm/datastructure.md#chargetype)       | <p>Cloud disk pricing model.</p><p>PREPAID: subscription</p><p>POSTPAID: pay-as-you-go</p>                                                          |
| diskAmount     | No       | Integer                                                                   | <p>Quantity of cloud disks.</p><p>Minimum value: 1 (default value);</p><p>Maximum value: 50.</p><p>Value range: \[1, 50]</p><p>Default value: 1</p> |
| chargePrepaid  | No       | [ChargePrepaid](/api-reference/compute/vm/datastructure.md#chargeprepaid) | Details of the monthly subscription, including the purchase period, auto-renewal. It is required if the chargeType is PREPAID.                      |
| diskCategory   | No       | String                                                                    | <p>Disk type.Standard Disk: Hard Disk DriveSSD: Solid State Drive</p><p>Default value: SSD</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> |
| dataDiskPrice  | [PriceItem](/api-reference/compute/vm/datastructure.md#priceitem) | Price of a disk.                                                                                                      |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the price of creating a disk.**

```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. 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 |
| ---------------- | ---------- | ----------- |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/compute/vm/disk/inquirypricecreatedisks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
