最近更新时间:2024-02-26 15:54:09
本文档介绍如何查询用户账单明细数据,支持按产品类型Code、项目Id筛选。
注意:只支持查询2018-06以后的数据。
名称 | 类型 | 必须 | 长度限制(字符) | 参数格式 | 描述 |
---|---|---|---|---|---|
Action | String | 是 | 确定值 |
| 操作接口名,系统规定参数,取值: |
Version | String | 是 | 确定值 | API版本,固定为 | |
BillStartMonth | String | 是 |
| 必选参数,账单开始月份,eg. | |
BillEndMonth | String | 是 |
| 必选参数,账单结束月份 | |
ProductCode | String | 否 | 可选参数,产品类型对应的Code。eg. | ||
ProjectId | String | 否 | 可选参数,项目组Id,不传获取所有项目Id |
名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 当前请求的RequestId |
PostpayDetailBillSet | 账单明细数据 |
错误代码(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(北京)可用区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(北京)可用区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": []
}
]
}
纯净模式