> 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/platform-service/zbc/bill/describebilldetail.md).

# DescribeBillDetail

## 1. API Description

This API is used to query detailed informations on monthly spend by order No. or by resource ID.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="187">Parameter Name</th><th width="115">Required</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td>pageNum</td><td>No</td><td>Integer</td><td><p>Number of pages returned.</p><p>Default value: 1.</p></td></tr><tr><td>pageSize</td><td>No</td><td>Integer</td><td><p>Number of items in the current page result.</p><p>Maximum value: 5000.</p></td></tr><tr><td>billMonthly</td><td>No</td><td>Integer</td><td><p>Month of the bill.</p><p>Default value: the current month.</p><p>Format: <code>yyyyMM</code>.</p></td></tr><tr><td>orderSn</td><td>No</td><td>String</td><td>Order No.</td></tr><tr><td>resourceId</td><td>No</td><td>String</td><td>Resource ID (Instance ID).</td></tr><tr><td>product</td><td>No</td><td>String</td><td>product (product Name).</td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="198">Parameter Name</th><th width="150">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>totalSpend</td><td>Double</td><td>Total spend.</td></tr><tr><td>totalVoucher</td><td>Double</td><td>Total voucher.</td></tr><tr><td>totalCash</td><td>Double</td><td>Total cash.</td></tr><tr><td>totalRefund</td><td>Double</td><td>Total refund.</td></tr><tr><td>totalCount</td><td>Integer</td><td>Number of bills meeting the filtering conditions.</td></tr><tr><td>dataSet</td><td>Array of <a href="/pages/faGaDHzEBVopTOJSsemY#billingdetailinfo">BillingDetailInfo</a></td><td>Information on bills.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query information on bills.**

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

Request:
{
  "billMonthly": 202307,
  "pageSize": 2,
  "pageNum": 1,
  "resourceId":"945345672712820433"
}

