Skip to content

Get Coupon

GET
/api/v1/admin/coupons/{coupon_id}

Return one coupon plus its redemption row count.

Args: coupon_id: The coupon’s UUID. user: The authenticated platform operator (injected). session: Database session.

Returns: The coupon with redemption_count attached.

Raises: HTTPException 404: No coupon with that id.

Authorizations

Parameters

Path Parameters

coupon_id
required
string format: uuid

Responses

200

Successful Response

GET /api/v1/admin/coupons/{id} — coupon plus its redemption count.

redemption_count is counted from coupon_redemptions rather than read from times_redeemed: the counter is the concurrency guard and can legitimately differ from the row count if a redemption transaction rolled back after the guarded UPDATE, so showing both makes that divergence visible instead of hiding it.

object
active
required
boolean
bonus_credits
required
integer
code
required
string
created_at
required
string format: date-time
created_by
required
Any of:
string
description
required
Any of:
string
discount_type
required
string
discount_value
required
integer
duration
required
string
duration_months
required
Any of:
integer
expires_at
required
Any of:
string format: date-time
id
required
string format: uuid
max_redemptions
required
Any of:
integer
plan_grant
required
Any of:
string
redemption_count
required
integer
times_redeemed
required
integer

422

Validation Error

object
detail
Array<object>
object
ctx
object
input
loc
required
Array
msg
required
string
type
required
string