# 创建福利券批次

# 接口说明

# 接口地址

https://open.wecard.qq.com/cgi-bin/pay/provider/voucher/create

# 请求方法

POST

# 请求参数

access_token=[鉴权token]

参数 是否必填 类型 实例 说明
access_token String 应用有效凭证

# 请求body(json)

{"name":"福利券测试","doorsill":20,"rule_type":1,"timestamp":"DREzmSu8WK9at/MZ2ixf0/ndAPqK0HLENww=","nonce":"JBqIP9IWg8DE","rule_mch_ids":"99694146,99694147","send_notify":1,"rule_expire_in":4,"par_value":10,"consume_during":[{"begin":"00:00","end":"15:59"},{"begin":"18:00","end":"23:59"}],"rule_begin_date":"2023-03-09","rule_end_date":"2023-03-10"}
参数 是否必填 类型 实例 说明
name String 券名称
par_value Integer 面额(分)
doorsill Integer 使用门槛金额(分),消费满多少钱可使用券
rule_type Integer 发放规则;0:仅发放一次,1:每天自动发放(凌晨4点前发放完毕)
rule_begin_date String rule_type为0时表示券使用有效日期的开始时间,rule_type为1时表示自动发放的开始时间,格式为 YYYY:mm:dd
rule_end_date String rule_type为0时表示券使用有效日期的截止时间,rule_type为1时表示自动发放的结束时间,格式为 YYYY:mm:dd
rule_expire_in Integer rule_type为1时必填,表示领券后多少天内可用
rule_mch_ids String 消费范围,商户id之间用逗号分割,不传表示全部商户可以消费
consume_during(单次发放可不传) begin String 指定可以使用券时段的开始时间;格式为 HH:mm:ss
end String 指定可以使用券时段的结束时间;格式为 HH:mm:ss
send_notify Integer 用户到账后是否发送通知给用户;0:不发通知,1:发通知;默认不发
timestamp String 当前unix时间戳(需要对称加密再进行Base64转换)
nonce String 随机字符串(加密需使用)
associate_data String 固定传 create(加密需使用)

# 响应说明

{
  "code": 0,
  "message": "成功",
  "data": {
    "response_id": "xxxxxx-xxxx-xxxx-xxxxxx",
    "voucher_id": "1020"
  }
}
参数 类型 实例 说明
code Integer 0为成功,其它为失败
message String 响应说明
data response_id String 本次请求响应id
voucher_id String 券批次号