POST /wallets/{user_id}/coupons/{code}/redeem

用户使用优惠券码兑换优惠券

钱包服务 `bearerAuth` application/json

请求参数

名称位置类型必填默认值示例约束描述
user_id path string 是 用户ID
code path string 是 优惠券码
wallet_id query string 否 钱包ID

响应

引用的 Schema

service-core/base/dto.SimpleResponse

字段类型必填示例约束描述
code integer 否
message string 否
timestamp string 否

service-wallet/internal/handler/dto.CouponResponse

优惠券信息

字段类型必填示例约束描述
code string 否 DISCOUNT20 码
created_at string 否 2026-01-01T00:00:00Z 创建
id string 否 cpn_abc123 ID
min_amount string 否 100.00 最低消费
name string 否 20元优惠券 名称
status string 否 unused 状态
type string 否 cash 类型
used_at string 否 使用时间
used_order_id string 否 订单ID
valid_from string 否 2026-01-01T00:00:00Z 生效
valid_until string 否 2026-12-31T23:59:59Z 失效
value string 否 20.00 价值

service-wallet/internal/handler/dto.RedeemCouponResponse

字段类型必填示例约束描述
code integer 否
data service-wallet/internal/handler/dto.CouponResponse 否
message string 否
timestamp string 否