Response:
{
    "requestId": "T2A96D54A-6A16-41B7-A991-A6691B4F32BA",
    "response": {
        "totalSpend": 16114.870000,
        "requestId": "T2A96D54A-6A16-41B7-A991-A6691B4F32BA",
        "totalVoucher": 306.320000,
        "totalRefund": 8215.730000,
        "totalCash": 24024.280000,
        "totalCount": 122,
        "dataSet": [
            {
                "resourceId": "938831989325181400",
                "product": "Compute",
                "amount": 83.260000,
                "billingMode": "Time pricing",
                "resourceGroupName": "Default Resource Group",
                "orderSn": "938832035772898264",
                "voucher": 40.410000,
                "deductionTime": "2023-07-21T02:00:00Z",
                "label": "M9Y-AMS-D-01",
                "billMonthly": 202307,
                "productSubitem": "Bare Metal Instance",
                "location": "AMS-D",
                "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
                "startTime": "2023-07-19T08:17:33Z",
                "endTime": "2023-07-21T02:30:16Z",
                "cash": 42.850000
            },
            {
                "resourceId": "938125503838038232",
                "product": "Compute",
                "amount": 6.240000,
                "billingMode": "Time pricing",
                "resourceGroupName": "Default Resource Group",
                "orderSn": "938125516571936216",
                "voucher": 1.820000,
                "deductionTime": "2023-07-31T23:00:00Z",
                "label": "98.96.193.64/29",
                "billMonthly": 202307,
                "productSubitem": "Public Virtual Interface",
                "location": "DFW2A",
                "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
                "startTime": "2023-07-18T09:00:00Z",
                "endTime": "2023-07-31T23:59:59Z",
                "cash": 4.420000
            },
            {
                "resourceId": "938100010245951960",
                "product": "Compute",
                "amount": 44.500000,
                "billingMode": "Time pricing",
                "resourceGroupName": "Default Resource Group",
                "orderSn": "938100046920946648",
                "voucher": 13.710000,
                "deductionTime": "2023-07-21T02:00:00Z",
                "label": "M9U-DFW-A-01",
                "billMonthly": 202307,
                "productSubitem": "Bare Metal Instance",
                "location": "DFW-A",
                "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
                "startTime": "2023-07-18T08:02:25Z",
                "endTime": "2023-07-21T02:27:52Z",
                "cash": 30.790000
            },
            {
                "resourceId": "938048288874041560",
                "product": "Compute",
                "amount": 0.080000,
                "billingMode": "Time pricing",
                "resourceGroupName": "Default Resource Group",
                "orderSn": "938048297967295192",
                "voucher": 0.000000,
                "deductionTime": "2023-07-18T06:14:33Z",
                "label": "98.96.193.64/26",
                "billMonthly": 202307,
                "productSubitem": "Public Virtual Interface",
                "location": "DFW2A",
                "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
                "startTime": "2023-07-18T06:14:33Z",
                "endTime": "2023-07-18T06:52:22Z",
                "cash": 0.080000
            },
            {
                "resourceId": "937380292249791960",
                "product": "Compute",
                "amount": -274.080000,
                "billingMode": "PRE_PAID",
                "resourceGroupName": "Default Resource Group",
                "orderSn": "937382571921115608",
                "voucher": 0.000000,
                "deductionTime": "2023-07-17T08:11:55Z",
                "label": "S8O-AMS-C-01",
                "billMonthly": 202307,
                "productSubitem": "Bare Metal Instance",
                "location": "AMS-C",
                "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
                "startTime": "2023-07-17T08:11:46Z",
                "endTime": "2023-07-17T08:11:46Z",
                "cash": -274.080000
            },
            {
                "resourceId": "937369698889106392",
                "product": "Compute",
                "amount": -284.050000,
                "billingMode": "PRE_PAID",
                "resourceGroupName": "Default Resource Group",
                "orderSn": "937382151005936600",
                "voucher": 0.000000,
                "deductionTime": "2023-07-17T08:11:05Z",
                "label": "S8O-AMS-C-01",
                "billMonthly": 202307,
                "productSubitem": "Bare Metal Instance",
                "location": "AMS-C",
                "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
                "startTime": "2023-07-17T08:10:11Z",
                "endTime": "2023-07-17T08:10:11Z",
                "cash": -284.050000
            },
            {
                "resourceId": "937380292249791960",
                "product": "Compute",
                "amount": 284.050000,
                "billingMode": "PRE_PAID",
                "resourceGroupName": "Default Resource Group",
                "orderSn": "937380322801093848",
                "voucher": 0.000000,
                "deductionTime": "2023-07-17T08:08:18Z",
                "label": "S8O-AMS-C-01",
                "billMonthly": 202307,
                "productSubitem": "Bare Metal Instance",
                "location": "AMS-C",
                "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
                "startTime": "2023-07-17T08:08:18Z",
                "endTime": "2023-08-16T08:08:18Z",
                "cash": 284.050000
            },
            {
                "resourceId": "937369698889106392",
                "product": "Compute",
                "amount": 284.050000,
                "billingMode": "PRE_PAID",
                "resourceGroupName": "Default Resource Group",
                "orderSn": "937369744607029976",
                "voucher": 0.000000,
                "deductionTime": "2023-07-17T07:47:56Z",
                "label": "S8O-AMS-C-01",
                "billMonthly": 202307,
                "productSubitem": "Bare Metal Instance",
                "location": "AMS-C",
                "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
                "startTime": "2023-07-17T07:47:56Z",
                "endTime": "2023-08-16T07:47:56Z",
                "cash": 284.050000
            },
            {
                "resourceId": "828613802374214104",
                "product": "Compute",
                "amount": 2.850000,
                "billingMode": "PRE_PAID",
                "resourceGroupName": "test-resourceGroup",
                "orderSn": "937333418209845720",
                "voucher": 0.000000,
                "deductionTime": "2023-07-17T06:34:15Z",
                "label": "23.90.160.82",
                "billMonthly": 202307,
                "productSubitem": "Common elastic IPv4",
                "location": "AMS-C",
                "resourceGroupId": "ea0fa204-1f54-4dc6-863c-f385739921d8",
                "startTime": "2023-07-17T06:34:16Z",
                "endTime": "2023-08-16T06:34:16Z",
                "cash": 2.850000
            },
            {
                "resourceId": "762684305204841432",
                "product": "Zen VM",
                "amount": 19.000000,
                "billingMode": "PRE_PAID",
                "resourceGroupName": "",
                "orderSn": "936634808610589912",
                "voucher": 0.000000,
                "deductionTime": "2023-07-16T07:26:15Z",
                "label": "default-POC-20GB-01",
                "billMonthly": 202307,
                "productSubitem": "Virtual Elastic Disk",
                "location": "POC",
                "resourceGroupId": "",
                "startTime": "2023-07-16T07:26:15Z",
                "endTime": "2023-08-15T07:26:15Z",
                "cash": 19.000000
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources <a href="#id-5.-kai-fa-zhe-gong-ju" id="id-5.-kai-fa-zhe-gong-ju"></a>

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

No error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).​​
