兑换折扣码
POST/openapi/2026-07/loyalty/members/:member_id/redemption-campaigns/:campaign_id/redeem
会员使用积分兑换指定活动的折扣码
请求
Path参数
URL 路径中的会员 ID,必须等于 storefront token 解析出的会员 ID
URL 路径中的兑换活动 ID
- application/json
- 请求体
- 示例
请求体必填
幂等 ID,1 小时窗口内同 key 回放首次响应
{
"idempotency_key": "string"
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
错误码
错误信息
data object
会员唯一 ID
本次兑换扣减的积分
积分扣减流水 ID
本次兑换生成的折扣码字符串
discount_code_activity object
折扣码活动信息
活动名称
折扣类型:percentage / fixed_amount / free_shipping / bxgy
折扣值;percentage 为百分比数字字符串(如 "10"),fixed_amount 为金额字符串(如 "10.00"),free_shipping / bxgy 留空
前置条件类型:none / subtotal / quantity
前置条件值:subtotal 为金额字符串,quantity 为数量
免邮上限(免邮码用),-1 表示无上限。用 string 保留小数
applicable_rule object
适用商品规则
适用类型:all / include_products / include_collections
applicable_type=include_products 时的商品 ID 列表
applicable_type=include_products 时的 SKU/variant ID 列表
applicable_type=include_collections 时的合集 ID 列表
obtain_products object
获取商品规则(BXGY 专用)
applicable_rule object
可获取商品的适用规则
适用类型:all / include_products / include_collections
applicable_type=include_products 时的商品 ID 列表
applicable_type=include_products 时的 SKU/variant ID 列表
applicable_type=include_collections 时的合集 ID 列表
获取商品数量
获取商品优惠类型:free / percentage / fixed_amount
优惠值;decimal 字符串
是否允许跟其他折扣叠加
每人活动使用次数上限,-1 表示无上限
每人单码使用次数上限,-1 表示无上限
每笔订单使用次数上限,-1 表示无上限
单码最大使用次数,-1 表示无上限
活动开始时间;ISO 8601 UTC
活动结束时间;ISO 8601 UTC,空串表示长期有效
兑换完成时间,ISO-8601
{
"code": "string",
"message": "string",
"data": {
"member_id": "string",
"deducted_points": 0,
"transaction_id": "string",
"discount_code": "string",
"discount_code_activity": {
"name": "string",
"discount_type": "string",
"discount_value": "string",
"prerequisite_type": "string",
"prerequisite_value": "string",
"max_free_shipping": "string",
"applicable_rule": {
"applicable_type": "string",
"applicable_product_ids": [
"string"
],
"applicable_variant_ids": [
"string"
],
"applicable_collection_ids": [
"string"
]
},
"obtain_products": {
"applicable_rule": {
"applicable_type": "string",
"applicable_product_ids": [
"string"
],
"applicable_variant_ids": [
"string"
],
"applicable_collection_ids": [
"string"
]
},
"product_count": 0,
"obtain_type": "string",
"obtain_value": "string"
},
"use_with_other": true,
"limit_user_discount": 0,
"limit_code_user_discount": 0,
"limit_order_discount": 0,
"limit_code_max_discount": 0,
"started_at": "string",
"ended_at": "string"
},
"redeemed_at": "string"
}
}