Skip to main content
POST
/
doc-agent
/
api
/
v1
/
claim
/
create
cURL
curl --request POST \
  --url https://agents.textin.com/doc-agent/api/v1/claim/create \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <x-api-key>' \
  --form callback_api=http://localhost:8080/callback \
  --form 'files=<string>' \
  --form 'insured_name=张三' \
  --form is_async=true \
  --form policy_no=p12345678 \
  --form 'stages[0]=1' \
  --form 'stages[1]=2' \
  --form files.items='@example-file'
{
  "claim_id": "abcd-1234-qwer-7890",
  "completeness_result": {
    "is_complete": false,
    "missing_categories": [
      "身份与授权",
      "保险与资格"
    ],
    "status": 2
  },
  "materials": [
    {
      "category": "增值税发票",
      "confidence_status": 0,
      "extract_result": {
        "document": {
          "pages": [
            {
              "angle": 0,
              "height": 2888,
              "lines": [
                {
                  "position": [
                    679,
                    132,
                    1412,
                    121,
                    1413,
                    195,
                    680,
                    206
                  ],
                  "text": "山东增值税电子普通发票"
                }
              ],
              "width": 2052
            }
          ]
        },
        "fields": [
          {
            "key": "发票号码",
            "position": [
              {
                "page": 0,
                "vertices": [
                  1604,
                  143,
                  1715,
                  143,
                  1715,
                  167,
                  1604,
                  167
                ]
              }
            ],
            "value": "7305"
          }
        ],
        "pages": [],
        "tables": [
          {
            "items": [
              {
                "values": [
                  {
                    "key": "项目名称",
                    "not_consistence_reason": [],
                    "position": [
                      {
                        "page": 0,
                        "vertices": [
                          119,
                          590,
                          449,
                          590,
                          449,
                          624,
                          119,
                          624
                        ]
                      }
                    ],
                    "value": "*汽油*92号 车用汽油(VIA)"
                  }
                ]
              }
            ],
            "table_name": "Table1",
            "table_type": "0"
          }
        ]
      },
      "file_name": "发票.jpg",
      "file_size": "2540797",
      "file_type": ".jpg",
      "material_id": "718fe34e-5d62-4b6a-a8be-18661265f132",
      "status": 0
    }
  ],
  "timeline_result": [
    {
      "at": "",
      "desc": "双眼干涩、异物感、疲劳",
      "event": "发病",
      "evidence": [
        {
          "details": [
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    1832,
                    578,
                    2081,
                    578,
                    2081,
                    615,
                    1832,
                    615
                  ]
                }
              ],
              "text": "2023-04-12"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    680,
                    788,
                    1318,
                    788,
                    1318,
                    838,
                    680,
                    838
                  ]
                }
              ],
              "text": "双眼干涩、有异物感不适2年"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    679,
                    855,
                    1497,
                    855,
                    1497,
                    905,
                    679,
                    905
                  ]
                }
              ],
              "text": "2年来双眼干涩、疲劳,无其他不适。"
            }
          ],
          "material_id": "f80f627f-e419-49af-834a-2a1e85cfc1e0"
        }
      ]
    },
    {
      "at": "",
      "desc": "干眼症,ICD-10编码: H04.1",
      "event": "诊断",
      "evidence": [
        {
          "details": [
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    1832,
                    578,
                    2081,
                    578,
                    2081,
                    615,
                    1832,
                    615
                  ]
                }
              ],
              "text": "2023-04-12"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    662,
                    1314,
                    813,
                    1314,
                    813,
                    1363,
                    662,
                    1363
                  ]
                }
              ],
              "text": "干眼症"
            }
          ],
          "material_id": "f80f627f-e419-49af-834a-2a1e85cfc1e0"
        }
      ]
    },
    {
      "at": "",
      "desc": "玻璃酸钠滴眼液,每次0.001ml滴双眼,tid",
      "event": "治疗",
      "evidence": [
        {
          "details": [
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    1832,
                    578,
                    2081,
                    578,
                    2081,
                    615,
                    1832,
                    615
                  ]
                }
              ],
              "text": "2023-04-12"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    662,
                    1507,
                    1230,
                    1507,
                    1230,
                    1558,
                    662,
                    1558
                  ]
                },
                {
                  "page": 0,
                  "vertices": [
                    794,
                    1580,
                    1362,
                    1580,
                    1362,
                    1628,
                    794,
                    1628
                  ]
                },
                {
                  "page": 0,
                  "vertices": [
                    452,
                    1792,
                    1810,
                    1792,
                    1810,
                    1838,
                    452,
                    1838
                  ]
                },
                {
                  "page": 0,
                  "vertices": [
                    449,
                    1859,
                    564,
                    1859,
                    564,
                    1904,
                    449,
                    1904
                  ]
                }
              ],
              "text": "玻璃酸钠滴眼液 5ml:5mg;每次0.001ml 滴双眼 tid;治疗期间若有病情加重请及时复诊;若病情平稳,请按照医生要求复诊。"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    662,
                    1507,
                    1230,
                    1507,
                    1230,
                    1558,
                    662,
                    1558
                  ]
                },
                {
                  "page": 0,
                  "vertices": [
                    794,
                    1580,
                    1362,
                    1580,
                    1362,
                    1628,
                    794,
                    1628
                  ]
                }
              ],
              "text": "玻璃酸钠滴眼液 5ml:5mg;每次0.001ml 滴双眼 tid"
            }
          ],
          "material_id": "f80f627f-e419-49af-834a-2a1e85cfc1e0"
        }
      ]
    },
    {
      "at": "",
      "desc": "门诊发票:总额87.00元;治疗费87.00元;个人现金支付87元;医保及第三方支付0元",
      "event": "支付费用",
      "evidence": [
        {
          "details": [
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    1395,
                    227,
                    1849,
                    227,
                    1849,
                    322,
                    1395,
                    322
                  ]
                }
              ],
              "text": "门诊发票"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    2267,
                    588,
                    2514,
                    588,
                    2514,
                    619,
                    2267,
                    619
                  ]
                }
              ],
              "text": "2024-09-25"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    2133,
                    1411,
                    2245,
                    1411,
                    2245,
                    1443,
                    2133,
                    1443
                  ]
                }
              ],
              "text": "87.00"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    440,
                    748,
                    568,
                    748,
                    568,
                    787,
                    440,
                    787
                  ]
                }
              ],
              "text": "治疗费"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    1172,
                    766,
                    1283,
                    766,
                    1283,
                    800,
                    1172,
                    800
                  ]
                }
              ],
              "text": "87.00"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    2223,
                    1643,
                    2268,
                    1643,
                    2268,
                    1673,
                    2223,
                    1673
                  ]
                }
              ],
              "text": "87"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    670,
                    1695,
                    694,
                    1695,
                    694,
                    1724,
                    670,
                    1724
                  ]
                }
              ],
              "text": "0"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    2311,
                    1747,
                    2333,
                    1747,
                    2333,
                    1776,
                    2311,
                    1776
                  ]
                }
              ],
              "text": "0"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    2757,
                    1641,
                    2782,
                    1641,
                    2782,
                    1673,
                    2757,
                    1673
                  ]
                }
              ],
              "text": "0"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    839,
                    1643,
                    882,
                    1643,
                    882,
                    1675,
                    839,
                    1675
                  ]
                }
              ],
              "text": "87"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    2311,
                    1747,
                    2333,
                    1747,
                    2333,
                    1776,
                    2311,
                    1776
                  ]
                }
              ],
              "text": "0"
            },
            {
              "page_id": 0,
              "position": [
                {
                  "page": 0,
                  "vertices": [
                    2757,
                    1641,
                    2782,
                    1641,
                    2782,
                    1673,
                    2757,
                    1673
                  ]
                }
              ],
              "text": "0"
            }
          ],
          "material_id": "09234629-565f-4eba-8c6f-59faf72c39eb"
        }
      ]
    }
  ]
}

