报关单识别接口基于先进的自主OCR核心技术,融合深度学习算法与海量真实报关单数据训练,能够精准、高效地结构化识别海关进口及出口报关单中的关键信息。接口可自动提取包括境内收货人、进境关别、进出口日期、申报日期、运输方式等在内的核心关键字段,并输出标准化的结构化数据。报关单识别接口提供稳定、易集成的标准化API,支持私有化部署,显著提升货物处理效率与准确性,助力企业实现智能化通关与高效运营。
一、图片为base64流
接口地址:https://XXX.com/api/recog_bgd.do
接口调用方法:post
二、进出口报关单识别结果返回示例
进口报关单
"message": {
"status": 0,
"value": "识别完成"
},
"info": {
"type": "lgStatement34",
"customsNumber": "海关编号",
"domesticConsignee": "境内收货人",
"portOfEntry": "进境关别",
"importDate": "进口日期",
"declareDate": "申报日期",
"recordNumber": "备案号",
"foreignShipper": "境外发货人",
"modeOfTransport": "运输方式",
"transportVehicleAndVoyage": "运输工具名称及航次号",
"billOfLading": "提运单号",
"goodsStorageLocation": "货物存放地点",
"consumptionUseUnit": "消费使用单位",
"regulationMethod": "监管方式",
"dutyFreeNature": "征免性质",
"licenseNumber": "许可证号",
"portOfShipment": "启运港",
"contractAgreementNumber": "合同协议号",
"tradingCountryRegion": "贸易国(地区)",
"countryOfOrigin": "启运国(地区)",
"portOfCall": "经停港",
"portOfEntryLocation": "入境口岸",
"packagingType": "包装种类",
"pieces": "件数",
"grossWeightKg": "毛重(千克)",
"netWeightKg": "净重(千克)",
"transactionMethod": "成交方式",
"freight": "运费",
"insurance": "保费",
"miscellaneousFees": "杂费",
"documentsAndNumbers": "随附单证及编号",
"markingsAndRemarks": "标记喷码及备注",
"specialRelationshipConfirmation": "特殊关系确认",
"priceInfluenceConfirmation": "价格影响确认",
"royaltyPaymentConfirmation": "支付特权使用费确认",
"formulaPricingConfirmation": "公式定价确认:",
"provisionalPriceConfirmation": "暂定价格确认",
"selfDeclarationAndPayment": "自报自缴",
"customsOfficer": "报关人员",
"customsOfficerLicenseNumber": "报关人员证号",
"telephone": "电话",
"declaringUnit": "申报单位"
},
"forms": [
{
"itemNumber": "项号",
"commodityCode": "商品编号",
"commodityNameAndSpec": "商品名称及规格型号",
"quantityAndUnit": "数量及单位",
"unitPriceTotalPriceAndCurrency": "单价/总价/币制",
"originCountryRegion": "原产国(地区)",
"finalDestinationCountry": "最终目的国(地区)",
"domesticLocation": "境内目的地",
"taxation": "征免"
}
]
}
出口报关单
"message": {
"status": 0,
"value": "识别完成"
},
"info": {
"type": "lgStatement32",
"customsNumber": "海关编号",
"domesticShipper": "境内发货人",
"portOfExit": "出境关别",
"exportDate": "出口日期",
"declareDate": "申报日期",
"recordNumber": "备案号",
"foreignConsignee": "境外收货人",
"modeOfTransport": "运输方式",
"transportVehicleAndVoyage": "运输工具名称及航次号",
"billOfLading": "提运单号",
"producerSalesUnit": "生产销售单位",
"regulationMethod": "监管方式",
"dutyFreeNature": "征免性质",
"licenseNumber": "许可证号",
"contractAgreementNumber": "合同协议号",
"tradingCountryRegion": "贸易国(地区)",
"countryOfDestination": "运抵国(地区)",
"portOfDestination": "指运港",
"portOfDeparture": "离境口岸",
"packagingType": "包装种类",
"pieces": "件数",
"grossWeightKg": "毛重(千克)",
"netWeightKg": "净重(千克)",
"transactionMethod": "成交方式",
"freight": "运费",
"insurance": "保费",
"miscellaneousFees": "杂费",
"documentsAndNumbers": "随附单证及编号",
"markingsAndRemarks": "标记唛码及备注",
"specialRelationshipConfirmation": "特殊关系确认",
"priceInfluenceConfirmation": "价格影响确认",
"royaltyPaymentConfirmation": "支付特权使用费确认",
"formulaPricingConfirmation": "公式定价确认",
"provisionalPriceConfirmation": "暂定价格确认",
"selfDeclarationAndPayment": "自报自缴",
"customsOfficer": "报关人员",
"customsOfficerLicenseNumber": "报关人员证号",
"telephone": "电话",
"declaringUnit": "申报单位"
},
"forms": [
{
"itemNumber": "项号",
"commodityCode": "商品编号",
"commodityNameAndSpec": "商品名称及规格型号",
"quantityAndUnit": "数量及单位",
"unitPriceTotalPriceAndCurrency": "单价/总价/币制",
"originCountryRegion": "原产国(地区)",
"finalDestinationCountry": "最终目的国(地区)",
"domesticLocation": "境内货源地",
"taxation": "征免"
}
]
}
三、报关单识别接口Java集成代码示例:
package com.test;
import okhttp3.*;
import org.json.JSONObject;
import java.io.*;
/**
* 需要添加依赖
*
*
* com.squareup.okhttp3
* okhttp
* 4.12.0
*
*/
class Sample {
static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
public static void main(String []args) throws IOException{
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("img","/9j")
.addFormDataPart("key","***********")
.addFormDataPart("secret","**********")
.addFormDataPart("typeId","52")
.addFormDataPart("format","json")
.build();
Request request = new Request.Builder()
.url("https://netocr.XXX/api/recog_bgd.do")
.method("POST", body)
.build();
Response response = HTTP_CLIENT.newCall(request).execute();
System.out.println(response.body().string());
}
}