成本分摊
更新时间:2025-07-01
getShareBill 接口
接口描述
分页获取分摊账单。
企业组织财务管理中的主账户可以查询子账户的账单。
加入财务圈的子账户会屏蔽代金券之外的其他金额。子用户要发起该请求,需要具有多用户访问控制的管理员权限或者FCFullControlPolicy多用户访问控制策略管理权限。
默认接口请求频率限制:20次/秒。
权限说明
请求发起人需要具有合法的AccessKeyID和SecretAccessKey才能发起请求,请参考鉴权认证。 如果请求中没有用户验证信息(即匿名访问),返回403 Forbidden,错误信息:AccessDenied
请求结构与示例
Plain Text
1GET /v{version}/bill/share/bill?month={month}&productType={productType}&serviceType={serviceType}&queryAccountId={queryAccountId}&pageNo={pageNo}&pageSize={pageSize} HTTP/1.1
2Host: billing.baidu.bce.com
3ContentType: application/json
4Authorization: authorization string``
请求头域
除公共头域外,无其它特殊头域。
请求参数
response
名称 | 类型 | 描述 |
---|---|---|
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 |
预付费分摊账单详情列表 |
ShareBill
名称 | 类型 | 描述 |
---|---|---|
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 |
shortId | String | 资源短ID |
instanceName | String | 资源管理中的资源名称 |
configurationCH | String | 产品中文配置(后付费部分也有) |
chargeItem | String | 计费项英文名(仅后付费有,预付费没有) |
chargeItemDesc | String | 计费项中文名字(仅后付费有,预付费没有) |
tag | String | 资源tag信息 |
region | String | 区域 |
regionName | String | 区域中文名称 |
orderId | String | 订单ID |
orderType | String | 订单类型 |
orderTypeDesc | String | 订单类型中文名称 |
createTime | String | 订单创建时间,utc时间 |
serviceStartTime | String | 订单服务开始时间,utc时间 |
serviceEndTime | String | 订单服务结束时间,utc时间 |
serviceTimeSpan | String | 订单资源服务时长 |
capacity | String | 用量包总量 |
price | BigDecimal | 账单原始金额 |
financePrice | BigDecimal | 原始应付金额 |
catalogPrice | BigDecimal | 原始目录金额 |
couponPrice | BigDecimal | 代金券金额 |
discountCouponPrice | BigDecimal | 折扣券金额 |
cashEquivalentCouponPrice | BigDecimal | 现金券金额 |
discountPrice | BigDecimal | 折扣金额 |
sysGoldPrice | BigDecimal | 销账金额 |
sharePrice | BigDecimal | 本月(天)分摊价格 |
shareFinancePrice | BigDecimal | 本月(天)分摊应付价格 |
shareCatalogPrice | BigDecimal | 本月(天)分摊目录价格 |
shareCouponPrice | BigDecimal | 本月(天)分摊代金券 |
shareDiscountCouponPrice | BigDecimal | 本月(天)分摊折扣券 |
shareCashEquivalentCouponPrice | BigDecimal | 本月(天)分摊现金券 |
shareDiscountPrice | BigDecimal | 本月(天)分摊折扣金额 |
shareSysGoldPrice | BigDecimal | 本月(天)分摊销账金额 |
shareAmount | BigDecimal | 本月(天)分摊用量(包括量包和所有后付费计费项) |
deductPackageFinancePrice | BigDecimal | 本月(天)实例券抵扣金额 |
amountUnit | String | 用量单位 |
shareDays | Integer | 本月(天)分摊时长(天) (只用于CPT2、Project计费项) |
deductShareFinancePrice | BigDecimal | 本月(天)分摊特殊调减应付价格(注意:特殊调减金额为正数) |
deductShareCouponPrice | BigDecimal | 本月(天)分摊特殊调减代金券(注意:特殊调减金额为正数) |
deductShareDiscountCouponPrice | BigDecimal | 本月(天)分摊特殊调减折扣券(注意:特殊调减金额为正数) |
deductShareCashEquivalentCouponPrice | BigDecimal | 本月(天)分摊特殊调减现金券(注意:特殊调减金额为正数) |
deductShareDiscountPrice | BigDecimal | 本月(天)分摊特殊调减折扣金额(注意:特殊调减金额为正数) |
controversialItem | int | 账单争议标记(仅被标记为争议的账单才有此字段)。 0 表示正常的账单 1 表示被标记为争议状态的账单 2 表示被确认争议的账单,即被设置争议后,又被确认的账单 |
opTime | String | 操作时间(最后一次变更此账单的争议标记的时间,仅被标记为争议的账单才有此字段),例:2020-05-03T01:00:00Z |
confirmTime | String | 对争议账单进行确认的时间(仅被标记为争议账单被确认后,才会有此字段),例:2020-05-03T01:00:00Z |
skuId | String | 云商品编号 |
jsonFlavor | String | 英文配置,用户维度白名单开放,json格式,反序列化后为列表,每个原始有name,value,scale三个字段,例如: [{"name":"cacheInstanceNum","value":"2","scale":1},{"name":"clusterType","value":"cluster","scale":1}] |
productCategory | String | 资源类型,例如bcc_gpu/bcc_ebc,用户维度白名单开放,默认为serviceType字段。 |
注意: 关于特殊调减金额:特殊调减金额均以正数表现在账单中,需要与账单中对应的原始金额相加,才能得到原本账单中的金额。 例如,原本账单中金额是 3 元(以 shareFinancePrice 为例,假如特殊调减金额为 1 元),指定 showDeductPrice 为 true 后,表示需要将特殊调减金额独立进行拆分,最终返回的账单中分为两个字段展示:shareFinancePrice 此时为 2 元,deductShareFinancePrice 为 1 元。
响应示例
示例 1,常规查询的结果
Plain Text
1{
2 "billMonth": "2021-12",
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": "2020-05",
14 "productType": "postpay",
15 "productTypeName": "后付费",
16 "serviceType": "EIP",
17 "serviceTypeName": "弹性公网IP",
18 "instanceId": "instance-id",
19 "shortId": "/",
20 "instanceName": "/",
21 "configurationCH": "/",
22 "chargeItem": "/",
23 "chargeItemDesc": "/",
24 "tag": "标签1",
25 "region": "bj",
26 "regionName": "北京",
27 "orderId": "order-id",
28 "orderType": "NEW",
29 "orderTypeDesc": "新购",
30 "createTime": "/",
31 "serviceStartTime": "2020-05-01 13:00:00",
32 "serviceEndTime": "2020-05-31 23:59:59",
33 "serviceTimeSpan": "/",
34 "capacity": "1000分钟",
35 "price": 200.00,
36 "financePrice": 200.00,
37 "catalogPrice": 200.00,
38 "couponPrice": 0.00,
39 "discountCouponPrice": 0.00,
40 "cashEquivalentCouponPrice": 0.00,
41 "discountPrice": 0.00,
42 "sharePrice": 200.00,
43 "shareFinancePrice": 0.00,
44 "shareCatalogPrice": 0.00,
45 "shareCouponPrice": 0.00,
46 "shareDiscountCouponPrice": 0.00,
47 "shareCashEquivalentCouponPrice": 0.00,
48 "shareDiscountPrice": 0.00,
49 "deductPackageFinancePrice": 0.00,
50 "shareAmount": 1000
51 "amountUnit": "分钟",
52 "shareDays": 0,
53 "deductShareFinancePrice": 0.00,
54 "deductShareCouponPrice": 0.00,
55 "deductShareDiscountCouponPrice": 0.00,
56 "deductShareCashEquivalentCouponPrice": 0.00,
57 "deductShareDiscountPrice": 0.00,
58 "controversialItem": 2,
59 "opTime": "2020-03-18T10:14:18Z",
60 "confirmTime": "2020-03-18T10:14:18Z",
61 "skuId": "S0042000021EIP000948",
62 "jsonFlavor": "[{\"name\":\"bandwidth\",\"value\":\"1m\",\"scale\":1}]",
63 "productCategory": "EIP"
64 }
65 ]
66}
示例 2,带有特殊调减的查询的结果
Plain Text
1{
2 "billMonth": "2021-12",
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": "2020-05",
14 "productType": "postpay",
15 "productTypeName": "后付费",
16 "serviceType": "EIP",
17 "serviceTypeName": "弹性公网IP",
18 "instanceId": "instance-id",
19 "shortId": "/",
20 "instanceName": "/",
21 "configurationCH": "/",
22 "chargeItem": "/",
23 "chargeItemDesc": "/",
24 "tag": "标签1",
25 "region": "bj",
26 "regionName": "北京",
27 "orderId": "order-id",
28 "orderType": "NEW",
29 "orderTypeDesc": "新购",
30 "createTime": "/",
31 "serviceStartTime": "2020-05-01 13:00:00",
32 "serviceEndTime": "2020-05-31 23:59:59",
33 "serviceTimeSpan": "/",
34 "capacity": "1000分钟",
35 "price": 3.41,
36 "financePrice": 2.72,
37 "catalogPrice": 3.41,
38 "couponPrice": 0.00,
39 "discountCouponPrice": 0.00,
40 "cashEquivalentCouponPrice": 0.00,
41 "discountPrice": 0.69,
42 "sharePrice": 3.41,
43 "shareFinancePrice": 0.04,
44 "shareCatalogPrice": 3.41,
45 "shareCouponPrice": 0.00,
46 "shareDiscountCouponPrice": 0.00,
47 "shareCashEquivalentCouponPrice": 0.00,
48 "shareDiscountPrice": 0.69,
49 "deductPackageFinancePrice": 0.00,
50 "shareAmount": 1000
51 "amountUnit": "分钟",
52 "shareDays": 0,
53 "deductShareFinancePrice": 2.68,
54 "deductShareCouponPrice": 0.00,
55 "deductShareDiscountCouponPrice": 0.00,
56 "deductShareCashEquivalentCouponPrice": 0.00,
57 "deductShareDiscountPrice": 0.00,
58 "controversialItem": 2,
59 "opTime": "2020-03-18T10:14:18Z",
60 "confirmTime": "2020-03-18T10:14:18Z"
61 }
62 ]
63}