Headers

x-api-key
string
required

Body

multipart/form-data
callback_api
string

回调接口 处理结果会通过回调接口通知 注:可能需要开发并联调后才能正常使用回调

Example:

"http://localhost:8080/callback"

files
file[]
insured_name
string

被保险人姓名

Example:

"张三"

is_async
boolean

是否异步 异步调用时,会返回claim_id和materials列表,然后通过后续其他接口轮询获取结果 同步调用时,会在当前接口返回所有的处理结果。 注:不建议使用同步调用。因为同步调用处理时间较长,且网络环境波动可能导致长连接断开

Example:

true

policy_no
string

保单号

Example:

"p12345678"

stages
integer<int32>[]

执行阶段 请使用以下五种组合之一: [1], [1,2], [1,2,3], [1,2,4], [1,2,3,4] 数字表示的含义:1分类,2抽取,3时间线,4真实性校验

Example:
[1, 2]

Response

200 - application/json

OK

claim_id
string

案件ID

Example:

"abcd-1234-qwer-7890"

completeness_result
object

材料齐全性检查结果

Example:
{
"is_complete": false,
"missing_categories": ["身份与授权", "保险与资格"],
"status": 2
}
materials
object[]

材料列表

Example:
[
{
"category": "增值税发票",
"confidence_status": 0,
"extract_result": {
"document": {
"pages": [
{
"angle": 0,
"height": 2888,
"lines": [
{
"position": [679, 132, 1412, 121, 1413, 195, 680, 206],
"text": "山东增值税电子普通发票"
}
],
"width": 2052
}
]
},
"fields": [
{
"key": "发票号码",
"position": [
{
"page": 0,
"vertices": [1604, 143, 1715, 143, 1715, 167, 1604, 167]
}
],
"value": "7305"
}
],
"pages": [],
"tables": [
{
"items": [
{
"values": [
{
"key": "项目名称",
"not_consistence_reason": [],
"position": [
{
"page": 0,
"vertices": [119, 590, 449, 590, 449, 624, 119, 624]
}
],
"value": "*汽油*92号 车用汽油(VIA)"
}
]
}
],
"table_name": "Table1",
"table_type": "0"
}
]
},
"file_name": "发票.jpg",
"file_size": "2540797",
"file_type": ".jpg",
"material_id": "718fe34e-5d62-4b6a-a8be-18661265f132",
"status": 0
}
]
timeline_result
object

