Skip to content

查询代金券信息

🎃

本接口服务已于 2020年 (北京时间)处于流放状态,新接口见这里,此文档仅做留存参考。

请求参数类型描述
xmlobject声明请求的XML数据结构
coupon_idstring代金券id
openidstring用户openid
appidstring公众账号ID
mch_idstring商户号
stock_idstring批次号
op_user_idstring操作员
device_infostring设备号
versionstring协议版本
1.0 枚举值
typestring协议类型
XML 枚举值
php
$instance->v2->mmpaymkttransfers->querycouponsinfo->postAsync([
  'xml' => [
    'coupon_id'   => '1565',
    'openid'      => 'onqOjjrXT-776SpHnfexGm1_P7iE',
    'appid'       => 'wx5edab3bdfba3dc1c',
    'mch_id'      => '10000098',
    'stock_id'    => '58818',
    'op_user_id'  => '10000098',
    'device_info' => '013467007045764',
    'version'     => '1.0',
    'type'        => 'XML',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/mmpaymkttransfers/querycouponsinfo')->postAsync([
  'xml' => [
    'coupon_id'   => '1565',
    'openid'      => 'onqOjjrXT-776SpHnfexGm1_P7iE',
    'appid'       => 'wx5edab3bdfba3dc1c',
    'mch_id'      => '10000098',
    'stock_id'    => '58818',
    'op_user_id'  => '10000098',
    'device_info' => '013467007045764',
    'version'     => '1.0',
    'type'        => 'XML',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/mmpaymkttransfers/querycouponsinfo']->postAsync([
  'xml' => [
    'coupon_id'   => '1565',
    'openid'      => 'onqOjjrXT-776SpHnfexGm1_P7iE',
    'appid'       => 'wx5edab3bdfba3dc1c',
    'mch_id'      => '10000098',
    'stock_id'    => '58818',
    'op_user_id'  => '10000098',
    'device_info' => '013467007045764',
    'version'     => '1.0',
    'type'        => 'XML',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->mmpaymkttransfers->querycouponsinfo->post([
  'xml' => [
    'coupon_id'   => '1565',
    'openid'      => 'onqOjjrXT-776SpHnfexGm1_P7iE',
    'appid'       => 'wx5edab3bdfba3dc1c',
    'mch_id'      => '10000098',
    'stock_id'    => '58818',
    'op_user_id'  => '10000098',
    'device_info' => '013467007045764',
    'version'     => '1.0',
    'type'        => 'XML',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/mmpaymkttransfers/querycouponsinfo')->post([
  'xml' => [
    'coupon_id'   => '1565',
    'openid'      => 'onqOjjrXT-776SpHnfexGm1_P7iE',
    'appid'       => 'wx5edab3bdfba3dc1c',
    'mch_id'      => '10000098',
    'stock_id'    => '58818',
    'op_user_id'  => '10000098',
    'device_info' => '013467007045764',
    'version'     => '1.0',
    'type'        => 'XML',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/mmpaymkttransfers/querycouponsinfo']->post([
  'xml' => [
    'coupon_id'   => '1565',
    'openid'      => 'onqOjjrXT-776SpHnfexGm1_P7iE',
    'appid'       => 'wx5edab3bdfba3dc1c',
    'mch_id'      => '10000098',
    'stock_id'    => '58818',
    'op_user_id'  => '10000098',
    'device_info' => '013467007045764',
    'version'     => '1.0',
    'type'        => 'XML',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
appidstring公众账号ID
mch_idstring商户号
sub_mch_idstring子商户号
device_infostring设备号
nonce_strstring随机字符串
signstring签名
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误代码
err_code_desstring错误代码描述
coupon_stock_idstring代金券批次ID
coupon_idstring代金券id
coupon_valueinteger代金券面额
coupon_mininumninteger代金券使用最低限额
coupon_namestring代金券名称
coupon_statestring代金券状态
SENDED | USED | EXPIRED 枚举值之一
coupon_descstring代金券描述
coupon_use_valueinteger代金券实际使用金额
coupon_remain_valueinteger优惠剩余可用额
send_sourcestring发放来源
FULL_SEND | NORMAL 枚举值之一
is_partial_usestring是否允许部分使用
1 枚举值

参阅 官方文档

Published on the GitHub by TheNorthMemory