版本:202506
领取优惠券
POST/openapi/2025-06/coupons/receive
将指定优惠券分配给顾客。
请求
- application/json
- 请求体
- 示例
请求体必填
customer_idstring必填
顾客 ID
coupon_idsstring[]必填
优惠券 ID 列表
{
"customer_id": "string",
"coupon_ids": [
"string"
]
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
1: 领取成功2: 不符合领取条件(不含未购买/未订阅)3: 达到领取上限(总量不超过 100)4: 达到领取上限(超过后台配置)5: 已过期6: 优惠券不存在7: 已领取8: 库存不足9: 领取失败(并发锁失败或第三方服务异常)10: 未开始11: 未订阅12: 未购买13: 不允许领取复购优惠券- Array [
1: 已领取2: 个人领取达到上限3: 没有库存- ]
- Array [
- ]
codestring
错误码
messagestring
错误信息
data object
receive_statusint32
领取状态码:
items object[]
已分配的优惠券及其详情列表
idstring
已分配优惠券的 ID
stockint32
优惠券的可用库存,-1 表示无限库存
once_per_customerint32
是否每位顾客只能使用一次
coupon_statusint32
优惠券的领取状态:
received_countint32
优惠券已被领取的次数
receive_info object[]
领取信息
coupon_idstring
优惠券 ID
discount_code_idstring
折扣码 ID
discount_codestring
折扣码
{
"code": "string",
"message": "string",
"data": {
"receive_status": 0,
"items": [
{
"id": "string",
"stock": 0,
"once_per_customer": 0,
"coupon_status": 0,
"received_count": 0
}
],
"receive_info": [
{
"coupon_id": "string",
"discount_code_id": "string",
"discount_code": "string"
}
]
}
}