公用接口-报关

接口描述

提供给商户跨境支付海关报关的功能

流程图

基本信息

测试请求地址 https://cbtrxtest.helipay.com/cbtrx/rest/applyCustoms/apply
请求地址 https://cbptrx.helipay.com/cbtrx/rest/applyCustoms/apply
提交方式 采用POST方法提交,requestbody传值 Content-Type=[application/json;charset=UTF-8]
签名算法 UTF-8字符编码 SHA256签名 AES加密

请求参数

名称 参数 类型 必填 示例值 说明
产品编码 productCode String(20) APPLYCUSTOMS
商户订单号 orderNo String(64) p_20170302185347 报关请求号,每笔报关请求唯一,商户自定义
商户编号 merchantNo String(10) Me10000002 合利宝-跨境系统分配的商户编号
支付产品编码 payProductCode String(20) ALIPAYSCAN 商户请求[网银,快捷,扫码,会员支付等接口]的 productCode 字段
原始订单号 payOrderNo String(64) p_20170202185447 商户请求[网银,快捷,扫码,会员支付等接口]的 orderNo 字段
订购人 payerName String(15) 张三
订购人身份证 idCardNo String(15) 123456789012345678
订购人手机号 phone String(15) 18810987654
下单ip orderIp String(15) 1.1.1.1
回调地址 callbackUrl Strin(300) http://www.456.com
报关明细 detailList List 详见下面说明 同一关口有多个商品需要报关,只需写一条明细

报关明细(海关通道和国检通道的组合不能重复)

名称 参数 类型 必填 示例值 说明
排序参数 index Integer
商品名称 goodsName String(400) 奶粉
商品数量 goodsNum Integer 2
商品单价 goodsItemAmount Number(10.2) 50.00 单位:元
支付金额 orderAmount Number(10.2) 125.00 单位:元;-1<=支付金额+折扣金额-(货款+税款+运费)<=1;支付金额不能大于原订单金额
折扣金额 discountAmount Number(10.2) 0.98 单位:元
支付货款 goodsAmount Number(10.2) 100.00 单位:元
支付运费 freight Number(10.2) 20.00 单位:元
支付税款 tax Number(10.2) 5.00 单位:元
海关通道 customsType String(20) GUANGZHOU 前往附录查看《海关国检编码》
海关企业备案号 merchantCommerceCode String(50) C123456789 报关企业在报关平台的备案号
海关企业备案名称 merchantCommerceName String(200) 报关企业 报关企业在海关的备案名称
国检通道 inspectionType String(20) GUANGZHOUNS GUANGZHOUNS-广州南沙;目前支持广州南沙国检
国检企业备案号 merchantInspectionCode String(50) C123456789 报关企业在国检平台的备案号,国检通道不为空时必录
国检企业备案名称 merchantInspectionName String(200) 报关企业 报关企业在国检的备案名称
备注 summary String(200)
拆单订单号 splitOrderNo String(64)

响应参数

名称 参数 类型 必填 示例值 说明
产品编码 productCode String(20) APPLYCUSTOMS
商户订单号 orderNo String(64) p_20170302185347
商户编号 merchantNo String(10) Me10000002 合利宝-跨境系统分配的商户编号
支付产品编码 payProductCode String(20) ONLINEB2B 报关订单对应的实际支付订单的产品编码
原始订单号 payOrderNo String(64) p_20170202185447 商户原交易订单的商户订单号(请求合利宝的订单号)
响应码 errorCode String(10) 0000 0000 代表请求成功
响应信息 errorMessage String(200) 成功 响应信息 错误信息
响应时间 current String(20) 2018-04-01 12:00:00 格式yyyy-MM-dd HH:mm:ss
报关明细 detailList List 详见下面说明 不同的海关国检的情况

报关明细(详细信息)

名称 参数 类型 必填 示例值 说明
海关通道 customsType String(20) GUANGZHOU
国检通道 inspectionType String(20)
平台流水号 serialNumber String(32) 201702241400010002 合利宝-跨境系统生成的唯一交易流水号
下单时间 createDate String(20) 2018-04-01 12:00:00 格式yyyy-MM-dd HH:mm:ss
完成时间 finishDate String(20) 2018-04-01 12:00:00 格式yyyy-MM-dd HH:mm:ss
订单状态 orderStatus String(20) INIT INIT: 待报送(实名认证及扣费成功); FAIL: 失败(实名认证失败); CUSTOMSSEND: 海关已报国检无须报; CUSSENDINSNO: 海关已报国检待报; CUSSENDINSSEND: 海关已报国检已报; PUSHAPPLYBLOCK: 风控阻断; CANCELED: 取消;
支付金额 orderAmount Number(10.2) 125.00 单位:元
折扣金额 discountAmount Number(10.2) 0.98 单位:元
支付货款 goodsAmount Number(10.2) 100.00 单位:元
支付运费 freight Number(10.2) 20.00 单位:元
支付税款 tax Number(10.2) 5.00 单位:元
拆单支付单号 splitPaySerialNumber String(64)
排序参数 index Integer 1

