获取消耗账单明细

最近更新时间:2019-11-11 20:12:50

获取消耗账单明细(getPostpayDetailConsume)

描述

查询用户日耗账单明细数据,支持按产品类型Code、项目Id筛选。

注意 只支持查询最近两个月的数据

返回API概览

请求参数

名称 类型 必须 长度限制(字符) 参数格式 描述
Action String 确定值 [a-zA-Z]+ 操作接口名,系统规定参数,取值:getPostpayDetailConsume
Version String 确定值 API版本,固定为2018-06-01
BillMonth String YYYY-MM 必选参数,账单月份,eg. 2018-06
ProductCode String 可选参数,产品类型对应的Code。eg. KEC,不传获取所有产品类型的账单,取值可以参考产品线映射关系
ProjectId String 可选参数,项目组Id,不传获取所有项目Id
PageNo Integer 可选参数,项目组Id,不传默认为0
PageSize Integer 可选参数,项目组Id,不传默认为1,最大只允许传5000

返回元素(调用成功)

名称 类型 描述
RequestId String 当前请求的RequestId
PageNo Integer 当前页号
PageSize Integer 当前页大小
Total Integer 当前请求的总条数
PostpayDetailBillSet PostpayDetailConsume数组 账单明细数据

错误码(调用不成功)

错误代码(Code) 错误消息(Message) HTTP 状态码 中文描述(语义)
InvalidParameter There is one or more invalid parameter(%s)." 400 参数%s错误,具体参数名在%s说明
Forbidden Request user %s forbidden request this api" 400 用户禁止请求API,用户uid在%s指名
Server unavailable Server error 500 后端服务异常

示例(调用成功)

获取2019-08的云主机类型(ProductCode=KEC),默认项目(ProjectId=0)的账单明细数据

请求示例

https://bill.api.ksyun.com/?Action=getPostpayDetailConsume
&Version=2018-06-01
&BillMonth=2019-08
&ProductCode=KEC
&ProjectId=0
&PageNo=0
&PageSize=1
&公共请求参数

返回示例

  • XML格式
<GetPostpayDetailConsumeResponse>
    <Total>63</Total>
    <Error/>
    <RequestId>123</RequestId>
    <PageSize>1</PageSize>
    <PostpayDetailBillSet>
        <Item>
            <DetailBillNo>000000000304994</DetailBillNo>
            <BillMonth>2019-08</BillMonth>
            <CustomerId>123</CustomerId>
            <DetailBillStatDate>2019-08-01</DetailBillStatDate>
            <DetailBillStartTime>2019-08-01 00:00:00</DetailBillStartTime>
            <DetailBillEndTime>2019-08-01 23:59:59</DetailBillEndTime>
            <ProductCode>KEC</ProductCode>
            <ProductName>云主机</ProductName>
            <ProductSubTypeName>本地高性能云主机</ProductSubTypeName>
            <InstanceId>cb48-af94-2b0746ff2431</InstanceId>
            <InstanceName>测试</InstanceName>
            <Cost>10.3645</Cost>
            <ServiceStartTime>2015-09-21 23:14:32</ServiceStartTime>
            <BillType>按日配置付费(月结)</BillType>
            <BillDays>1</BillDays>
            <BillHours></BillHours>
            <RegionName>亦庄VPC</RegionName>
            <ZoneName>北京1区可用区-NEWA</ZoneName>
            <MeasureAmount>14.8100</MeasureAmount>
            <Discount>0.7</Discount>
            <ProjectId>0</ProjectId>
            <ProjectName></ProjectName>
            <ProviderSet>
                <ProviderItem>
                    <Key>操作系统类型</Key>
                    <Value>linux</Value>
                </ProviderItem>
            </ProviderSet>
            <ConfigSet>
                <ConfigItem>
                    <Key>联网增强</Key>
                    <Value></Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>ebs_ssd3.0系统盘(GB)</Key>
                    <Value></Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>SATA磁盘(GB)</Key>
                    <Value></Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>内存(GB)</Key>
                    <Value>8.0000</Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>套餐code</Key>
                    <Value>I0.None</Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>CPU(核个数)</Key>
                    <Value>4.0000</Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>SSD磁盘(GB)</Key>
                    <Value>50.0000</Value>
                </ConfigItem>
            </ConfigSet>
            <ExtraSet>
                <ExtraItem>
                    <Key>公网IP</Key>
                    <Value></Value>
                </ExtraItem>
                <ExtraItem>
                    <Key>内网IP</Key>
                    <Value>10.253.10.154</Value>
                </ExtraItem>
            </ExtraSet>
            <TagSet/>
        </Item>
    </PostpayDetailBillSet>
    <PageNo>1</PageNo>
</GetPostpayDetailConsumeResponse>
  • JSON示例
{
    "Total": 63,
    "Error": null,
    "RequestId": "123",
    "PageSize": 1,
    "PostpayDetailBillSet": [
        {
            "DetailBillNo": "000000000304994",
            "BillMonth": "2019-08",
            "CustomerId": "123456",
            "DetailBillStatDate": "2019-08-01",
            "DetailBillStartTime": "2019-08-01 00:00:00",
            "DetailBillEndTime": "2019-08-01 23:59:59",
            "ProductCode": "KEC",
            "ProductName": "云主机",
            "ProductSubTypeName": "本地高性能云主机",
            "InstanceId": "cb48-af94-2b0746ff2431",
            "InstanceName": "测试",
            "Cost": "10.3645",
            "ServiceStartTime": "2018-09-21 23:14:32",
            "BillType": "按日配置付费(月结)",
            "BillDays": "1",
            "BillHours": "",
            "RegionName": "亦庄VPC",
            "ZoneName": "北京1区可用区A",
            "MeasureAmount": "14.8100",
            "Discount": "0.7",
            "ProjectId": "0",
            "ProjectName": "",
            "ProviderSet": [
                {
                    "Key": "操作系统类型",
                    "Value": "linux"
                }
            ],
            "ConfigSet": [
                {
                    "Key": "联网增强",
                    "Value": ""
                },
                {
                    "Key": "ebs_ssd3.0系统盘(GB)",
                    "Value": ""
                },
                {
                    "Key": "SATA磁盘(GB)",
                    "Value": ""
                },
                {
                    "Key": "内存(GB)",
                    "Value": "8.0000"
                },
                {
                    "Key": "套餐code",
                    "Value": "I0.None"
                },
                {
                    "Key": "CPU(核个数)",
                    "Value": "4.0000"
                },
                {
                    "Key": "SSD磁盘(GB)",
                    "Value": "50.0000"
                }
            ],
            "ExtraSet": [
                {
                    "Key": "公网IP",
                    "Value": ""
                },
                {
                    "Key": "内网IP",
                    "Value": "10.253.10.154"
                }
            ],
            "TagSet": []
        }
    ],
    "PageNo": 1
}

金山云,开启您的云计算之旅

注册有礼