Skip to content

合单查单

所有微信支付订单的查询,商户可以通过查询订单接口主动查询订单状态,完成下一步的业务逻辑。**合单查单api只能使用合单单号combine_out_trade_no来查询,如果要使用子订单号查询,请使用公众api中的查单接口。**

请求参数类型描述
xmlobject声明请求的XML数据结构
combine_appidstring合单appid
combine_mch_idstring合单商户号
sign_typestring签名类型
HMAC-SHA256 枚举值
combine_out_trade_nostring合单商户订单号
php
$instance->v2->pay->querycombinedorder->postAsync([
  'xml' => [
    'combine_appid'        => 'wx8888888888888888',
    'combine_mch_id'       => '1900000109',
    'sign_type'            => 'HMAC-SHA256',
    'combine_out_trade_no' => '1217752501201407033233368018',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/pay/querycombinedorder')->postAsync([
  'xml' => [
    'combine_appid'        => 'wx8888888888888888',
    'combine_mch_id'       => '1900000109',
    'sign_type'            => 'HMAC-SHA256',
    'combine_out_trade_no' => '1217752501201407033233368018',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/pay/querycombinedorder']->postAsync([
  'xml' => [
    'combine_appid'        => 'wx8888888888888888',
    'combine_mch_id'       => '1900000109',
    'sign_type'            => 'HMAC-SHA256',
    'combine_out_trade_no' => '1217752501201407033233368018',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->pay->querycombinedorder->post([
  'xml' => [
    'combine_appid'        => 'wx8888888888888888',
    'combine_mch_id'       => '1900000109',
    'sign_type'            => 'HMAC-SHA256',
    'combine_out_trade_no' => '1217752501201407033233368018',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/pay/querycombinedorder')->post([
  'xml' => [
    'combine_appid'        => 'wx8888888888888888',
    'combine_mch_id'       => '1900000109',
    'sign_type'            => 'HMAC-SHA256',
    'combine_out_trade_no' => '1217752501201407033233368018',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/pay/querycombinedorder']->post([
  'xml' => [
    'combine_appid'        => 'wx8888888888888888',
    'combine_mch_id'       => '1900000109',
    'sign_type'            => 'HMAC-SHA256',
    'combine_out_trade_no' => '1217752501201407033233368018',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
combine_appidstring合单appid
combine_mch_idstring合单商户号
nonce_strstring随机字符串
device_infostring设备号
combine_openidstring合单用户标识
combine_out_trade_nostring合单商户订单号
signstring签名
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
result_msgstring业务结果描述
trade_statestring交易状态
SUCCESS | REFUND | NOTPAY | CLOSED | REVOKED | USERPAYING | PAYERROR | ACCEPT 枚举值之一
trade_state_descstring交易状态描述
err_codestring错误代码
err_code_desstring错误代码描述
scene_infostring场景信息JSON格式字符串
device_idstring商户端设备号
sub_order_liststring子单信息JSON格式字符串
order_numnumber子订单数
order_listobject[]子订单信息
mchidstring子单商户号
trade_typestring交易类型
NATIVE | JSAPI | APP | MWEB 枚举值之一
attachstring附加数据
amountobject订单金额
total_amountnumber标价金额
currencystring标价币种
transaction_idstring微信订单号
out_trade_nostring子单商户订单号
goods_tagstring订单优惠标记
descriptionstring商品描述
promotion_detailobject营销详情
promotion_idstring券ID
namestring优惠名称
scopestring优惠范围
GLOBAL | SINGLE 枚举值之一
typestring优惠类型
COUPON | DISCOUNT 枚举值之一
amountstring优惠券面额
activity_idstring活动ID
wxpay_contributestring微信出资
merchant_contributestring商户出资
other_contributestring其他出资
goods_detailobject[]单品列表
goods_idstring商品编码
wxpay_goods_idstring微信支付商品编码
goods_namestring商品名称
quantitynumber商品数量
pricenumber商品单价

参阅 官方合单支付文档

Published on the GitHub by TheNorthMemory