利润报表 - 列表配置查询
POST
/basicOpen/finance/profitReport/config接口信息
| API Path | 请求协议 | 请求方式 | 令牌桶容量 |
|---|---|---|---|
/basicOpen/finance/profitReport/config | HTTPS | POST | 1 |
请求参数
无需传入请求参数
请求cURL示例
curl --location 'https://openapi.lingxing.com/basicOpen/finance/profitReport/config?access_token=value×tamp=value&sign=value&app_key=value' \
--header 'Content-Type: application/json' \
--data '{
}'
返回结果
Json Object
codeinteger必填messagestring必填error_detailsarray<any>必填request_idstring必填response_timestring必填dataobject必填隐藏子属性
profitGrouparray<object>必填隐藏子属性
itemTypeinteger必填itemTypeNamestring必填namestring必填itemsarray<object>必填隐藏子属性
itemTypeinteger必填itemTypeNamestring必填itemFieldstring必填itemNamestring必填parentItemNamestring必填displayFormatinteger必填displayFormatNamestring必填sortOrderinteger必填tooltipstring必填fieldsarray<object>必填隐藏子属性
fieldNamestring必填displayNamestring必填platformCodesarray<any>必填totalinteger必填返回成功示例
{
"code": 0,
"message": "success",
"error_details": [],
"request_id": "b2ba3388cbee49a7bb4c7add1f1948fa",
"response_time": "2026-04-09 17:06:17",
"data": {
"profitGroup": [
{
"itemType": 1,
"itemTypeName": "收入",
"name": "平台收入",
"items": [
{
"displayFormat": 2,
"displayFormatName": "金额",
"fields": null,
"itemField": "salesAmount",
"itemName": "销售额",
"itemType": 1,
"itemTypeName": "收入",
"parentItemName": "平台收入",
"sortOrder": 1,
"tooltip": ""
},
{
"displayFormat": 2,
"displayFormatName": "金额",
"fields": null,
"itemField": "promotionDiscount",
"itemName": "促销折扣",
"itemType": 1,
"itemTypeName": "收入",
"parentItemName": "平台收入",
"sortOrder": 99,
"tooltip": ""
}
]
},
{
"itemType": 5,
"itemTypeName": "利润",
"name": "利润",
"items": [
{
"displayFormat": 2,
"displayFormatName": "金额",
"fields": null,
"itemField": "profit",
"itemName": "利润",
"itemType": 5,
"itemTypeName": "利润",
"parentItemName": "利润",
"sortOrder": 2,
"tooltip": "=销售收益+收入退款+..."
}
]
}
]
},
"total": 0
}
附加说明
1. 部分二级利润项目无明细字段列表(fields 为 null)
部分二级利润项目(如成本类型、利润类型字段)没有关联的明细字段列表,返回的 fields 为 null。
对于这类项目,应直接使用其 itemField 值去匹配利润报表-明细列表查询接口返回的 profitItems 中的字段名。
涉及的典型字段举例:
| itemField | itemName | 所属一级项目 |
|---|---|---|
| productCost | 采购成本 | 成本 |
| firstLegCost | 头程费用 | 成本 |
| otherCost | 其他成本 | 成本 |
| costSubtotal | 成本小计 | 成本 |
| thirdPartyDeliveryFee | 三方配送费 | 仓储物流费 |
| profit | 利润 | 利润 |
2. 自定义费用字段的前缀匹配规则
自定义费用会受到费用管理模块以及列表筛选范围的影响而动态变化。本配置接口仅返回一个统一的占位项 customFee,而在利润报表-明细列表查询接口的 configList 中,会返回实际展开后的自定义费用字段。
匹配规则: 自定义费用的 itemField 格式统一为 customFee + 费用ID,需要使用 customFee 作为前缀进行匹配。
示例:
配置接口返回(本接口):
{
"itemField": "customFee",
"itemName": "自定义费用",
"fields": null
}
明细列表接口 configList 实际返回:
[
{ "itemField": "customFee101", "itemName": "包装费" },
{ "itemField": "customFee102", "itemName": "质检费" },
{ "itemField": "customFee205", "itemName": "贴标费" }
]
因此,在做字段映射时,应对 itemField 以 customFee 为前缀进行匹配,将所有 customFee* 字段归类到自定义费用项下。