Skip to content

发放裂变红包

裂变红包:一次可以发放一组红包。首先领取的用户为种子用户,种子用户领取一组红包当中的一个,并可以通过社交分享将剩下的红包给其他用户。裂变红包充分利用了人际传播的优势。

🚫

本接口服务已于 2024.06.05 (北京时间)下线,文档仅做留存参考。

请求参数类型描述
securitytrue声明加载商户API证书
xmlobject声明请求的XML数据结构
mch_billnostring商户订单号
mch_idstring商户号
wxappidstring公众账号appid
send_namestring商户名称
re_openidstring用户openid
total_amountinteger总金额
total_numinteger红包发放总人数
amt_typestring红包金额设置方式
ALL_RAND 枚举值
wishingstring红包祝福语
act_namestring活动名称
remarkstring备注
scene_idstring场景id
PRODUCT_1 | PRODUCT_2 | PRODUCT_3 | PRODUCT_4 | PRODUCT_5 | PRODUCT_6 | PRODUCT_7 | PRODUCT_8 枚举值之一
risk_infostring活动信息
posttimenumber用户操作的时间戳
mobilestring业务系统账号的手机号
deviceidstringMAC地址或者设备唯一标识
clientversionstring用户操作的客户端版本
php
$instance->v2->mmpaymkttransfers->sendgroupredpack->postAsync([
  'security' => true,
  'xml' => [
    'mch_billno'   => '10000098201411111234567890',
    'mch_id'       => '10000098',
    'wxappid'      => 'wx8888888888888888',
    'send_name'    => '天虹百货',
    're_openid'    => 'oxTWIuGaIt6gTKsQRLau2M0yL16E',
    'total_amount' => '1000',
    'total_num'    => '3',
    'amt_type'     => 'ALL_RAND',
    'wishing'      => '感谢您参加猜灯谜活动,祝您元宵节快乐!',
    'act_name'     => '猜灯谜抢红包活动',
    'remark'       => '猜越多得越多,快来抢!',
    'scene_id'     => 'PRODUCT_8',
    'risk_info'    => \urlencode(\WeChatPay\Formatter::queryStringLike([
      'posttime'      => 1717171199,
      'mobile'        => '122344545',
      'deviceid'      => 'IOS',
      'clientversion' => '234134',
    ])),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/mmpaymkttransfers/sendgroupredpack')->postAsync([
  'security' => true,
  'xml' => [
    'mch_billno'   => '10000098201411111234567890',
    'mch_id'       => '10000098',
    'wxappid'      => 'wx8888888888888888',
    'send_name'    => '天虹百货',
    're_openid'    => 'oxTWIuGaIt6gTKsQRLau2M0yL16E',
    'total_amount' => '1000',
    'total_num'    => '3',
    'amt_type'     => 'ALL_RAND',
    'wishing'      => '感谢您参加猜灯谜活动,祝您元宵节快乐!',
    'act_name'     => '猜灯谜抢红包活动',
    'remark'       => '猜越多得越多,快来抢!',
    'scene_id'     => 'PRODUCT_8',
    'risk_info'    => \urlencode(\WeChatPay\Formatter::queryStringLike([
      'posttime'      => 1717171199,
      'mobile'        => '122344545',
      'deviceid'      => 'IOS',
      'clientversion' => '234134',
    ])),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/mmpaymkttransfers/sendgroupredpack']->postAsync([
  'security' => true,
  'xml' => [
    'mch_billno'   => '10000098201411111234567890',
    'mch_id'       => '10000098',
    'wxappid'      => 'wx8888888888888888',
    'send_name'    => '天虹百货',
    're_openid'    => 'oxTWIuGaIt6gTKsQRLau2M0yL16E',
    'total_amount' => '1000',
    'total_num'    => '3',
    'amt_type'     => 'ALL_RAND',
    'wishing'      => '感谢您参加猜灯谜活动,祝您元宵节快乐!',
    'act_name'     => '猜灯谜抢红包活动',
    'remark'       => '猜越多得越多,快来抢!',
    'scene_id'     => 'PRODUCT_8',
    'risk_info'    => \urlencode(\WeChatPay\Formatter::queryStringLike([
      'posttime'      => 1717171199,
      'mobile'        => '122344545',
      'deviceid'      => 'IOS',
      'clientversion' => '234134',
    ])),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->mmpaymkttransfers->sendgroupredpack->post([
  'security' => true,
  'xml' => [
    'mch_billno'   => '10000098201411111234567890',
    'mch_id'       => '10000098',
    'wxappid'      => 'wx8888888888888888',
    'send_name'    => '天虹百货',
    're_openid'    => 'oxTWIuGaIt6gTKsQRLau2M0yL16E',
    'total_amount' => '1000',
    'total_num'    => '3',
    'amt_type'     => 'ALL_RAND',
    'wishing'      => '感谢您参加猜灯谜活动,祝您元宵节快乐!',
    'act_name'     => '猜灯谜抢红包活动',
    'remark'       => '猜越多得越多,快来抢!',
    'scene_id'     => 'PRODUCT_8',
    'risk_info'    => \urlencode(\WeChatPay\Formatter::queryStringLike([
      'posttime'      => 1717171199,
      'mobile'        => '122344545',
      'deviceid'      => 'IOS',
      'clientversion' => '234134',
    ])),
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/mmpaymkttransfers/sendgroupredpack')->post([
  'security' => true,
  'xml' => [
    'mch_billno'   => '10000098201411111234567890',
    'mch_id'       => '10000098',
    'wxappid'      => 'wx8888888888888888',
    'send_name'    => '天虹百货',
    're_openid'    => 'oxTWIuGaIt6gTKsQRLau2M0yL16E',
    'total_amount' => '1000',
    'total_num'    => '3',
    'amt_type'     => 'ALL_RAND',
    'wishing'      => '感谢您参加猜灯谜活动,祝您元宵节快乐!',
    'act_name'     => '猜灯谜抢红包活动',
    'remark'       => '猜越多得越多,快来抢!',
    'scene_id'     => 'PRODUCT_8',
    'risk_info'    => \urlencode(\WeChatPay\Formatter::queryStringLike([
      'posttime'      => 1717171199,
      'mobile'        => '122344545',
      'deviceid'      => 'IOS',
      'clientversion' => '234134',
    ])),
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/mmpaymkttransfers/sendgroupredpack']->post([
  'security' => true,
  'xml' => [
    'mch_billno'   => '10000098201411111234567890',
    'mch_id'       => '10000098',
    'wxappid'      => 'wx8888888888888888',
    'send_name'    => '天虹百货',
    're_openid'    => 'oxTWIuGaIt6gTKsQRLau2M0yL16E',
    'total_amount' => '1000',
    'total_num'    => '3',
    'amt_type'     => 'ALL_RAND',
    'wishing'      => '感谢您参加猜灯谜活动,祝您元宵节快乐!',
    'act_name'     => '猜灯谜抢红包活动',
    'remark'       => '猜越多得越多,快来抢!',
    'scene_id'     => 'PRODUCT_8',
    'risk_info'    => \urlencode(\WeChatPay\Formatter::queryStringLike([
      'posttime'      => 1717171199,
      'mobile'        => '122344545',
      'deviceid'      => 'IOS',
      'clientversion' => '234134',
    ])),
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误代码
err_code_desstring错误代码描述
mch_billnostring商户订单号
mch_idstring商户号
wxappidstring公众账号appid
re_openidstring用户openid
total_amountinteger总金额
send_listidstring微信单号

参阅 官方文档

Published on the GitHub by TheNorthMemory