DescribeBillDetail

1. 接口描述

调用本接口用于获取月账单明细相关数据信息(包含月账单总费用等信息),支持按订单或资源ID筛选

2. 请求参数

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

参数名称必选类型描述

pageNum

Integer

页码,默认1

pageSize

Integer

每页大小,不能超过5000,超过5000返回5000条

billMonthly

Integer

账单月份,默认当前月。格式yyyyMM

orderSn

String

订单号

resourceId

String

资源ID(实例ID)

3. 响应结果

参数名称类型描述

requestId

String

唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 requestId。

totalSpend

Double

总支出

totalVoucher

Double

代金券总支付金额

totalCash

Double

现金总支付金额

totalRefund

Double

退款总金额

totalCount

Integer

符合条件的数据总数。

dataSet

结果集。

4. 代码示例

  1. 获取月账单明细相关数据信息

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
            }
        ]
    }
}

5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的开发工具集(SDK),未来会陆续支持更多开发语言,方便快速接入和使用Zenlayer的产品和服务。

6. 错误码

下面包含业务逻辑中遇到的错误码,其他错误码见公共错误码

最后更新于