获取月账单

最近更新时间:2021-03-15 20:52:46

查看PDF

GetMonthBill(获取月账单)

本文档介绍如何查询用户月账单汇总信息,支持分产品类型、项目汇总。
注意:只支持查询2018-06以后的数据。

请求参数

名称 类型 必须 长度限制(字符) 参数格式 描述
Action String 确定值 操作接口名,系统规定参数,取值:GetMonthBill
Version String 确定值 API版本,固定为2018-06-01
BillStartMonth String YYYY-MM 必选参数,账单开始月份
BillEndMonth String 必选参数,账单结束月份

返回数据(调用成功)

名称 类型 描述
RequestId String 当前请求的RequestId
MonthBillSet MonthBill 数组 月账单汇总数据

错误码(调用不成功)

错误代码(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的账单汇总数据为示例。

请求示例

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

返回示例

  • XML格式
<GetMonthBillResponse>
    <RequestId>ca3f8cae-1282-4a48-81ae-3e19b00e3c3a</RequestId>
    <MonthBillSet>
        <Item>
            <BillProductSet>
                <Item>
                    <Code>KEC</Code>
                    <Cost>66.0</Cost>
                    <Name>云主机</Name>
                </Item>
                <Item>
                    <Code>KRDS</Code>
                    <Cost>174.0</Cost>
                    <Name>关系型数据库</Name>
                </Item>
                <Item>
                    <Code>Redis</Code>
                    <Cost>101.25</Cost>
                    <Name>云数据库Redis</Name>
                </Item>
                <Item>
                    <Code>KS3</Code>
                    <Cost>0.0</Cost>
                    <Name>对象存储</Name>
                </Item>
            </BillProductSet>
            <BillProjectSet>
                <ProjectItem>
                    <Id>0</Id>
                    <Cost>341.25</Cost>
                    <Details>
                        <Details>
                            <Code>KEC</Code>
                            <Cost>66.0</Cost>
                            <Name>云主机</Name>
                        </Details>
                        <Details>
                            <Code>KRDS</Code>
                            <Cost>174.0</Cost>
                            <Name>关系型数据库</Name>
                        </Details>
                        <Details>
                            <Code>Redis</Code>
                            <Cost>101.25</Cost>
                            <Name>云数据库Redis</Name>
                        </Details>
                        <Details>
                            <Code>KS3</Code>
                            <Cost>0.0</Cost>
                            <Name>对象存储</Name>
                        </Details>
                    </Details>
                    <Name>默认项目</Name>
                </ProjectItem>
            </BillProjectSet>
            <BillMonth>2018-06</BillMonth>
            <Sum>341.25</Sum>
            <BillId>KSYZD0073400575201806</BillId>
            <BillType>postpay</BillType>
        </Item>
    </MonthBillSet>
</GetMonthBillResponse>
  • JSON示例
{
    "RequestId": "9a12cb1f-85bc-4a69-a4f5-5f669f22d8eb",
    "MonthBillSet": [
        {
            "BillProductSet": [
                {
                    "Code": "KEC",
                    "Cost": 66,
                    "Name": "云主机"
                },
                {
                    "Code": "KRDS",
                    "Cost": 174,
                    "Name": "关系型数据库"
                },
                {
                    "Code": "Redis",
                    "Cost": 101.25,
                    "Name": "云数据库Redis"
                },
                {
                    "Code": "KS3",
                    "Cost": 0,
                    "Name": "对象存储"
                }
            ],
            "BillProjectSet": [
                {
                    "Id": 0,
                    "Cost": 341.25,
                    "Details": [
                        {
                            "Code": "KEC",
                            "Cost": 66,
                            "Name": "云主机"
                        },
                        {
                            "Code": "KRDS",
                            "Cost": 174,
                            "Name": "关系型数据库"
                        },
                        {
                            "Code": "Redis",
                            "Cost": 101.25,
                            "Name": "云数据库Redis"
                        },
                        {
                            "Code": "KS3",
                            "Cost": 0,
                            "Name": "对象存储"
                        }
                    ],
                    "Name": "默认项目"
                }
            ],
            "BillMonth": "2018-06",
            "Sum": 341.25,
            "BillId": "KSYZD0073400575201806",
            "BillType": "postpay"
        }
    ]
}

文档内容是否对您有帮助?

根本没帮助
文档较差
文档一般
文档不错
文档很好

在文档使用中是否遇到以下问题

内容不全,不深入
内容更新不及时
描述不清晰,比较混乱
系统或功能太复杂,缺乏足够的引导
内容冗长

更多建议

0/200

评价建议不能为空

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

问题反馈