代码示例

        @Test
        public void applyCustoms() {
        RemoteServiceImpl remoteService = new RemoteServiceImpl();
        HeliRequest heliRequest = remoteService.postRemoteInvoke(LoadPropertiesUtils.getProperty("applyCustomsUrl"),
        installDto(), HeliRequest.class);
        ApplycustomsResponseForm form = decode(heliRequest,
        ApplycustomsResponseForm.class,heliRequest.getProductCode(),heliRequest.getMerchantNo());
        logger.info("#####解密后的内容为{}", form.toString());
        }

        public static String installDto() {
        ApplycustomsRequestForm applycustomsRequestForm = new ApplycustomsRequestForm();
        applycustomsRequestForm.setMerchantNo(LoadPropertiesUtils.getProperty("merchantNo"));
        applycustomsRequestForm.setProductCode(ProductEnumType.APPLYCUSTOMS.name());
        applycustomsRequestForm.setOrderNo("APPLYCUSTOMS304530011523456");
        applycustomsRequestForm.setPayProductCode(ProductEnumType.ALIPAYSCAN.name());
        applycustomsRequestForm.setPayOrderNo("ALIPAYSCAN061502");

        //报关明细请求参数:
        List detailList = new ArrayList<>();
        //报关明细请求参数1(录入国检):
        ApplycustomsRequestDetail applycustomsRequestDetail = new ApplycustomsRequestDetail();
        //必填项
        //排序参数不为空
        applycustomsRequestDetail.setIndex(1);
        //商品名称不为空
        applycustomsRequestDetail.setGoodsName("苹果");
        //商品数量不为空
        applycustomsRequestDetail.setGoodsNum(1);
        //商品单价不为空
        applycustomsRequestDetail.setGoodsItemAmount(new BigDecimal("1"));
        applycustomsRequestDetail.setOrderAmount(new BigDecimal("0.5"));
        //支付运费不为空
        applycustomsRequestDetail.setFreight(new BigDecimal("0.1"));
        //支付货款不为空
        applycustomsRequestDetail.setGoodsAmount(new BigDecimal("0.2"));
        //折扣金额 若有,需要传递
        applycustomsRequestDetail.setGoodsAmount(new BigDecimal("0.2"));
        //支付税款不为空
        applycustomsRequestDetail.setTax(new BigDecimal("0.2"));
        //海关通道不为空
        applycustomsRequestDetail.setCustomsType("HANGZHOU");
        //海关企业备案号不为空
        applycustomsRequestDetail.setMerchantCommerceCode("");
        //海关企业备案名称不为空
        applycustomsRequestDetail.setMerchantCommerceName("");
        //选填项
        //国检通道
        applycustomsRequestDetail.setInspectionType("");
        //国检企业备案号
        applycustomsRequestDetail.setMerchantInspectionCode("");
        //国检企业备案名称
        applycustomsRequestDetail.setMerchantInspectionName("");
        //备注
        applycustomsRequestDetail.setSummary("需要国检");


        //报关明细请求参数2(不录入国检):
        ApplycustomsRequestDetail applycustomsRequestDetail1 = new ApplycustomsRequestDetail();
        //必填项
        applycustomsRequestDetail1.setGoodsName("IPHONE");
        //排序参数不为空
        applycustomsRequestDetail1.setIndex(2);
        //商品数量不为空
        applycustomsRequestDetail1.setGoodsNum(1);
        //商品单价不为空
        applycustomsRequestDetail1.setGoodsItemAmount(new BigDecimal("1"));
        applycustomsRequestDetail1.setOrderAmount(new BigDecimal("0.5"));
        //支付运费不为空
        applycustomsRequestDetail1.setFreight(new BigDecimal("0.2"));
        //支付货款不为空
        applycustomsRequestDetail1.setGoodsAmount(new BigDecimal("0.2"));
        //支付税款不为空
        applycustomsRequestDetail1.setTax(new BigDecimal("0.1"));
        //海关通道不为空
        applycustomsRequestDetail1.setCustomsType("NINGBO");
        //海关企业备案号不为空
        applycustomsRequestDetail1.setMerchantCommerceCode("");
        //海关企业备案名称不为空
        applycustomsRequestDetail1.setMerchantCommerceName("");
        //选填项
        //国检通道
        applycustomsRequestDetail.setInspectionType("");
        //国检企业备案号
        applycustomsRequestDetail.setMerchantInspectionCode("");
        //国检企业备案名称
        applycustomsRequestDetail.setMerchantInspectionName("");
        //备注
        applycustomsRequestDetail.setSummary("");
        //拆单订单号
        applycustomsRequestDetail.setSplitOrderNo(System.currentTimeMillis() + "");

        detailList.add(applycustomsRequestDetail);
        detailList.add(applycustomsRequestDetail1);
        applycustomsRequestForm.setDetailList(detailList);
        //选填项
        applycustomsRequestForm.setOrderIp("127.0.0.1");
        applycustomsRequestForm.setCallbackUrl("www.baidu.com");
        return
        JSONObject.toJSONString(encodeAndSign(applycustomsRequestForm,applycustomsRequestForm.getProductCode(),applycustomsRequestForm.getMerchantNo()));
        }
        

        

        

错误码

错误码 错误码描述 解决方案