文档中心 > API类目 > 天猫国际API

tmall.hk.clearance.declare.wechat (天猫国际微信支付单报关接口)

天猫国际微信支付单报关接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
wechat_pay_validate_req WechatPayValidateReq 必须 参数
  • └ transport_fee
  • Number
  • 必须
  • 100
  • 邮费,以分为单位
  • └ order_id
  • String
  • 必须
  • 2531111111111111111
  • 淘宝订单ID
  • └ customs
  • String
  • 必须
  • SHANGHAI_JG
  • 海关代码,如 SHANGHAI_JG
  • └ order_fee
  • Number
  • 必须
  • 400
  • 订单费用,以分为单位,order_fee=transport_fee+product_fee
  • └ product_fee
  • Number
  • 必须
  • 300
  • 商品费用,以分为单位
  • └ transaction_id
  • String
  • 必须
  • 43321022802025042743111111
  • 微信支付单号

响应参数

名称 类型 示例值 描述
response_msg String 参数错误 错误描述
response_code String CL_PARAM_ERROR 错误code
response_success Boolean true 接口是否请求成功过
obj WechatPaySendResult obj
  • └ request_success
  • Boolean
  • false
  • 是否成功
  • └ error_detail
  • String
  • 当code为PARAM_ERROR时返回,详细说明见下
  • 当code为PARAM_ERROR时返回,详细说明见下
  • └ error_code
  • String
  • NO_AUTH
  • errorCode
  • └ state
  • String
  • PROCESSING
  • 申报结果状态码 PROCESSING:申报中 UNDECLARED:未申报 SUBMITTED:已修改未申报 SUCCESS:申报成功 FAIL:申报失败 EXCEPT:海关接口异常 示例值:PROCESSING
  • └ error_msg
  • String
  • 商户未在当前申报的海关进行备案
  • 错误描述

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallHkClearanceDeclareWechatRequest req = new TmallHkClearanceDeclareWechatRequest();
TmallHkClearanceDeclareWechatRequest.WechatPayValidateReq obj1 = new TmallHkClearanceDeclareWechatRequest.WechatPayValidateReq();
obj1.setTransportFee(100L);
obj1.setOrderId("2531111111111111111");
obj1.setCustoms("SHANGHAI_JG");
obj1.setOrderFee(400L);
obj1.setProductFee(300L);
obj1.setTransactionId("43321022802025042743111111");
req.setWechatPayValidateReq(obj1);
TmallHkClearanceDeclareWechatResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<tmall_hk_clearance_declare_wechat_response>
    <response_msg>参数错误</response_msg>
    <response_code>CL_PARAM_ERROR</response_code>
    <response_success>true</response_success>
    <obj>
        <request_success>false</request_success>
        <error_detail>当code为PARAM_ERROR时返回,详细说明见下</error_detail>
        <error_code>NO_AUTH</error_code>
        <state>PROCESSING</state>
        <error_msg>商户未在当前申报的海关进行备案</error_msg>
    </obj>
</tmall_hk_clearance_declare_wechat_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部