Skip to content

查询用户商品券详情

品牌方可以通过本接口查询已经发放给用户的商品券详情 前置条件:已经给用户发券成功

请求参数类型描述
openidstring用户OpenID
coupon_codestring用户商品券Code
queryobject声明请求的查询参数
brand_idstring品牌ID
product_coupon_idstring商品券ID
stock_idstring批次ID
appidstring公众账号AppID
php
$instance->v3->marketing->partner->productCoupon->users->_openid_->coupons->_coupon_code_->getAsync([
  'openid' => 'oh-394z-6CGkNoJrsDLTTUKiAnp4',
  'coupon_code' => '123446565767',
  'query' => [
    'brand_id'          => '120344',
    'product_coupon_id' => '1000000013',
    'stock_id'          => '1000000013001',
    'appid'             => 'wx233544546545989',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/partner/product-coupon/users/{openid}/coupons/{coupon_code}')->getAsync([
  'openid' => 'oh-394z-6CGkNoJrsDLTTUKiAnp4',
  'coupon_code' => '123446565767',
  'query' => [
    'brand_id'          => '120344',
    'product_coupon_id' => '1000000013',
    'stock_id'          => '1000000013001',
    'appid'             => 'wx233544546545989',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/partner/product-coupon/users/{openid}/coupons/{coupon_code}']->getAsync([
  'openid' => 'oh-394z-6CGkNoJrsDLTTUKiAnp4',
  'coupon_code' => '123446565767',
  'query' => [
    'brand_id'          => '120344',
    'product_coupon_id' => '1000000013',
    'stock_id'          => '1000000013001',
    'appid'             => 'wx233544546545989',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->partner->productCoupon->users->_openid_->coupons->_coupon_code_->get([
  'openid' => 'oh-394z-6CGkNoJrsDLTTUKiAnp4',
  'coupon_code' => '123446565767',
  'query' => [
    'brand_id'          => '120344',
    'product_coupon_id' => '1000000013',
    'stock_id'          => '1000000013001',
    'appid'             => 'wx233544546545989',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/partner/product-coupon/users/{openid}/coupons/{coupon_code}')->get([
  'openid' => 'oh-394z-6CGkNoJrsDLTTUKiAnp4',
  'coupon_code' => '123446565767',
  'query' => [
    'brand_id'          => '120344',
    'product_coupon_id' => '1000000013',
    'stock_id'          => '1000000013001',
    'appid'             => 'wx233544546545989',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/partner/product-coupon/users/{openid}/coupons/{coupon_code}']->get([
  'openid' => 'oh-394z-6CGkNoJrsDLTTUKiAnp4',
  'coupon_code' => '123446565767',
  'query' => [
    'brand_id'          => '120344',
    'product_coupon_id' => '1000000013',
    'stock_id'          => '1000000013001',
    'appid'             => 'wx233544546545989',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
coupon_codestring用户商品券Code
coupon_statestring用户商品券状态
CONFIRMING | PENDING | EFFECTIVE | USED | EXPIRED | DELETED | DEACTIVATED 枚举值之一
valid_begin_timestring有效期开始时间
valid_end_timestring有效期结束时间
receive_timestring领券时间
send_request_nostring发券请求单号
send_channelstring发券渠道
API | BRAND_MANAGE | MERCHANT_CARD | MEMBER | SMALL_ACTIVITY 枚举值之一
confirm_request_nostring确认请求单号
confirm_timestring确认发放时间
deactivate_request_nostring失效请求单号
deactivate_timestring失效时间
deactivate_reasonstring失效原因
single_usage_detailobject单券使用详情
use_request_nostring券核销请求单号
use_timestring核销时间
associated_order_infoobject关联微信支付订单信息
transaction_idstring微信支付单号
out_trade_nostring商户订单号
mchidstring商户号
sub_mchidstring子商户号
return_request_nostring退券请求单号
return_timestring退券时间
sequential_usage_detailobject多次优惠使用详情
total_countinteger总可使用次数
used_countinteger已使用次数
detail_item_listobject[]轮次使用详情列表
detail_statestring轮次使用详情状态
PENDING | EFFECTIVE | USED | EXPIRED | DELETED | DEACTIVATED 枚举值之一
valid_begin_timestring有效期开始时间
valid_end_timestring有效期结束时间
use_request_nostring核销请求单号
use_timestring核销时间
associated_order_infoobject关联微信支付订单信息
transaction_idstring微信支付单号
out_trade_nostring商户订单号
mchidstring商户号
sub_mchidstring子商户号
return_request_nostring退券请求单号
return_timestring退券时间
delete_timestring删除时间
product_couponobject商品券信息
product_coupon_idstring商品券ID
statestring商品券状态
AUDITING | EFFECTIVE | DEACTIVATED 枚举值之一
brand_idstring品牌ID
scopestring优惠范围
ALL | SINGLE 枚举值之一
typestring商品券类型
NORMAL | DISCOUNT | EXCHANGE 枚举值之一
usage_modestring使用模式
SINGLE | SEQUENTIAL 枚举值之一
single_usage_infoobject单券模式信息
normal_couponobject满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_couponobject折扣券使用规则
thresholdinteger门槛金额
percent_offinteger固定减免百分比
sequential_usage_infoobject多次优惠模式信息
typestring多次优惠规则类型
INCREMENTAL | EQUAL 枚举值之一
countinteger可使用次数
available_daysinteger多次优惠有效天数
interval_daysinteger多次优惠使用间隔天数
display_infoobject展示信息
namestring商品券名称
image_urlstring商品券图片
background_urlstring商品券背景图
detail_image_url_liststring[]商品券详情图列表
original_priceinteger商品原价
combo_package_listobject[]套餐组合
namestring套餐名
pick_countinteger可选单品数量
choice_listobject[]单品列表
namestring单品名称
priceinteger单品价格
countinteger单品数量
image_urlstring单品图片
mini_program_appidstring单品跳转小程序AppID
mini_program_pathstring单品跳转小程序路径
out_product_nostring外部商品ID
deactivate_request_nostring失效请求单号
deactivate_timestring失效时间
deactivate_reasonstring失效原因
stockobject批次信息
product_coupon_idstring商品券ID
stock_idstring批次ID
remarkstring备注
coupon_code_modestring券Code分配模式
WECHATPAY | UPLOAD | API_ASSIGN 枚举值之一
coupon_code_count_infoobject品牌方预上传的券Code数量信息
total_countinteger已上传的Code总数
available_countinteger当前可用的Code
stock_send_ruleobject发放规则
max_countinteger发放次数总上限
max_count_per_dayinteger每日发放次数上限
max_count_per_userinteger每个用户领取次数上限
single_usage_ruleobject单券使用规则
coupon_available_periodobject券可核销时间
available_begin_timestring开始时间
available_end_timestring结束时间
available_daysinteger生效后N天内有效
wait_days_after_receiveinteger领取后N天开始生效
weekly_available_periodobject每周固定可用时间
day_liststring[]每周可用星期数
MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一
day_period_listobject[]当天可用时间段
begin_timeinteger当天可用开始时间
end_timeinteger当天可用结束时间
irregular_available_period_listobject[]无规律的可用时间段
begin_timestring开始时间
end_timestring结束时间
normal_couponobject满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_couponobject折扣券使用规则
thresholdinteger门槛金额
percent_offinteger固定减免百分比
exchange_couponobject兑换券使用规则
thresholdinteger门槛金额
exchange_priceinteger固定兑换价格
sequential_usage_ruleobject多次优惠使用规则
coupon_available_periodobject券可核销时间
available_begin_timestring开始时间
available_end_timestring结束时间
wait_days_after_receiveinteger领取后N天开始生效
weekly_available_periodobject每周固定可用时间
day_liststring[]每周可用星期数
MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一
day_period_listobject[]当天可用时间段
begin_timeinteger当天可用开始时间
end_timeinteger当天可用结束时间
irregular_available_period_listobject[]无规律的可用时间段
begin_timestring开始时间
end_timestring结束时间
normal_coupon_listobject[]满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_coupon_listobject[]折扣券使用规则列表
thresholdinteger门槛金额
percent_offinteger固定减免百分比
exchange_coupon_listobject[]兑换券使用规则列表
thresholdinteger门槛金额
exchange_priceinteger固定兑换价格
special_firstboolean多次优惠是否提供首笔特惠
usage_rule_display_infoobject券使用规则展示信息
coupon_usage_method_liststring[]券使用方式列表
OFFLINE | MINI_PROGRAM | APP | PAYMENT_CODE 枚举值之一
mini_program_appidstring小程序AppID
mini_program_pathstring小程序跳转路径
app_pathstringAPP跳转路径
usage_descriptionstring券使用说明
coupon_available_store_infoobject券可用门店信息
descriptionstring券可用门店描述
mini_program_appidstring小程序AppID
mini_program_pathstring小程序跳转路径
coupon_display_infoobject用户商品券展示信息
code_display_modestring用户商品券Code展示模式
INVISIBLE | BARCODE | QRCODE 枚举值之一
background_colorstring背景颜色
Color010 | Color020 | Color030 | Color040 | Color050 | Color060 | Color070 | Color080 | Color090 | Color100 枚举值之一
entrance_mini_programobject小程序入口
appidstring小程序appid
pathstring小程序跳转路径
entrance_wordingstring入口文案
guidance_wordingstring引导文案
entrance_official_accountobject公众号入口
appidstring公众号AppID
entrance_finderobject视频号入口
finder_idstring视频号ID
finder_video_idstring视频号视频ID
finder_video_cover_image_urlstring视频号封面图
notify_configobject事件通知配置
notify_appidstring事件通知appid
store_scopestring可用门店范围
NONE | ALL | SPECIFIC 枚举值之一
sent_count_infoobject已发放次数
total_countinteger已发放总次数
today_countinteger当天已发放次数
statestring批次状态
AUDITING | SENDING | PAUSED | STOPPED | DEACTIVATED 枚举值之一
deactivate_request_nostring失效请求单号
deactivate_timestring失效时间
deactivate_reasonstring失效原因
brand_idstring品牌ID
attachstring自定义附加信息
channel_custom_infostring渠道自定义信息
brand_idstring品牌ID

参阅 官方文档

Published on the GitHub by TheNorthMemory