Skip to content

Latest commit

 

History

History
667 lines (541 loc) · 29.9 KB

中国电子口岸报文加签接口文档.md

File metadata and controls

667 lines (541 loc) · 29.9 KB

中国电子口岸报文加签API文档

Version Update Time Status Author Description
1.0.0 2022-02-16 10:30 创建 Weasley J 创建API文档
1.0.9 2023-06-11 15:36 编辑 Weasley J 更新API文档
1.1.0 2023-07-15 15:36 编辑 Weasley J 补充API文档
1.1.1 2023-08-09 15:48 更新 Weasley J 增加查询申报回执结果

电子口岸报文加签(测试)

海关总署XML数据加签

URL: http://localhost:8080/rpc/eport/test/cebmessage/signature

Type: GET

Author: lwj

Content-Type: application/x-www-form-urlencoded;charset=UTF-8

Description: 非正式调用API,只为了让你看到海关总署XML加密的数据返回格式

Request-headers:

Header Type Required Description Since
x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

Request-example:

curl -X GET -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/test/cebmessage/signature

Response-fields:

Field Type Description Since
message string 返回消息 -
success boolean 是否成功 -
timestamp string 响应时间戳 -
code int32 状态码 -
data object 响应数据 -
└─success boolean 本次加签是否成功 -
└─certNo string 签名的ukey的卡序列号 -
└─x509Certificate string 签名的ukey证书 -
└─digestValue string XML报文的数字摘要 -
└─signatureValue string 调用ukey获取的签名值 -
└─signatureNode string XML报文的签名节点
  • 用来组装 ds:SignedInfo 节点
  • -

    Response-example:

    {
      "message": "操作成功",
      "success": true,
      "timestamp": "2023-07-31 17:42:58",
      "code": 200,
      "data": {
        "success": true,
        "certNo": "03000000000cde6f",
        "x509Certificate": "MIIEoDCCBESgAwIBAgIIAwAAAAAM3m8wDAYIKoEcz1UBg3UFADCBmDELMAkGA1UEBhMCQ04xDzANBgNVBAgMBuWMl+S6rDEPMA0GA1UEBwwG5YyX5LqsMRswGQYDVQQKDBLkuK3lm73nlLXlrZDlj6PlsrgxGzAZBgNVBAsMEuivgeS5pueuoeeQhuS4reW/gzEtMCsGA1UEAwwk5Lit5Zu955S15a2Q5Lia5Yqh6K+B5Lmm566h55CG5Lit5b+DMB4XDTIzMDMyOTAwMDAwMFoXDTMzMDMyOTAwMDAwMFowVjELMAkGA1UEBhMCQ04xMzAxBgNVBAsMKua1t+WNl+ecgeiNo+iqiei/m+WHuuWPo+i0uOaYk+aciemZkOWFrOWPuDESMBAGA1UEAwwJ5p2o5aaC6YeRMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE0vOQmplAr9igPZrA8F1msqnFd0U++6G6NhG5rNuIUWft0BwQn7eSJkt5/fvSSoe7pUg2/awHUWPnzkeeQc7oVqOCArUwggKxMBEGCWCGSAGG+EIBAQQEAwIFoDAOBgNVHQ8BAf8EBAMCBsAwCQYDVR0TBAIwADApBgNVHSUEIjAgBggrBgEFBQcDAgYIKwYBBQUHAwQGCisGAQQBgjcUAgIwHwYDVR0jBBgwFoAURCQxt0wEvoAVXmuo4N1bjKXTh0UwHQYDVR0OBBYEFAytGob5L0WqhOCZ5l6Lf2jUdNrAMGgGA1UdIARhMF8wXQYEVR0gADBVMFMGCCsGAQUFBwIBFkdodHRwczovL3d3dy5jaGluYXBvcnQuZ292LmNuL3RjbXNmaWxlL3UvY21zL3d3dy8yMDIyMDQvMTIxMzI5NDh4dDZwLnBkZjB/BgNVHR8EeDB2MHSgcqBwhm5sZGFwOi8vbGRhcC5jaGluYXBvcnQuZ292LmNuOjM4OS9jbj1jcmwwMzAwMDAsb3U9Y3JsMDAsb3U9Y3JsLGM9Y24/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdD9iYXNlP2NuPWNybDAzMDAwMDA+BggrBgEFBQcBAQQyMDAwLgYIKwYBBQUHMAGGImh0dHA6Ly9vY3NwLmNoaW5hcG9ydC5nb3YuY246ODgwMC8wOgYKKwYBBAGpQ2QFAQQsDCrmtbfljZfnnIHojaPoqonov5vlh7rlj6PotLjmmJPmnInpmZDlhazlj7gwEgYKKwYBBAGpQ2QFAwQEDAIwMTAiBgorBgEEAalDZAUIBBQMEjUxMjMyNDE5NjQxMDE3Mjk3WDAgBgorBgEEAalDZAUJBBIMEDAzLUpKMEc5MDAyMjA3NTIwGQYKKwYBBAGpQ2QFCwQLDAlNQTVUTkZHWTkwEgYKKwYBBAGpQ2QFDAQEDAIwMDASBgorBgEEAalDZAIBBAQMAjEyMBIGCisGAQQBqUNkAgQEBAwCMTQwDAYIKoEcz1UBg3UFAANIADBFAiBM4OVAc8aaCZU4XFfcVMkC7bWIIenRnPLxrnwVeYO3CQIhANQ767YIurkJCoLtwyqQPbUZe/+3BjGZcIWqB1mAl9T+",
        "digestValue": "/uy5whbEnIhnrSkF7hSAJNm8ISI=",
        "signatureValue": "lziAtii3Ibn4UaHMAZ5MI90PLlQvn8Qm7m06gjRM/TcCI5pCtCbBGsZ+UoMmjbSjk4KP90wugL5DV5PXKVwYlA==",
        "signatureNode": "<ds:SignedInfo xmlns:ceb=\"http://www.chinaport.gov.cn/ceb\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\"></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sm2-sm3\"></ds:SignatureMethod><ds:Reference URI=\"\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>/uy5whbEnIhnrSkF7hSAJNm8ISI=</ds:DigestValue></ds:Reference></ds:SignedInfo>"
      }
    }
    

    海关179数据抓取加签

    URL: http://localhost:8080/rpc/eport/test/179/signature

    Type: GET

    Author: lwj

    Content-Type: application/x-www-form-urlencoded;charset=UTF-8

    Description: 非正式调用API,只为了让你看到179加密的数据返回格式

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Request-example:

    curl -X GET -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/test/179/signature
    

    Response-fields:

    Field Type Description Since
    message string 返回消息 -
    success boolean 是否成功 -
    timestamp string 响应时间戳 -
    code int32 状态码 -
    data object 响应数据 -
    └─success boolean 本次加签是否成功 -
    └─certNo string 签名的ukey的卡序列号 -
    └─x509Certificate string 签名的ukey证书 -
    └─digestValue string XML报文的数字摘要 -
    └─signatureValue string 调用ukey获取的签名值 -
    └─signatureNode string XML报文的签名节点
  • 用来组装 ds:SignedInfo 节点
  • -

    Response-example:

    {
      "message": "操作成功",
      "success": true,
      "timestamp": "2023-07-28 21:38:43",
      "code": 200,
      "data": {
        "success": true,
        "certNo": "03000000000cde6f",
        "signatureValue": "05mobHSrNqcy0ZNVH484S80dnusjP9fD2esnYTiTQKy8/O6LGSYAYRMRzI+p1vEAVSFt+F0s3jYI6c5W7dZMzA=="
      }
    }
    

    执行脚本命令

    URL: http://localhost:8080/rpc/eport/test/endpoint/exec

    Type: GET

    Author: lwj

    Content-Type: application/x-www-form-urlencoded;charset=UTF-8

    Description: 此接口测试环境、生产环境不对外开放,会在将终端输出同步写给浏览器

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Query-parameters:

    Parameter Type Required Description Since
    cmd string true No comments found. -

    Request-example:

    curl -X GET -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/test/endpoint/exec?cmd=
    

    Response-example:

    Return void.
    

    查询申报回执结果

    查询311进口单申报结果

    URL: http://localhost:8080/rpc/eport/result/ceb312msg

    Type: GET

    Author: weasley

    Content-Type: application/x-www-form-urlencoded;charset=UTF-8

    Description: 查询此时间点之后的数据,必须在当前时间点之前,默认查询当前时间前15秒的申报数据,当前时间:20230806144417,则 qryId=20230806144401,不传的情况适用于刚刚申报成功查询回执结果,海关的处理时间间隔约为15秒

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Query-parameters:

    Parameter Type Required Description Since
    qryId string false 查询时间,日期时间格式:yyyyMMddHHmmss -

    Request-example:

    curl -X GET -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/result/ceb312msg?qryId=yyyy-MM-dd HH:mm:ss
    

    Response-fields:

    Field Type Description Since
    message string 返回消息 -
    success boolean 是否成功 -
    timestamp string 响应时间戳 -
    code int32 状态码 -
    data string 响应数据 -

    Response-example:

    {
      "message": "操作成功",
      "success": true,
      "timestamp": "2023-08-09 15:18:25",
      "code": 200,
      "data": "[{org_id=1, instm=1691397836000, re_order_guid=NWIVQA-WEASLEY-20230807164347-GCVZ4S, returnstatus=2, ebpcode=46016602EV, returntime2=20230807164356, ebccode=46016602EV, trans_dxpid=DXPENT0000530815, returninfo=新增申报成功[NWIVQA-WEASLEY-20230807164347-GCVZ4S], returntime=1691397830000, orderno=JO_D8079556739228400022}]"
    }
    

    查询621进口单申报结果

    URL: http://localhost:8080/rpc/eport/result/ceb622msg

    Type: GET

    Author: weasley

    Content-Type: application/x-www-form-urlencoded;charset=UTF-8

    Description: 查询此时间点之后的数据,必须在当前时间点之前,默认查询当前时间前15秒的申报数据,当前时间:20230806144417,则 qryId=20230806144401,不传的情况适用于刚刚申报成功查询回执结果,海关的处理时间间隔约为15秒

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Query-parameters:

    Parameter Type Required Description Since
    qryId string false 查询时间,日期时间格式:yyyyMMddHHmmss -

    Request-example:

    curl -X GET -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/result/ceb622msg?qryId=yyyy-MM-dd HH:mm:ss
    

    Response-fields:

    Field Type Description Since
    message string 返回消息 -
    success boolean 是否成功 -
    timestamp string 响应时间戳 -
    code int32 状态码 -
    data string 响应数据 -

    Response-example:

    {
      "message": "操作成功",
      "success": true,
      "timestamp": "2023-08-09 15:26:53",
      "code": 200,
      "data": "[{org_id=1, instm=1691397837000, agentcode=46016602EV, re_elist_guid_cus=9422f96b-ccbc-4a69-a899-6d9dd583d501, returnstatus=2, ebpcode=46016602EV, preno=B20230807570793612, returntime2=20230807164357, ebccode=46016602EV, createtime=20230807164351, trans_dxpid=DXPENT0000530815, returninfo=清单新增申报成功[3CQHDG-WEASLEY-20230807164348-7KYRQN][电商企业编码:46016602EV订单编号:JO_D8079556739228400022], returntime=1691397830000, re_elist_guid=3CQHDG-WEASLEY-20230807164348-7KYRQN, customscode=6409}, {org_id=1, instm=1691397847000, agentcode=46016602EV, re_elist_guid_cus=9422f96b-ccbc-4a69-a899-6d9dd583d501, returnstatus=120, ebpcode=46016602EV, preno=B20230807570793612, returntime2=20230807164407, ebccode=46016602EV, createtime=20230807164355, trans_dxpid=DXPENT0000530815, returninfo=[Code:1800;Desc:逻辑校验通过], returntime=1691397831000, re_elist_guid=4e7a2dab-064b-410b-9ce6-e322c590ae3d, customscode=6409, invtno=64092023I000722460}, {org_id=1, instm=1691397847000, agentcode=46016602EV, re_elist_guid_cus=9422f96b-ccbc-4a69-a899-6d9dd583d501, returnstatus=800, ebpcode=46016602EV, preno=B20230807570793612, returntime2=20230807164407, ebccode=46016602EV, createtime=20230807164355, trans_dxpid=DXPENT0000530815, returninfo=[Code:2600;Desc:放行], returntime=1691397832000, re_elist_guid=4e7a2dab-064b-410b-9ce6-e322c590ae3d, customscode=6409, invtno=64092023I000722460}]"
    }
    

    Ukey健康状态恢复

    ukey健康指令

    URL: http://localhost:8080/rpc/eport/ukey/health/endpoint/{command}

    Type: POST

    Author: lwj

    Content-Type: application/x-www-form-urlencoded;charset=UTF-8

    Description:

      支持command类型

    • RESTART: 重启控件(较多使用)
    • START: 启动控件
    • STOP: 停止控件
    • REPAIR: 修复证书

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Request-example:

    curl -X POST -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/ukey/health/endpoint/{command}
    

    Response-fields:

    Field Type Description Since
    message string 返回消息 -
    success boolean 是否成功 -
    timestamp string 响应时间戳 -
    code int32 状态码 -
    data object 响应数据 -
    └─stdOutList array 标准输出流信息 -
    └─errorOutList array 错误输出流信息 -

    Response-example:

    {
      "message": "",
      "success": true,
      "timestamp": "",
      "code": 0,
      "data": {
        "stdOutList": [
          ""
        ],
        "errorOutList": [
          ""
        ]
      }
    }
    

    电子口岸报文推送

    推送CEBMessage报文

    URL: http://localhost:8080/rpc/eport/upload/CEBMessage

    Type: POST

    Author: weasley

    Content-Type: application/json

    Description:

      支持JSON报文和XML报文

    • JSON报文: 无需组装XML结构报文
    • XML报文: 需组装XML结构的报文
    • (已实现的CEBMessage报文: 311/621)

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Body-parameters:

    Parameter Type Required Description Since
    messageType enum true 消息类型
    [Enum values:
    CEB311Message("CEB311Message", IMPORT_MESSAGE)
    CEB312Message("CEB312Message", IMPORT_MESSAGE)
    CEB411Message("CEB411Message", IMPORT_MESSAGE)
    CEB412Message("CEB412Message", IMPORT_MESSAGE)
    CEB511Message("CEB511Message", IMPORT_MESSAGE)
    CEB512Message("CEB512Message", IMPORT_MESSAGE)
    CEB513Message("CEB513Message", IMPORT_MESSAGE)
    CEB514Message("CEB514Message", IMPORT_MESSAGE)
    CEB621Message("CEB621Message", IMPORT_MESSAGE)
    CEB622Message("CEB622Message", IMPORT_MESSAGE)
    CEB623Message("CEB623Message", IMPORT_MESSAGE)
    CEB624Message("CEB624Message", IMPORT_MESSAGE)
    CEB625Message("CEB625Message", IMPORT_MESSAGE)
    CEB626Message("CEB626Message", IMPORT_MESSAGE)
    CEB711Message("CEB711Message", IMPORT_MESSAGE)
    CEB712Message("CEB712Message", IMPORT_MESSAGE)
    CEB213Message("CEB213Message", EXPORT_MESSAGE)
    CEB214Message("CEB214Message", EXPORT_MESSAGE)
    CEB215Message("CEB215Message", EXPORT_MESSAGE)
    CEB216Message("CEB216Message", EXPORT_MESSAGE)
    CEB303Message("CEB303Message", EXPORT_MESSAGE)
    CEB304Message("CEB304Message", EXPORT_MESSAGE)
    CEB403Message("CEB403Message", EXPORT_MESSAGE)
    CEB404Message("CEB404Message", EXPORT_MESSAGE)
    CEB505Message("CEB505Message", EXPORT_MESSAGE)
    CEB506Message("CEB506Message", EXPORT_MESSAGE)
    CEB507Message("CEB507Message", EXPORT_MESSAGE)
    CEB508Message("CEB508Message", EXPORT_MESSAGE)
    CEB509Message("CEB509Message", EXPORT_MESSAGE)
    CEB510Message("CEB510Message", EXPORT_MESSAGE)
    CEB603Message("CEB603Message", EXPORT_MESSAGE)
    CEB604Message("CEB604Message", EXPORT_MESSAGE)
    CEB605Message("CEB605Message", EXPORT_MESSAGE)
    CEB606Message("CEB606Message", EXPORT_MESSAGE)
    CEB607Message("CEB607Message", EXPORT_MESSAGE)
    CEB608Message("CEB608Message", EXPORT_MESSAGE)
    CEB701Message("CEB701Message", EXPORT_MESSAGE)
    CEB702Message("CEB702Message", EXPORT_MESSAGE)
    CEB792Message("CEB792Message", EXPORT_MESSAGE)
    ]
    -
    dataType enum true 报文的数据类型
    [Enum values:
    JSON()
    XML()
    ]
    -
    cebMessage object true 进口单、出口单的底层数据模型

      以CEB311Message数据类型为例

    • JSON示例



      {"order":{"orderHead":{"guid":"AFNC7T-WEASLEY-20230713095517-N04JEE","appType":"1","appTime":"20230704181028","appStatus":"2","orderType":"I","orderNo":"T_C5051511332138160010","ebpCode":"4601630004","ebpName":"海南省荣誉进出口贸易有限公司","ebcCode":"4601630004","ebcName":"海南省荣誉进出口贸易有限公司","goodsValue":"0.01","freight":"0","discount":"0","taxTotal":"0","acturalPaid":"0.01","currency":"142","buyerRegNo":"4","buyerName":"袁晓雨","buyerTelephone":"13701727375","buyerIdType":"1","buyerIdNumber":"130435200009241538","consignee":"袁晓雨","consigneeTelephone":"13701727375","consigneeAddress":"北京北京市东城区","note":"test"},"orderList":[{"gnum":1,"itemNo":"1","itemName":"LANNA兰纳","gmodel":"10片/包","itemDescribe":"","barCode":"1","unit":"011","qty":"1","price":"1","totalPrice":"1","currency":"142","country":"136","note":"test"}]},"guid":"AFNC7T-WEASLEY-20230713095517-N04JEE","version":"1.0","baseTransfer":{"copCode":"4601630004","copName":"海南省荣誉进出口贸易有限公司","dxpMode":"DXP","dxpId":"DXPENT0000530815","note":"test"}}



    • XML示例: 不带ds:Signature节点的CEBXxxMessage.xml原文;待加签xml报文样例



    -

    Request-example:

    curl -X POST -H 'Content-Type: application/json' -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/upload/CEBMessage --data '{
      "messageType": "CEB311Message",
      "dataType": "JSON",
      "cebMessage": {
        "object": "any object"
      }
    }'
    

    Response-fields:

    Field Type Description Since
    message string 返回消息 -
    success boolean 是否成功 -
    timestamp string 响应时间戳 -
    code int32 状态码 -
    data object 响应数据 -
    └─payload object 请求数据载荷 -
         └─Message object No comments found. -
              └─MessageHead object No comments found. -
                   └─MessageId string No comments found. -
                   └─MessageType string No comments found. -
                   └─SenderID string No comments found. -
                   └─ReceiverID string No comments found. -
                   └─SendTime string No comments found. -
                   └─Version string No comments found. -
              └─MessageBody object No comments found. -
                   └─data string No comments found. -
    └─original string 三方原始返回 -
    └─expected string 三方期望返回 -

    Response-example:

    {
      "message": "",
      "success": true,
      "timestamp": "",
      "code": 0,
      "data": {
        "payload": {
          "Message": {
            "MessageHead": {
              "MessageId": "",
              "MessageType": "",
              "SenderID": "",
              "ReceiverID": "",
              "SendTime": "",
              "Version": ""
            },
            "MessageBody": {
              "data": ""
            }
          }
        },
        "original": "",
        "expected": ""
      }
    }
    

    推送海关179号数据

    URL: http://localhost:8080/rpc/eport/upload/179/data

    Type: POST

    Author: weasley

    Content-Type: application/json

    Description:

      JSON示例:

      {
        "sessionID": "032C3F56-0EE6-4558-B548-6C7A3451F07D",
        "payExchangeInfoHead": {
          "guid": "E4766021-21AC-1AA2-21DD-E974DF93C11D",
          "initalRequest": "11111111202009231454212140210352500",
          "initalResponse": "50011111111202009231454212140210352202009231454265004200000681202009235085032319",
          "ebpCode": "请替换",
          "payCode": "4403169D3W",
          "payTransactionId": "4200000681202009235085032319",
          "totalAmount": 5,
          "currency": "142",
          "verDept": "3",
          "payType": "4",
          "tradingTime": "20200923145426",
          "note": ""
        },
        "payExchangeInfoLists": [
          {
            "orderNo": "202009231454218421271832",
            "goodsInfo": [
              {
                "gname": "济州花梨精华面膜",
                "itemLink": "http://m.yunjiweidian.com/yunjibuyer/static/vue-buyer/idc/index.html#/detail?itemId=999761&shopId=453"
              }
            ],
            "recpAccount": "请替换",
            "recpCode": "请替换",
            "recpName": "请替换"
          }
        ],
        "serviceTime": "1601282210417"
      }
      

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Body-parameters:

    Parameter Type Required Description Since
    sessionID string true 海关发起请求时,平台接收的会话ID -
    payExchangeInfoHead object true 支付原始数据表头 -
    └─guid string false 系统唯一序号 -
    └─initalRequest string false 原始请求 -
    └─initalResponse string false 原始响应 -
    └─ebpCode string false 电商平台代码 -
    └─payCode string false 支付企业代码 -
    └─payTransactionId string false 交易流水号(支付报关时会有返回)
    微信对应的字段是:verify_department_trade_id
    支付宝对应的字段是:pay_transaction_id
    -
    └─totalAmount double false 交易金额 -
    └─currency string false 币制(币制编码:142(人民币)) -
    └─verDept string false 验核机构(支付报关结果会返回),1-银联 2-网联 3-其他
    微信返回的字段是:verify_department
    支付宝对应的字段是:ver_dept
    -
    └─payType string false 支付类型 -
    └─tradingTime string false 交易成功时间 -
    └─note string false 备注 -
    payExchangeInfoLists array true 支付原始数据表体 -
    └─orderNo string false 订单编号 -
    └─goodsInfo array false 商品信息 -
         └─gname string false 商品名称 -
         └─itemLink string false 商品展示链接地址 -
    └─recpAccount string false 收款账号 -
    └─recpCode string false 收款企业代码 -
    └─recpName string false 收款企业名称 -
    serviceTime string true 返回时的系统时间 -

    Request-example:

    curl -X POST -H 'Content-Type: application/json' -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/upload/179/data --data '{
      "sessionID": "",
      "payExchangeInfoHead": {
        "guid": "",
        "initalRequest": "",
        "initalResponse": "",
        "ebpCode": "",
        "payCode": "",
        "payTransactionId": "",
        "totalAmount": 0.0,
        "currency": "",
        "verDept": "",
        "payType": "",
        "tradingTime": "",
        "note": ""
      },
      "payExchangeInfoLists": [
        {
          "orderNo": "",
          "goodsInfo": [
            {
              "gname": "",
              "itemLink": ""
            }
          ],
          "recpAccount": "",
          "recpCode": "",
          "recpName": ""
        }
      ],
      "serviceTime": ""
    }'
    

    Response-fields:

    Field Type Description Since
    message string 返回消息 -
    success boolean 是否成功 -
    timestamp string 响应时间戳 -
    code int32 状态码 -
    data object 响应数据 -
    └─payload object 请求数据载荷 -
         └─mapKey object A map key. -
              └─any object object any object. -
    └─original string 三方原始返回 -
    └─expected object 三方期望返回 -
         └─code string No comments found. -
         └─total int64 No comments found. -
         └─message string No comments found. -
         └─serviceTime int64 No comments found. -

    Response-example:

    {
      "message": "",
      "success": true,
      "timestamp": "",
      "code": 0,
      "data": {
        "payload": {
          "mapKey": {
            "waring": "You may use java.util.Object for Map value; smart-doc can't be handle."
          }
        },
        "original": "",
        "expected": {
          "code": "",
          "total": 0,
          "message": "",
          "serviceTime": 0
        }
      }
    }
    

    电子口岸X509证书

    下载证书

    有公司反馈x509证书导出还存在问题,先去这里导:海关179号公告对接 => ukey证书导出工具

    URL: http://localhost:8080/rpc/eport/cert/download

    Type: GET

    Author: lwj

    Content-Type: application/x-www-form-urlencoded;charset=UTF-8

    Description: 证书文件格式: 证书编号.cer, 遇到项目启动的首页下载证书出现文件名为 unknown.cer 的情况将下载链接复制到浏览器中打开

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Request-example:

    curl -X GET -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/cert/download
    

    Response-example:

    Return void.
    

    电子口岸报文加签

    海关数据加签

    URL: http://localhost:8080/rpc/eport/signature

    Type: POST

    Author: lwj

    Content-Type: application/json

    Description: 此接口已经整合"海关总署XML"和"海关179数据抓取"的加签

      支持的加签类型
    • 1. 海关CEBXxxMessage XML数据加签
    • 2. 海关179数据加签

    Request-headers:

    Header Type Required Description Since
    x-auth-token-eport-sign string true 客户端加签时携带的请求头,token值必须和配置文件里面配置鉴权token相等 v1.1.0

    Body-parameters:

    Parameter Type Required Description Since
    id int32 false 唯一id, 用来区分是哪一次发送的消息,默认值=1,从1开始,{@code int} 最大, 231-1. -
    data string true 加签源数据

      支持的加签数据类型
    • 1. 不带ds:Signature节点的CEBXxxMessage.xml原文;待加签xml报文样例

    • 2. 海关179加签数据; 数据格式请传符合「海关179数据规范」的标准字符串,入参示例:
      "sessionID":"ad2254-8hewyf32-55616249"

    Request-example:

    curl -X POST -H 'Content-Type: application/json' -H 'x-auth-token-eport-sign:DefaultAuthToken' -i http://localhost:8080/rpc/eport/signature --data '{
      "id": 0,
      "data": ""
    }'
    

    Response-fields:

    Field Type Description Since
    message string 返回消息 -
    success boolean 是否成功 -
    timestamp string 响应时间戳 -
    code int32 状态码 -
    data object 响应数据 -
    └─success boolean 本次加签是否成功 -
    └─certNo string 签名的ukey的卡序列号 -
    └─x509Certificate string 签名的ukey证书 -
    └─digestValue string XML报文的数字摘要 -
    └─signatureValue string 调用ukey获取的签名值 -
    └─signatureNode string XML报文的签名节点
  • 用来组装 ds:SignedInfo 节点
  • -

    Response-example:

    {
      "message": "",
      "success": true,
      "timestamp": "",
      "code": 0,
      "data": {
        "success": true,
        "certNo": "",
        "x509Certificate": "",
        "digestValue": "",
        "signatureValue": "",
        "signatureNode": ""
      }
    }