提交、修改及查询报关信息(可用版本) 
报关 
该接口用于商户提交海关需要的订单附加信息。
🔰
本接口服务已于 2022.09.08 (北京时间)发布新版,新接口见这里,此文档仅做留存参考。
| 请求参数 | 类型 | 描述 | 
|---|---|---|
| base_uri | string | 声明接入点https://apihk.mch.weixin.qq.com/global/(香港接入) | 
| json | object | 声明请求的JSON数据结构 | 
| appid | string | 机构APPID | 
| mchid | string | 商户号 | 
| out_trade_no | string | 商户订单号 | 
| transaction_id | string | 微信订单号 | 
| customs | string | 海关GUANGZHOU_ZS | HANGZHOU_ZS | NINGBO | ZHENGZHOU_BS | CHONGQING | SHANGHAI_ZS | SHENZHEN | ZHENGZHOU_ZH_ZS | TIANJIN 枚举值之一 | 
| merchant_customs_no | string | 商户海关备案号 | 
| duty | integer | 关税 | 
| sub_order_no | string | 商户子订单号 | 
| fee_type | string | 货币类型 | 
| order_fee | integer | 子订单金额 | 
| transport_fee | integer | 物流费用 | 
| product_fee | integer | 商品费用 | 
php
$instance->v3->customs->orders->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'sub_order_no'        => '20150806125346',
    'fee_type'            => 'CNY',
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/customs/orders')->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'sub_order_no'        => '20150806125346',
    'fee_type'            => 'CNY',
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/customs/orders']->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'sub_order_no'        => '20150806125346',
    'fee_type'            => 'CNY',
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->customs->orders->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'sub_order_no'        => '20150806125346',
    'fee_type'            => 'CNY',
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/customs/orders')->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'sub_order_no'        => '20150806125346',
    'fee_type'            => 'CNY',
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/customs/orders']->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'sub_order_no'        => '20150806125346',
    'fee_type'            => 'CNY',
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 | 
|---|---|---|
| appid | string | 机构APPID | 
| mchid | string | 商户号 | 
| state | string | 报关状态PROCESSING | UNDECLARED | SUBMITTED | SUCCESS | FAIL | EXCEPT 枚举值之一 | 
| out_trade_no | string | 商户订单号 | 
| transaction_id | string | 微信订单号 | 
| sub_order_no | string | 商户子订单号 | 
| sub_order_id | string | 微信子订单号 | 
| verify_department | string | 核验机构UNIONPAY | NETSUNION | OTHERS 枚举值之一 | 
| verify_department_trade_id | string | 核验机构交易流水号 | 
参阅 官方文档
报关查询 
商户通过订单号查询提交的订单附加信息及订单报关状态。
🔰
本接口服务已于 2022.09.08 (北京时间)发布新版,新接口见这里,此文档仅做留存参考。
| 请求参数 | 类型 | 描述 | 
|---|---|---|
| base_uri | string | 声明接入点https://apihk.mch.weixin.qq.com/global/(香港接入) | 
| query | object | 声明请求的查询参数 | 
| appid | string | 机构APPID | 
| mchid | string | 商户号 | 
| order_type | string | 订单类型out_trade_no | transaction_id | sub_order_no | sub_order_id 枚举值之一 | 
| order_no | string | 订单号 | 
| customs | string | 海关GUANGZHOU_ZS | HANGZHOU_ZS | NINGBO | ZHENGZHOU_BS | CHONGQING | SHANGHAI_ZS | SHENZHEN | ZHENGZHOU_ZH_ZS | TIANJIN 枚举值之一 | 
| offset | integer | 偏移量 | 
| limit | integer | 请求最大记录条数 | 
php
$instance->v3->customs->orders->getAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'query' => [
    'appid'      => 'wxd678efh567hg6787',
    'mchid'      => '1230000109',
    'order_type' => 'out_trade_no',
    'order_no'   => '20150806125346',
    'customs'    => 'SHANGHAI_ZS',
    'offset'     => 1,
    'limit'      => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/customs/orders')->getAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'query' => [
    'appid'      => 'wxd678efh567hg6787',
    'mchid'      => '1230000109',
    'order_type' => 'out_trade_no',
    'order_no'   => '20150806125346',
    'customs'    => 'SHANGHAI_ZS',
    'offset'     => 1,
    'limit'      => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/customs/orders']->getAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'query' => [
    'appid'      => 'wxd678efh567hg6787',
    'mchid'      => '1230000109',
    'order_type' => 'out_trade_no',
    'order_no'   => '20150806125346',
    'customs'    => 'SHANGHAI_ZS',
    'offset'     => 1,
    'limit'      => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->customs->orders->get([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'query' => [
    'appid'      => 'wxd678efh567hg6787',
    'mchid'      => '1230000109',
    'order_type' => 'out_trade_no',
    'order_no'   => '20150806125346',
    'customs'    => 'SHANGHAI_ZS',
    'offset'     => 1,
    'limit'      => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/customs/orders')->get([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'query' => [
    'appid'      => 'wxd678efh567hg6787',
    'mchid'      => '1230000109',
    'order_type' => 'out_trade_no',
    'order_no'   => '20150806125346',
    'customs'    => 'SHANGHAI_ZS',
    'offset'     => 1,
    'limit'      => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/customs/orders']->get([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'query' => [
    'appid'      => 'wxd678efh567hg6787',
    'mchid'      => '1230000109',
    'order_type' => 'out_trade_no',
    'order_no'   => '20150806125346',
    'customs'    => 'SHANGHAI_ZS',
    'offset'     => 1,
    'limit'      => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 | 
|---|---|---|
| appid | string | 机构APPID | 
| mchid | string | 商户号 | 
| transaction_id | string | 微信订单号 | 
| verify_department | string | 核验机构UNIONPAY | NETSUNION | OTHERS 枚举值之一 | 
| verify_department_trade_id | string | 核验机构流水号 | 
| offset | integer | 偏移量 | 
| limit | integer | 请求最大记录条数 | 
| total_count | integer | 查询结果总条数 | 
| data | object[] | 报关数据包 | 
| sub_order_no | string | 商户子单号 | 
| sub_order_id | string | 微信子单号 | 
| mch_customs_no | string | 商户海关备案号 | 
| customs | string | 海关代码GUANGZHOU_ZS | HANGZHOU_ZS | NINGBO | ZHENGZHOU_BS | CHONGQING | SHANGHAI_ZS | SHENZHEN | ZHENGZHOU_ZH_ZS | TIANJIN 枚举值之一 | 
| fee_type | string | 币种 | 
| order_fee | integer | 子单金额 | 
| duty | integer | 关税 | 
| transport_fee | integer | 物流费用 | 
| product_fee | integer | 商品费用 | 
| state | string | 报关状态PROCESSING | UNDECLARED | SUBMITTED | SUCCESS | FAIL | EXCEPT 枚举值之一 | 
| explanation | string | 报关结果说明 | 
| modify_time | string | 最后更新时间 | 
参阅 官方文档
报关信息修改 
该接口用于商户修改订单附加信息。
🔰
本接口服务已于 2022.09.08 (北京时间)发布新版,新接口见这里,此文档仅做留存参考。
| 请求参数 | 类型 | 描述 | 
|---|---|---|
| base_uri | string | 声明接入点https://apihk.mch.weixin.qq.com/global/(香港接入) | 
| json | object | 声明请求的JSON数据结构 | 
| appid | string | 机构APPID | 
| mchid | string | 商户号 | 
| out_trade_no | string | 商户订单号 | 
| transaction_id | string | 微信订单号 | 
| sub_order_no | string | 商户子订单号 | 
| customs | string | 海关编码GUANGZHOU_ZS | HANGZHOU_ZS | NINGBO | ZHENGZHOU_BS | CHONGQING | SHANGHAI_ZS | SHENZHEN | ZHENGZHOU_ZH_ZS | TIANJIN 枚举值之一 | 
| merchant_customs_no | string | 商户海关备案号 | 
| duty | integer | 关税 | 
| order_fee | integer | 子订单金额 | 
| transport_fee | integer | 物流费用 | 
| product_fee | integer | 商品费用 | 
php
$instance->v3->customs->orders->patchAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'sub_order_no'        => '20150806125346',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/customs/orders')->patchAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'sub_order_no'        => '20150806125346',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/customs/orders']->patchAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'sub_order_no'        => '20150806125346',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->customs->orders->patch([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'sub_order_no'        => '20150806125346',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/customs/orders')->patch([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'sub_order_no'        => '20150806125346',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/customs/orders']->patch([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/global/', // 接入点(香港接入)
  'json' => [
    'appid'               => 'wxd678efh567hg6787',
    'mchid'               => '1230000109',
    'out_trade_no'        => '20150806125346',
    'transaction_id'      => '1000320306201511078440737890',
    'sub_order_no'        => '20150806125346',
    'customs'             => 'SHANGHAI_ZS',
    'merchant_customs_no' => '123456',
    'duty'                => 888,
    'order_fee'           => 888,
    'transport_fee'       => 888,
    'product_fee'         => 888,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 | 
|---|---|---|
| appid | string | 机构APPID | 
| mchid | string | 商户号 | 
| state | string | 报关状态PROCESSING | UNDECLARED | SUBMITTED | SUCCESS | FAIL | EXCEPT 枚举值之一 | 
| out_trade_no | string | 商户订单号 | 
| transaction_id | string | 微信订单号 | 
| sub_order_no | string | 商户子订单号 | 
| sub_order_id | string | 微信子订单号 | 
| modify_time | string | 最后更新时间 | 
| verify_department | string | 核验机构UNIONPAY | NETSUNION | OTHERS 枚举值之一 | 
| verify_department_trade_id | string | 核验机构流水号 | 
参阅 官方文档