获取账单明细

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

获取账单明细(DescribeBillDetail)

描述

查询用户实时账单明细信息。

注意 只支持查询相同月份的数据

返回API概览

请求参数

名称 类型 必须 长度限制(字符) 参数格式 描述
Action String 确定值 操作接口名,系统规定参数,取值:DescribeBills
Version String 确定值 API版本,固定为2019-07-19
BillStartTime String yyyy-MM-dd HH:mm:ss 必选参数,计费的开始时间,(查询结果包含该时间)
BillEndTime String yyyy-MM-dd HH:mm:ss 必选参数,计费的结束时间,(查询结果不包含该时间,必须和BillStartTime是同一个月)
ProductCode String 可选参数,产品线对应的Code。eg. KEC,不传获取所有产品类型的账单,取值可以参考产品线映射关系
SettleCycle Integer 结算周期:3:按小时,4:按天
Page Integer 页码,默认值为1
Size Integer 每页数量,默认值:20,最大值:1000

返回元素(调用成功)

名称 类型 描述
RequestId String 当前请求的RequestId
PageNum Integer 页码
PageSize Integer 每页数量
TotalCount Integer 总记录数
DetailSet BillDetail 数组 账单汇总数据

错误码(调用不成功)

错误代码(Code) 错误消息(Message) HTTP 状态码 中文描述(语义)
InvalidParameter There is one or more invalid parameter(%s). 400 参数%s错误,具体参数名在%s说明
MissingParameter A required parameter for the specified action is not supplied. 400 忘记必选参数%s,具体参数名在%s说明

示例(调用成功)

请求示例

http://krtpay.api.ksyun.com/?Action=DescribeBillDetail
&Version=2019-07-19
&BillStartTime=2019-07-12 20:00:00
&BillEndTime=2019-07-16 00:00:00
&ProductCode=VM_GROUP
&SettleCycle=3
&公共请求参数

返回示例

  • XML格式
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <DescribeBillDetailsResponse>
        <RequestId>83f25946-1d4e-4300-b37e-97d7906188eb</RequestId>
        <PageNum>1</PageNum>
        <PageSize>1</PageSize>
        <TotalCount>76</TotalCount>
        <DetailSet>
            <Item>
                <AccountPeriod>2019071523</AccountPeriod>
                <CustomerId>2000074760</CustomerId>
                <InstanceId>fe080d31-ffbd-41bd-8056-09373c5c4f40</InstanceId>
                <InstanceName>testTag</InstanceName>
                <Project>278</Project>
                <ProjectName>hanziguoproject</ProjectName>
                <RegionName>上海3区(VPC)</RegionName>
                <ZoneName>上海3区(VPC)可用区B</ZoneName>
                <ProductCode>VM_GROUP</ProductCode>
                <ProductGroupName>云主机</ProductGroupName>
                <ProductTypeName>计算优化型C1</ProductTypeName>
                <PayMode>87</PayMode>
                <PayModeName>按小时配置实时付费</PayModeName>
                <PackageCode>C1.2A</PackageCode>
                <Duration>3600</Duration>
                <DurationAccumulate>3600</DurationAccumulate>
                <TimeUnitName>秒</TimeUnitName>
                <Cost>0.45220</Cost>
                <RealCost>0.45220</RealCost>
                <Discount>1.0000</Discount>
                <DetailBillStartTime>2019-07-15 23:00:00</DetailBillStartTime>
                <DetailBillEndTime>2019-07-16 00:00:00</DetailBillEndTime>
                <ServiceBillStartTime>2019-07-08 11:19:29</ServiceBillStartTime>
                <ConfigSet>
                    <ConfigItem>
                        <Key>CPU(核)</Key>
                        <Code>cpu</Code>
                        <Value>2</Value>
                    </ConfigItem>
                    <ConfigItem>
                        <Key>内存(G)</Key>
                        <Code>mem</Code>
                        <Value>2</Value>
                    </ConfigItem>
                    <ConfigItem>
                        <Key>SSD(G)</Key>
                        <Code>ssd</Code>
                        <Value>0</Value>
                    </ConfigItem>
                </ConfigSet>
                <ProviderSet>
                    <ProviderItem>
                        <Key>操作系统</Key>
                        <Code>opstype</Code>
                        <Value>linux</Value>
                    </ProviderItem>
                </ProviderSet>
                <ConsumeResources/>
                <ExtraSet>
                    <ExtraItem>
                        <Key>内网IP</Key>
                        <Value>10.146.16.20</Value>
                    </ExtraItem>
                    <ExtraItem>
                        <Key>公网IP</Key>
                        <Value></Value>
                    </ExtraItem>
                </ExtraSet>
                <TagSet>
                    <TagItem>
                        <Key>ssss</Key>
                        <Value>sss</Value>
                    </TagItem>
                </TagSet>
                <DisplaySet>
                    <DisplayItem>
                    <Key>云服务器名称</Key>
                        <Value>testTag</Value>
                    </DisplayItem>
                </DisplaySet>
            </Item>
        </DetailSet>
    </DescribeBillDetailsResponse>
  • JSON格式
    {
        "RequestId": "fb4cf6b6-77a2-4e77-9f19-cffc7b860764",
        "PageNum": 1,
        "PageSize": 1,
        "TotalCount": 76,
        "DetailSet": [
            {
                "AccountPeriod": "2019071523",
                "CustomerId": 2000074760,
                "InstanceId": "fe080d31-ffbd-41bd-8056-09373c5c4f40",
                "InstanceName": "testTag",
                "Project": 278,
                "ProjectName": "hanziguoproject",
                "RegionName": "上海3区(VPC)",
                "ProductCode": "VM_GROUP",
                "ProductGroupName": "云主机",
                "ProductTypeName": "计算优化型C1",
                "PayModeName": "按小时配置实时付费",
                "PackageCode": "C1.2A",
                "Duration": 3600,
                "DurationAccumulate": 3600,
                "TimeUnitName": "秒",
                "Cost": "0.45220",
                "RealCost": "0.45220",
                "Discount": 1,
                "DetailBillStartTime": "2019-07-15 23:00:00",
                "DetailBillEndTime": "2019-07-16 00:00:00",
                "ServiceBillStartTime": "2019-07-08 11:19:29",
                "ZoneName": "上海3区(VPC)可用区B",
                "ConfigSet": [
                    {
                        "Key": "CPU(核)",
                    "Code": "cpu",
                        "Value": "2"
                    },
                    {
                        "Key": "内存(G)",
                        "Code": "mem",
                        "Value": "2"
                    },
                    {
                        "Key": "SSD(G)",
                        "Code": "ssd",
                        "Value": "0"
                    }
                ],
                "ConsumeResources": [],
                "ExtraSet": [
                    {
                        "Key": "内网IP",
                        "Value": "10.146.16.20"
                    },
                    {
                        "Key": "公网IP",
                        "Value": ""
                    }
                ],
                "ProviderSet": [
                    {
                        "Key": "操作系统",
                        "Code": "opstype",
                        "Value": "linux"
                    }
                ],
                "TagSet": [
                    {
                        "Key": "ssss",
                        "Value": "sss"
                    }
                ],
                "DisplaySet": [
                    {
                        "Key": "镜像",
                        "Value": "centos-7.5-20190509212611"
                    }
                ]
            }
        ]
    }

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

注册有礼