接口文档· 更新于 2026-11-26
海关进出口货物报关单识别
启信宝 ncloud-external RobotController 转发接口;上游原始路径:/robot/customs/declaration;来源 Controller:RobotController
请求地址
生产环境
https://open.gch168.com/openapi/qxb/external/robot/customs/declaration- 请求方式
- POST
- 内容类型
- multipart/form-data
- 传输安全
- TLS 1.2 及以上
支持的鉴权方式
查看接入认证说明 →以下任一鉴权方式通过即可调用,签名细节与凭证获取请查看接入说明。
Header 签名(普通开放接口)API_KEY
通过 ApiKey、客户号或企业号识别租户,并对时间戳、随机串进行 MD5 签名校验,适用于绝大多数普通开放接口。
Sign = MD5(secretKey + timestamp + nonceStr),签名比较忽略大小写
请求头
公共请求头 →| 请求头 | 必填 | 类型 | 示例值 | 说明 |
|---|---|---|---|---|
| appKey | 必填 | string | 2cf51b5009db4d29b00b038c8cc3a6d6 | 调用方启信宝转发应用密钥 |
| timestamp | 必填 | string | 1716345600 | 请求时间戳,支持秒级或毫秒级 |
| sign | 必填 | string | md5-sign |
请求参数
| 参数名 | 位置 | 类型 | 必填 | 示例值 | 说明 |
|---|---|---|---|---|---|
appKey | QUERY | string | 必填 | upstream-app-key | ncloud-external 应用密钥;转发层会按调用方上下文重建或透传 |
timestamp | QUERY | string | 必填 | 1760000000 | ncloud-external 验签时间戳;转发层会按调用方上下文重建或透传 |
orgId | QUERY | long | 选填 | 10 | 组织 ID,非必填 |
orgName | QUERY | string | 选填 | 示例组织 | 组织名称,非必填 |
image | BODY | file | 必填 | customs-declaration.pdf | 待识别报关单文件,multipart/form-data 文件字段 |
multipage | QUERY | integer | 选填 | 1 | 是否需要对 PDF 多页识别,0 单页,1 多页 |
combine_document | QUERY | integer | 选填 | 1 | 是否合并报关单多页表格识别结果,需先开启 multipage |
split_price | QUERY | integer | 选填 | 1 | 是否拆分表格内价格信息,拆分后输出单价、总价、币制 |
split_product_info | QUERY | integer | 选填 | 1 | 是否拆分商品名称规格信息,拆分后输出商品名称、规格型号 |
响应参数
业务成功时返回 code = 200,其余状态码见下方接口状态码与全局状态码。
| 字段名 | 类型 | 示例值 | 说明 |
|---|---|---|---|
errorCode | integer | 200 | ncloud-external 业务响应码 |
errorMessage | string | 识别成功 | ncloud-external 响应消息 |
data | object | {} | TextIn 报关单识别 result 对象 |
success_count | integer | 1 | 成功识别次数 |
pages | object[] | [{}] | 多页识别结果列表 |
type | string | customs_declaration_for_imported_goods | 报关单类型 |
image_angle | integer | 0 | 图片角度 |
rotated_image_width | integer | 1920 | 转正后图片宽度 |
rotated_image_height | integer | 1080 | 转正后图片高度 |
details | object | {} | 报关单识别字段集合 |
pre_entry_number | object | {} | 预录入编号,字段结构包含 value、position、page_id、description |
customs_number | object | {} | 海关编号,字段结构包含 value、position、page_id、description |
domestic_consignor | object | {} | 境内发货人,字段结构包含 value、position、page_id、description |
domestic_consignee | object | {} | 境内收货人,字段结构包含 value、position、page_id、description |
import_date | object | {} | 进口日期,字段结构包含 value、position、page_id、description |
declaration_date | object | {} | 申报日期,字段结构包含 value、position、page_id、description |
transportation_mode | object | {} | 运输方式,字段结构包含 value、position、page_id、description |
delivery_number | object | {} | 提运单号,字段结构包含 value、position、page_id、description |
item_list | object[] | [{}] | 商品表格明细 |
item_number | object | {} | 项号,字段结构包含 value、position、page_id、description |
product_id | object | {} | 商品编号,字段结构包含 value、position、page_id、description |
product_name_and_specification_model | object | {} | 商品名称及规格型号,字段结构包含 value、position、page_id、description |
product_name | object | {} | 商品名称,开启 split_product_info 后返回 |
specification_model | object | {} | 规格型号,开启 split_product_info 后返回 |
quantity_and_unit | object | {} | 数量及单位,字段结构包含 value、position、page_id、description |
unit_price_total_price_currency_value | object | {} | 单价、总价、币制合并字段 |
unit_price | object | {} | 单价,开启 split_price 后返回 |
total_price | object | {} | 总价,开启 split_price 后返回 |
currency | object | {} | 币制,开启 split_price 后返回 |
country_of_origin | object | {} | 原产国或地区,字段结构包含 value、position、page_id、description |
tax_exemption | object | {} | 征免,字段结构包含 value、position、page_id、description |
状态码
全局状态码 →| 状态码 | 说明 |
|---|---|
| 200 | 调用成功 |
| 500 | 转发或上游识别失败 |
请求与响应示例
请求示例
请求示例
multipart/form-data; appKey=upstream-app-key; timestamp=1760000000; orgId=10; orgName=示例组织; image=@customs-declaration.pdf; multipage=1; combine_document=1; split_price=1; split_product_info=1响应示例
响应示例
{
"errorCode": 200,
"errorMessage": "识别成功",
"data": {
"success_count": 1,
"type": "customs_declaration_for_imported_goods",
"details": {
"customs_number": {
"value": "310120240000001",
"description": "海关编号",
"page_id": 0
},
"item_list": [
{
"item_number": {
"value": "1"
},
"product_id": {
"value": "8471309000"
},
"product_name": {
"value": "笔记本电脑"
},
"unit_price": {
"value": "1000.00"
},
"total_price": {
"value": "1000.00"
},
"currency": {
"value": "美元"
}
}
]
}
}
}