成本拆分
更新时间:2025-07-01
queryCostSplitBill接口
接口描述
分页获取按天或按月聚合的成本拆分账单汇总。 企业组织财务管理中的主账户可以查询子账户的账单。 加入财务圈的子账户会屏蔽目录价之外的其他金额。子用户要发起该请求,需要具有多用户访问控制的管理员权限或者FCFullControlPolicy多用户访问控制策略管理权限。 默认接口请求频率限制:20次/秒。
权限说明
请求发起人需要具有合法的AccessKeyID和SecretAccessKey才能发起请求,请参考鉴权认证。
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 参数位置 | 描述 |
---|---|---|---|
month | String | Query参数 | 按月查询账单,格式yyyy-MM,例:2024-04注:(支持查询的最早时间为2024-04-01) |
startDay | String | Query参数 | 按天查询账单天粒度账单,格式yyyy-MM-dd,例:2024-04-01(上线支持查询的最早时间为2024-06-01) |
endDay | String | Query参数 | 按天查询账单天粒度账单,格式yyyy-MM-dd,例:2024-06-20(需要在startDay之后,不支持跨月查询) |
queryAccountId | String | Query参数 | 查询订单账户,若为空则表示当前登录账户。只有主账户可以代查其财务圈子账户的订单 |
productType | String | Query参数 | 查询资源的付费类型code;prepay:预付费,postpay:后付费。 |
serviceType | String | Query参数 | 产品名称code,例:BOS等。缺省时默认为所有产品。 |
instanceId | String | Query参数 | 实例长/短ID筛选。 |
pageNo | Integer | Query参数 | 分页查询的页数,从1开始计数 |
pageSize | Integer | Query参数 | 每页包含的最大数量,最大数量通常不超过1000 |
1、month 和 startDay&endDay 时间查询维度必须填一项(月粒度与天粒度),都存在时取month。
2、一次请求最多返回1000个账单的信息。
请求结构与示例
Plain Text
1GET /v{version}/bill/cost/split/bill/list?month={month}&serviceType={serviceType}&queryAccountId={queryAccountId}&pageNo={pageNo}&pageSize={pageSize} HTTP/1.1
2Host: billing.baidubce.com
3ContentType: application/json
4Authorization: authorization string
响应参数
名称 | 类型 | 描述 |
---|---|---|
billMonth | String | 按月查询成本拆分账单所属月份,格式yyyy-MM,例:2020-05 |
accountId | String | 当前账户不是财务圈子账户时,返回当前账户accountId;是财务圈子账户时,返回当前账户主账户的accountId |
loginName | String | 当前账户不是财务圈子账户时,返回当前账户的登录名;是财务圈子账户时,返回当前账户主账户的登录名 |
subAccountId | String | 当前账户不是财务圈子账户时,返回”/”;是财务圈子账户时,返回当前账户的accountId |
subLoginName | String | 当前账户不是财务圈子账户时,返回”/”;是财务圈子账户时,返回当前账户的登录名 |
ouName | String | 当前账户不是财务圈子账户时,返回”/”;是财务圈子账户时,返回当前账户所在组织单元的单元名 |
pageNo | Integer | 分页查询编号 |
pageSize | Integer | 分页查询的分页大小 |
totalCount | Integer | 当前查询条件总条目 |
bills | List |
成本拆分详情列表 |
SplitBill
名称 | 类型 | 描述 |
---|---|---|
billMonth | String | 按月查询时所属月份,格式yyyy-MM,例:2020-05 |
billDay | String | 按天查询时所属天,按月查询时此项无,例:2020-05-03 |
productType | String | 计费类型:prepay/postpay,分别预付费/后付费。 |
productTypeName | String | 预付费/后付费 |
serviceType | String | 产品英文名称,例:BCC,BOS等 |
serviceTypeName | String | 产品中文名 |
instanceId | String | 拆分后实例id(如BOS bucket、实例券对应的抵扣实例),部分场景下,如实例券、节省计划的浪费,对应的行的拆分项id为- 如果不涉及拆分的产品,instansId就是之前的资源id |
shortId | String | 资源的短ID。 |
sourceServiceType | String | 源产品英文名称,例:BCC,BOS等 |
sourceServiceTypeName | String | 源产品中文名 |
sourceInstanceId | String | 原始资源id,如果是实例券分摊,即为实例券的id,如果是节省计划分摊,即为节省计划id,以及BOS的bucket对应的源实例id。 |
sourceShortId | String | 源实例短ID。 |
instanceName | String | 对应instanceId在资源管理中的资源名称。 |
configurationCH | String | 对应instanceId实例产品中文配置(后付费实例为在账单时间内最新的中文配置) |
sourceConfigurationCH | String | 对应sourceInstanceId实例产品中文配置(后付费实例为在账单时间内最新的中文配置) |
chargeItem | String | 计费项英文名(仅后付费有,预付费没有) |
chargeItemDesc | String | 计费项中文名字(仅后付费有,预付费没有) |
tag | String | 资源tag信息 |
region | String | 区域 |
regionName | String | 区域中文名称 |
shareCatalogPrice | BigDecimal | 本月(天)分摊目录价格 |
sharePrice | BigDecimal | 本月(天)分摊价格 |
shareFinancePrice | BigDecimal | 本月(天)分摊应付价格 |
shareCouponPrice | BigDecimal | 本月(天)分摊代金券 |
shareDiscountCouponPrice | BigDecimal | 本月(天)分摊折扣券 |
shareCashEquivalentCouponPrice | BigDecimal | 本月(天)分摊现金券 |
shareDiscountPrice | BigDecimal | 本月(天)分摊折扣金额 |
shareSysGoldPrice | BigDecimal | 本月(天)分摊销账金额 |
shareAmount | BigDecimal | 本月(天)分摊用量(包括量包和所有后付费计费项) |
amountUnit | String | 用量单位 |
shareDays | Integer | 本月(天)分摊时长(天) (只用于未拆分账单的CPT2、Project计费项) |
productCategory | String | 资源类型,例如bcc_gpu/bcc_ebc,用户维度白名单开放,默认为serviceType字段。 |
响应示例
Plain Text
1{
2 "billMonth": "2024-04",
3 "pageNo": 1,
4 "pageSize": 100,
5 "totalCount": 600,
6 "accountId": "account-id",
7 "loginName": "name",
8 "subAccountId": "/",
9 "subLoginName": "/",
10 "ouName": "/",
11 "bills": [
12 {
13 "billMonth": "2024-05",
14 "productType": "postpay",
15 "productTypeName": "后付费",
16 "serviceType": "BOS",
17 "serviceTypeName": "对象存储BOS",
18 "instanceId": "bucket-id",
19 "chargeItem": "UseSpaceBytes",
20 "chargeItemDesc": "存储空间",
21 "tag": "标签1",
22 "region": "bj",
23 "regionName": "北京",
24 "sharePrice": 200.00,
25 "shareCatalogPrice": 200.00,
26 "shareFinancePrice": 0.00,
27 "shareCouponPrice": 0.00,
28 "shareDiscountCouponPrice": 0.00,
29 "shareCashEquivalentCouponPrice": 0.00,
30 "shareDiscountPrice": 0.00,
31 "shareAmount": 1000
32 "amountUnit": "B",
33 "productCategory": "BOS"
34 }
35 ]
36}
Plain Text
1{
2 "accountId": "031a99f936dc451cb60423cf4b0053dd",
3 "loginName": "jjc010",
4 "subAccountId": "/",
5 "subLoginName": "/",
6 "ouName": "/",
7 "billMonth": "2024-05",
8 "pageNo": 1,
9 "pageSize": 2,
10 "totalCount": 476,
11 "bills": [{
12 "billMonth": "2024-05",
13 "productType": "prepay",
14 "productTypeName": "预付费",
15 "serviceType": "BCC",
16 "serviceTypeName": "云服务器 BCC",
17 "sourceServiceType": "BCC",
18 "sourceServiceTypeName": "云服务器 BCC",
19 "sourceInstanceId": "1ded7ccef8d844f9af39e0438953575f",
20 "sourceShortId": "bcc-nZB7dKe9tL",
21 "instanceId": "-",
22 "shortId": "-",
23 "instanceName": "/",
24 "configurationCH": "/",
25 "sourceConfigurationCH": "类型:defaultBcc3\n付费方式:FullyPrepay\n可用区:zoneA\n操作系统:all\n是否严格匹配规格:1\n是否资源预留:1\ncpu:1\n内存:1G\n时间属性:P1M\n实例数量:1台\n实例规格:bcc.g3.c1m1",
26 "chargeItem": "ReservedPackage",
27 "chargeItemDesc": "预留实例券-运行时长",
28 "tag": "/",
29 "region": "bj",
30 "regionName": "华北-北京",
31 "orderId": "/",
32 "orderType": "/",
33 "orderTypeDesc": "/",
34 "serviceStartTime": "2024-04-30T04:05:25Z",
35 "serviceEndTime": "2024-05-01T04:05:25Z",
36 "serviceTimeSpan": "/",
37 "capacity": "/",
38 "cashEquivalentCouponPrice": 0.00,
39 "sharePrice": 1.94,
40 "shareFinancePrice": 0.97,
41 "shareCatalogPrice": 1.94,
42 "shareCouponPrice": 0.00,
43 "shareDiscountCouponPrice": 0.00,
44 "shareDiscountPrice": 0.97,
45 "shareSysGoldPrice": 0.00,
46 "deductPackageFinancePrice": 0,
47 "shareAmount": 1440,
48 "amountUnit": "分钟",
49 "productCategory": "BCC"
50 }, {
51 "billMonth": "2024-05",
52 "productType": "prepay",
53 "productTypeName": "预付费",
54 "serviceType": "BCC",
55 "serviceTypeName": "云服务器 BCC",
56 "sourceServiceType": "BCC",
57 "sourceServiceTypeName": "云服务器 BCC",
58 "sourceInstanceId": "68b2b32d6387440c9d6be58fc5e7020a",
59 "sourceShortId": "r-hrkp0Rwy",
60 "instanceId": "-",
61 "shortId": "-",
62 "instanceName": "/",
63 "configurationCH": "/",
64 "sourceConfigurationCH": "类型:defaultBcc3\n付费方式:FullyPrepay\n可用区:zoneA\n操作系统:all\n是否严格匹配规格:1\n是否资源预留:1\ncpu:1\n内存:1G\n时间属性:P1M\n实例数量:1台\n实例规格:bcc.g3.c1m1",
65 "chargeItem": "ReservedPackage",
66 "chargeItemDesc": "预留实例券-运行时长",
67 "tag": "/",
68 "region": "bj",
69 "regionName": "华北-北京",
70 "orderId": "/",
71 "orderType": "/",
72 "orderTypeDesc": "/",
73 "serviceStartTime": "2024-05-08T02:54:09Z",
74 "serviceEndTime": "2024-05-23T02:54:09Z",
75 "serviceTimeSpan": "/",
76 "capacity": "/",
77 "cashEquivalentCouponPrice": 0.00,
78 "sharePrice": 3.96,
79 "shareFinancePrice": 1.98,
80 "shareCatalogPrice": 3.96,
81 "shareCouponPrice": 0.00,
82 "shareDiscountCouponPrice": 0.00,
83 "shareDiscountPrice": 1.98,
84 "shareSysGoldPrice": 0.00,
85 "deductPackageFinancePrice": 0,
86 "shareAmount": 3051,
87 "amountUnit": "分钟",
88 "productCategory": "BCC"
89 }]
90}