查询账单 - nxtele/http-api-document GitHub Wiki

查询账单

  • URL:https://api.nxcloud.com/v1/customer/queryBillingReport
  • Method:POST
  • Content-Type:application/json
  • 需要鉴权:
  • 频率限制:该接口有频率限制,3秒内只允许调用一次

鉴权机制

鉴权规则请参考地址:API接口调用约定


请求参数

header参数:

参数名 类型 必选 示例值 说明
accessKey String fme2na3kdi3ki 用户身份标识
ts String 1655710885431 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒
bizType String 3 业务类型,取固定值"3"
action String queryBillingReport 业务操作,取固定值"queryBillingReport"
sign String 6e9506557d1f289501d333ee2c365826 API入参参数签名,签名算法

body参数:

参数名 类型 必选 说明
startDate String 开始日期,格式:yyyy-MM-dd
endDate String 结束日期,格式:yyyy-MM-dd,日期范围不能超过一个月

请求示例

curl --location --request POST 'https://api.nxcloud.com/v1/customer/queryBillingReport' \
--header 'accessKey: fme2na3kdi3ki' \
--header 'bizType: 3' \
--header 'action: queryBillingReport' \
--header 'ts: 1655710885431' \
--header 'sign: 6e9506557d1f289501d333ee2c365826' \
--header 'Content-Type: application/json' \
--data-raw '{
    "startDate": "2026-01-01",
    "endDate": "2026-01-20"
}'

响应参数

参数名 类型 说明
code Integer 结果编码
message String 请求结果说明
data Array 账单报表列表
traceId String 请求追踪ID

data数组元素参数:

参数名 类型 说明
date String 日期,格式:yyyy-MM-dd
totalConsumptionAmount Number 单日总消费金额
currency String 币种,如:CNY(人民币)、USD(美元)
items Array 各业务费用明细列表

items数组元素参数:

参数名 类型 说明
product String 产品名称,如:SMS、DID、WEB_CALL、WHATSAPP、VIBER、NXLINK等
consumptionAmount Number 该产品的消费金额

响应示例

成功示例

{
    "code": 0,
    "message": "Success",
    "data": [
        {
            "date": "2026-01-01",
            "totalConsumptionAmount": 125.50,
            "currency": "CNY",
            "items": [
                {
                    "product": "SMS",
                    "consumptionAmount": 85.30
                },
                {
                    "product": "DID",
                    "consumptionAmount": 40.20
                }
            ]
        },
        {
            "date": "2026-01-02",
            "totalConsumptionAmount": 98.75,
            "currency": "CNY",
            "items": [
                {
                    "product": "SMS",
                    "consumptionAmount": 68.45
                },
                {
                    "product": "DID",
                    "consumptionAmount": 30.30
                }
            ]
        }
    ],
    "traceId": "43ee04abcea44d7eb1439665eb30d00c"
}

参数错误示例(请求参数不符合要求)

{
    "code": 9000,
    "message": "Request parameter error",
    "data": null,
    "traceId": "43ee04abcea44d7eb1439665eb30d00c"
}

日期范围错误示例(日期范围超过一个月)

{
    "code": 18001,
    "message": "Date range cannot exceed one month",
    "data": null,
    "traceId": "43ee04abcea44d7eb1439665eb30d00c"
}

响应码说明

code 说明
0 Success
-1 Failure
1000~10XX 详情参照API鉴权常见错误码
211 NUMBER_QUERY_RATE_LIMIT (频率限制:3秒内只允许调用一次)
9000 Request parameter error
18001 Date range cannot exceed one month
18002 Query billing report error

⚠️ **GitHub.com Fallback** ⚠️