案件时间线结果

Example:
[
{
"at": "",
"desc": "双眼干涩、异物感、疲劳",
"event": "发病",
"evidence": [
{
"details": [
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [1832, 578, 2081, 578, 2081, 615, 1832, 615]
}
],
"text": "2023-04-12"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [680, 788, 1318, 788, 1318, 838, 680, 838]
}
],
"text": "双眼干涩、有异物感不适2年"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [679, 855, 1497, 855, 1497, 905, 679, 905]
}
],
"text": "2年来双眼干涩、疲劳,无其他不适。"
}
],
"material_id": "f80f627f-e419-49af-834a-2a1e85cfc1e0"
}
]
},
{
"at": "",
"desc": "干眼症,ICD-10编码: H04.1",
"event": "诊断",
"evidence": [
{
"details": [
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [1832, 578, 2081, 578, 2081, 615, 1832, 615]
}
],
"text": "2023-04-12"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [662, 1314, 813, 1314, 813, 1363, 662, 1363]
}
],
"text": "干眼症"
}
],
"material_id": "f80f627f-e419-49af-834a-2a1e85cfc1e0"
}
]
},
{
"at": "",
"desc": "玻璃酸钠滴眼液,每次0.001ml滴双眼,tid",
"event": "治疗",
"evidence": [
{
"details": [
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [1832, 578, 2081, 578, 2081, 615, 1832, 615]
}
],
"text": "2023-04-12"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [
662,
1507,
1230,
1507,
1230,
1558,
662,
1558
]
},
{
"page": 0,
"vertices": [
794,
1580,
1362,
1580,
1362,
1628,
794,
1628
]
},
{
"page": 0,
"vertices": [
452,
1792,
1810,
1792,
1810,
1838,
452,
1838
]
},
{
"page": 0,
"vertices": [449, 1859, 564, 1859, 564, 1904, 449, 1904]
}
],
"text": "玻璃酸钠滴眼液 5ml:5mg;每次0.001ml 滴双眼 tid;治疗期间若有病情加重请及时复诊;若病情平稳,请按照医生要求复诊。"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [
662,
1507,
1230,
1507,
1230,
1558,
662,
1558
]
},
{
"page": 0,
"vertices": [
794,
1580,
1362,
1580,
1362,
1628,
794,
1628
]
}
],
"text": "玻璃酸钠滴眼液 5ml:5mg;每次0.001ml 滴双眼 tid"
}
],
"material_id": "f80f627f-e419-49af-834a-2a1e85cfc1e0"
}
]
},
{
"at": "",
"desc": "门诊发票:总额87.00元;治疗费87.00元;个人现金支付87元;医保及第三方支付0元",
"event": "支付费用",
"evidence": [
{
"details": [
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [1395, 227, 1849, 227, 1849, 322, 1395, 322]
}
],
"text": "门诊发票"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [2267, 588, 2514, 588, 2514, 619, 2267, 619]
}
],
"text": "2024-09-25"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [
2133,
1411,
2245,
1411,
2245,
1443,
2133,
1443
]
}
],
"text": "87.00"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [440, 748, 568, 748, 568, 787, 440, 787]
}
],
"text": "治疗费"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [1172, 766, 1283, 766, 1283, 800, 1172, 800]
}
],
"text": "87.00"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [
2223,
1643,
2268,
1643,
2268,
1673,
2223,
1673
]
}
],
"text": "87"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [670, 1695, 694, 1695, 694, 1724, 670, 1724]
}
],
"text": "0"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [
2311,
1747,
2333,
1747,
2333,
1776,
2311,
1776
]
}
],
"text": "0"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [
2757,
1641,
2782,
1641,
2782,
1673,
2757,
1673
]
}
],
"text": "0"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [839, 1643, 882, 1643, 882, 1675, 839, 1675]
}
],
"text": "87"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [
2311,
1747,
2333,
1747,
2333,
1776,
2311,
1776
]
}
],
"text": "0"
},
{
"page_id": 0,
"position": [
{
"page": 0,
"vertices": [
2757,
1641,
2782,
1641,
2782,
1673,
2757,
1673
]
}
],
"text": "0"
}
],
"material_id": "09234629-565f-4eba-8c6f-59faf72c39eb"
}
]
}
]