发票云(智能特性)
旗舰版标准版智能特性
旗舰版标准版智能特性
🤖 AI Support​​
  1. 三单匹配
  • 整体介绍
  • 开发指南
  • 授权
    • token获取
      POST
  • 智能特性
    • 文档信息识别
      • 国际发票识别
      • 国际发票识别(明细)
      • 文档信息识别(反馈)
      • 银行回单识别
    • 三单匹配
      • 三单匹配-同步接口
        POST
      • 三单匹配-异步匹配任务提交
        POST
      • 三单匹配-异步匹配结果查询
        POST
      • 三单匹配-异步数据入库
        POST
      • 三单匹配-异步数据入库结果查询
        POST
      • 三单匹配-异步训练接口
        POST
    • 统一反馈
      • 三单匹配反馈详细说明
      • 算法服务统一反馈接口
    • 文档分类(区分发票、附件)
      POST
    • 智能赋码税收分类编码识别
      POST
  • 文档中心
    • 外部文件上传接口
      POST
  • 国际发票
  • 数据模型
    • 示例数据模型
      • Pet
      • Category
      • Tag
  1. 三单匹配

三单匹配-异步训练接口

开发中
POST
/ai/knowledge/nlpService/item/data/insert/push

一、接口描述#

提交人工标注的匹配对数据,异步写入历史库(向量库 + MySQL)。支持跨多张发票/入库单的匹配对批量导入。提交成功后返回 taskId,通过查询接口轮询任务状态。

⚠️ 注意事项#

仅在“向量库匹配模式”下,本数据才会生效
单次请求的匹配对总数 = 所有 candidate_item_ids 长度之和,上限 1000。*

二、请求参数#

1. 输入参数#

参数类型必填描述
client_idstringY租户标识
supplier_idstringY供应商标识
target_itemsarrayY发票明细列表
candidate_itemsarrayY入库单明细列表
match_resultarrayY匹配对列表,展开后总匹配对数不超过 1000

target_items 字段说明#

字段类型必填描述
item_idstringY发票明细唯一标识,同一租户内不可重复
doc_idstringY所属发票单据 ID ,同一租户内不可重复
product_namestringY商品名称
specification_modelstringN规格型号
amountnumberN金额
quantitynumberN数量
unitstringN单位
unit_pricenumberN单价

candidate_items 字段说明#

字段类型必填描述
item_idstringY入库单明细唯一标识,同一请求内不可重复
doc_idstringY所属入库单单据 ID
product_namestringY商品名称
specification_modelstringN规格型号
product_codestringN商品编码
amountnumberN金额
quantitynumberN数量
unitstringN单位
unit_pricenumberN单价

match_result 字段说明#

字段类型必填描述
target_item_idstringY发票明细 ID,必须存在于 target_items 中
candidate_item_idsarrayY匹配的入库单明细 ID 列表,每个 ID 必须存在于 candidate_items 中,支持一对多

📌 请求示例#

{
    "client_id": "client_001",
    "supplier_id": "supplier_001",
    "source": 0,
    "target_items": [
        {
            "item_id": "t_001",
            "doc_id": "inv_2024_001",
            "product_name": "螺栓",
            "specification_model": "M8x20",
            "amount": 100.00,
            "quantity": 10.0,
            "unit": "个",
            "unit_price": 10.00
        },
        {
            "item_id": "t_002",
            "doc_id": "inv_2024_001",
            "product_name": "螺母",
            "specification_model": "M8",
            "amount": 50.00,
            "quantity": 10.0,
            "unit": "个",
            "unit_price": 5.00
        }
    ],
    "candidate_items": [
        {
            "item_id": "c_001",
            "doc_id": "wh_2024_001",
            "product_name": "六角螺栓",
            "specification_model": "M8*20",
            "product_code": "P001",
            "amount": 60.00,
            "quantity": 6.0,
            "unit": "个",
            "unit_price": 10.00
        },
        {
            "item_id": "c_002",
            "doc_id": "wh_2024_002",
            "product_name": "六角螺栓",
            "specification_model": "M8*20",
            "product_code": "P001",
            "amount": 40.00,
            "quantity": 4.0,
            "unit": "个",
            "unit_price": 10.00
        },
        {
            "item_id": "c_003",
            "doc_id": "wh_2024_001",
            "product_name": "六角螺母",
            "specification_model": "M8",
            "product_code": "P002",
            "amount": 50.00,
            "quantity": 10.0,
            "unit": "个",
            "unit_price": 5.00
        }
    ],
    "match_result": [
        {
            "target_item_id": "t_001",
            "candidate_item_ids": ["c_001", "c_002"]
        },
        {
            "target_item_id": "t_002",
            "candidate_item_ids": ["c_003"]
        }
    ]
}

三、响应参数(同步返回)#

返回字段说明
参数名类型是否必返说明
errcodeString是返回码("0000" 表示提交成功)
descriptionString是操作信息描述
dataObject是返回数据
data.taskIdString是异步任务唯一标识
traceIdString是请求唯一标识(用于链路追踪)

请求参数

Query 参数

Header 参数

Body 参数application/json

示例
{
    "requestScene": "string",
    "items": [
        {
            "client_id": "string",
            "supplier_id": "string",
            "product_code": "string",
            "product_name": "string",
            "specification_model": "string"
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/ai/knowledge/nlpService/item/data/insert/push?access_token={{access_token}}' \
--header 'client-platform: common' \
--header 'Content-Type: application/json' \
--data-raw '{
    "requestScene": "string",
    "items": [
        {
            "client_id": "string",
            "supplier_id": "string",
            "product_code": "string",
            "product_name": "string",
            "specification_model": "string"
        }
    ]
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "errcode": "0000",
    "description": "Success",
    "data": {
        "taskId": "ec6fa3c4-f1a3-43b1-bde4-d13552dee144"
    },
    "traceId": "abf23ef9bde547789193e5338b622cad"
}
修改于 2026-04-23 10:39:23
上一页
三单匹配-异步数据入库结果查询
下一页
三单匹配反馈详细说明
Built with