Skip to content

订单附加信息查询接口

商户通过订单号查询提交的订单附加信息。如果是微信收集的实名信息,查询接口不返回实名信息内容

请求参数类型描述
noncelesstrue声明请求的XML无随机字符串参数
xmlobject声明请求的XML数据结构
sign_typestring签名类型
MD5 枚举值
appidstring公众账号ID
mch_idstring商户号
out_trade_nostring商户订单号
transaction_idstring微信支付订单号
sub_order_nostring商户子订单号
sub_order_idstring微信子订单号
customsstring海关
GUANGZHOU_ZS | HANGZHOU_ZS | NINGBO | ZHENGZHOU_BS | CHONGQING | SHANGHAI_ZS | SHENZHEN | ZHENGZHOU_ZH_ZS | TIANJIN 枚举值之一
php
$instance->v2->cgiBin->mch->customs->customdeclarequery->postAsync([
  'nonceless' => true,
  'xml' => [
    'sign_type'      => 'MD5',
    'appid'          => 'wxd678efh567hg6787',
    'mch_id'         => '1230000109',
    'out_trade_no'   => '20150806125346',
    'transaction_id' => '1000320306201511078440737890',
    'sub_order_no'   => '20150806125346',
    'sub_order_id'   => '20150806125346',
    'customs'        => 'SHANGHAI',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/cgi-bin/mch/customs/customdeclarequery')->postAsync([
  'nonceless' => true,
  'xml' => [
    'sign_type'      => 'MD5',
    'appid'          => 'wxd678efh567hg6787',
    'mch_id'         => '1230000109',
    'out_trade_no'   => '20150806125346',
    'transaction_id' => '1000320306201511078440737890',
    'sub_order_no'   => '20150806125346',
    'sub_order_id'   => '20150806125346',
    'customs'        => 'SHANGHAI',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/cgi-bin/mch/customs/customdeclarequery']->postAsync([
  'nonceless' => true,
  'xml' => [
    'sign_type'      => 'MD5',
    'appid'          => 'wxd678efh567hg6787',
    'mch_id'         => '1230000109',
    'out_trade_no'   => '20150806125346',
    'transaction_id' => '1000320306201511078440737890',
    'sub_order_no'   => '20150806125346',
    'sub_order_id'   => '20150806125346',
    'customs'        => 'SHANGHAI',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->cgiBin->mch->customs->customdeclarequery->post([
  'nonceless' => true,
  'xml' => [
    'sign_type'      => 'MD5',
    'appid'          => 'wxd678efh567hg6787',
    'mch_id'         => '1230000109',
    'out_trade_no'   => '20150806125346',
    'transaction_id' => '1000320306201511078440737890',
    'sub_order_no'   => '20150806125346',
    'sub_order_id'   => '20150806125346',
    'customs'        => 'SHANGHAI',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/cgi-bin/mch/customs/customdeclarequery')->post([
  'nonceless' => true,
  'xml' => [
    'sign_type'      => 'MD5',
    'appid'          => 'wxd678efh567hg6787',
    'mch_id'         => '1230000109',
    'out_trade_no'   => '20150806125346',
    'transaction_id' => '1000320306201511078440737890',
    'sub_order_no'   => '20150806125346',
    'sub_order_id'   => '20150806125346',
    'customs'        => 'SHANGHAI',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/cgi-bin/mch/customs/customdeclarequery']->post([
  'nonceless' => true,
  'xml' => [
    'sign_type'      => 'MD5',
    'appid'          => 'wxd678efh567hg6787',
    'mch_id'         => '1230000109',
    'out_trade_no'   => '20150806125346',
    'transaction_id' => '1000320306201511078440737890',
    'sub_order_no'   => '20150806125346',
    'sub_order_id'   => '20150806125346',
    'customs'        => 'SHANGHAI',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
signstring签名
appidstring公众账号ID
mch_idstring商户号
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误代码
err_code_desstring错误代码描述
transaction_idstring微信支付订单号
countinteger笔数
sub_order_no_$nstring商户子订单号
sub_order_id_$nstring微信子订单号
mch_customs_no_$nstring商户海关备案号
customs_$nstring海关
GUANGZHOU_ZS | HANGZHOU_ZS | NINGBO | ZHENGZHOU_BS | CHONGQING | SHANGHAI_ZS | SHENZHEN | ZHENGZHOU_ZH_ZS | TIANJIN 枚举值之一
fee_type_$nstring币种
order_fee_$ninteger应付金额
duty_$ninteger关税
transport_fee_$ninteger物流费
product_fee_$ninteger商品价格
state_$nstring状态码
NDECLARED | SUBMITTED | PROCESSING | SUCCESS | FAIL | EXCEPT 枚举值之一
explanation_$nstring申报结果说明
modify_time_$nstring最后更新时间
cert_check_result_$nstring订购人和支付人身份信息校验结果
UNCHECKED | SAME | DIFFERENT 枚举值之一
verify_departmentstring验核机构注:商户需将该字段取值UNIONPAY/NETSUNION/OTHERS映射至海关verDept字段的1/2/3
UNIONPAY | NETSUNION | OTHERS 枚举值之一
verify_department_trade_idstring验核机构交易流水号

参阅 官方文档

Published on the GitHub by TheNorthMemory