查询代金券信息
🎃
本接口服务已于 2020年
(北京时间)处于流放状态,新接口见这里,此文档仅做留存参考。
请求参数 | 类型 | 描述 |
---|---|---|
xml | object | 声明请求的XML 数据结构 |
coupon_id | string | 代金券id |
openid | string | 用户openid |
appid | string | 公众账号ID |
mch_id | string | 商户号 |
stock_id | string | 批次号 |
op_user_id | string | 操作员 |
device_info | string | 设备号 |
version | string | 协议版本1.0 枚举值 |
type | string | 协议类型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_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
return_msg | string | 返回信息 |
appid | string | 公众账号ID |
mch_id | string | 商户号 |
sub_mch_id | string | 子商户号 |
device_info | string | 设备号 |
nonce_str | string | 随机字符串 |
sign | string | 签名 |
result_code | string | 业务结果SUCCESS | FAIL 枚举值之一 |
err_code | string | 错误代码 |
err_code_des | string | 错误代码描述 |
coupon_stock_id | string | 代金券批次ID |
coupon_id | string | 代金券id |
coupon_value | integer | 代金券面额 |
coupon_mininumn | integer | 代金券使用最低限额 |
coupon_name | string | 代金券名称 |
coupon_state | string | 代金券状态SENDED | USED | EXPIRED 枚举值之一 |
coupon_desc | string | 代金券描述 |
coupon_use_value | integer | 代金券实际使用金额 |
coupon_remain_value | integer | 优惠剩余可用额 |
send_source | string | 发放来源FULL_SEND | NORMAL 枚举值之一 |
is_partial_use | string | 是否允许部分使用1 枚举值 |
参阅 官方文档