获取账单明细

最近更新时间:2019-04-25 11:58:10

获取账单明细(GetPostpayDetailBill)

描述

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

注意 只支持查询2018-06以后的数据

返回API概览

请求参数

名称 类型 必须 长度限制(字符) 参数格式 描述
Action String 确定值 [a-zA-Z]+ 操作接口名,系统规定参数,取值:GetPostpayDetailBill
Version String 确定值 API版本,固定为2018-06-01
BillStartMonth String YYYY-MM 必选参数,账单开始月份,eg. 2018-06
BillEndMonth String YYYY-MM 必选参数,账单结束月份
ProductCode String 可选参数,产品类型对应的Code。eg. KEC,不传获取所有产品类型的账单,取值可以参考产品线映射关系
ProjectId String 可选参数,项目组Id,不传获取所有项目Id

返回元素(调用成功)

名称 类型 描述
RequestId String 当前请求的RequestId
PostpayDetailBillSet PostpayDetailBill数组 账单明细数据

错误码(调用不成功)

错误代码(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 后端服务异常

示例(调用成功)

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

请求示例

https://bill.api.ksyun.com/?Action=GetPostpayDetailBill
&Version=2018-06-01
&BillStartMonth=2018-06
&BillEndMonth=2018-06
&ProductCode=KEC
&ProjectId=0
&公共请求参数

返回示例

  • XML格式
<GetPostpayDetailBillResponse>
    <RequestId>ht-test</RequestId>
    <PostpayDetailBillSet>
        <Item>
            <DetailBillNo>000000017299675</DetailBillNo>
            <BillMonth>2018-06</BillMonth>
            <CustomerId>73400575</CustomerId>
            <DetailBillStartTime>2018-06-01 00:00:00</DetailBillStartTime>
            <DetailBillEndTime>2018-06-25 23:59:59</DetailBillEndTime>
            <ProductCode>KEC</ProductCode>
            <ProductName>云服务器(KEC)</ProductName>
            <ProductSubTypeName>本地高性能云主机</ProductSubTypeName>
            <InstanceId>c35d5c4a-06e6-446c-811f-db5380e8627c</InstanceId>
            <InstanceName>KSC180308172229_1</InstanceName>
            <Cost>55.00</Cost>
            <ServiceStartTime>2018-03-08 17:22:54</ServiceStartTime>
            <BillType>按日月结</BillType>
            <BillDays>25</BillDays>
            <BillHours>0</BillHours>
            <RegionName>亦庄VPC</RegionName>
            <ZoneName>北京1区(VPC)可用区A</ZoneName>
            <RuleRemark></RuleRemark>
            <MeasureAmount>73.33</MeasureAmount>
            <Discount>0.75</Discount>
            <ProjectId>0</ProjectId>
            <ProjectName>默认项目</ProjectName>
            <ProviderSet>
                <ProviderItem>
                    <Key>操作系统类型</Key>
                    <Value>linux</Value>
                </ProviderItem>
            </ProviderSet>
            <ConfigSet>
                <ConfigItem>
                    <Key>SSD磁盘(GB)</Key>
                    <Value>50.0000</Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>CPU(核个数)</Key>
                    <Value>1.0000</Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>SATA磁盘(GB)</Key>
                    <Value></Value>
                </ConfigItem>
                <ConfigItem>
                    <Key>内存(GB)</Key>
                    <Value>1.0000</Value>
                </ConfigItem>
            </ConfigSet>
            <ExtraSet>
                <ExtraItem>
                    <Key>内网IP</Key>
                    <Value>10.136.26.121</Value>
                </ExtraItem>
                <ExtraItem>
                    <Key>公网IP</Key>
                    <Value></Value>
                </ExtraItem>
            </ExtraSet>
            <TagSet/>
        </Item>
    </PostpayDetailBillSet>
</GetPostpayDetailBillResponse>
  • JSON示例
{
    "RequestId": "ht-test",
    "PostpayDetailBillSet": [
        {
            "DetailBillNo": "000000017299675",
            "BillMonth": "2018-06",
            "CustomerId": "73400575",
            "DetailBillStartTime": "2018-06-01 00:00:00",
            "DetailBillEndTime": "2018-06-25 23:59:59",
            "ProductCode": "KEC",
            "ProductName": "云服务器(KEC)",
            "ProductSubTypeName": "本地高性能云主机",
            "InstanceId": "c35d5c4a-06e6-446c-811f-db5380e8627c",
            "InstanceName": "KSC180308172229_1",
            "Cost": "55.00",
            "ServiceStartTime": "2018-03-08 17:22:54",
            "BillType": "按日月结",
            "BillDays": "25",
            "BillHours": "0",
            "RegionName": "亦庄VPC",
            "ZoneName": "北京1区(VPC)可用区A",
            "RuleRemark": "",
            "MeasureAmount": "73.33",
            "Discount": "0.75",
            "ProjectId": "0",
            "ProjectName": "默认项目",
            "ProviderSet": [
                {
                    "Key": "操作系统类型",
                    "Value": "linux"
                }
            ],
            "ConfigSet": [
                {
                    "Key": "SSD磁盘(GB)",
                    "Value": "50.0000"
                },
                {
                    "Key": "CPU(核个数)",
                    "Value": "1.0000"
                },
                {
                    "Key": "SATA磁盘(GB)",
                    "Value": ""
                },
                {
                    "Key": "内存(GB)",
                    "Value": "1.0000"
                }
            ],
            "ExtraSet": [
                {
                    "Key": "内网IP",
                    "Value": "10.136.26.121"
                },
                {
                    "Key": "公网IP",
                    "Value": ""
                }
            ],
            "TagSet": []
        }
    ]
}

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

立即注册