Skip to content

Validate Coupon

GET
/api/v1/coupons/validate

Preview a coupon without redeeming it.

Always answers HTTP 200: an unknown, expired or exhausted code is a normal outcome of typing in a form, not a server error, and returning the same status for every outcome keeps the endpoint from doubling as a code oracle.

Args: code: The coupon code to preview (any case). session: Database session. _rate_limit: Per-IP rate-limit guard (injected).

Returns: {valid, code?, plan_grant?, discount_type?, discount_value?, bonus_credits?, description?, error?}.

Authorizations

Parameters

Query Parameters

code
required

Coupon code

string
>= 1 characters <= 50 characters

Coupon code

Responses

200

Successful Response

GET /api/v1/coupons/validate response body (public, read-only).

Deliberately narrow: it echoes only what the signup form needs to render a badge. It never exposes max_redemptions, times_redeemed, or created_by — an unauthenticated caller should not be able to enumerate coupon economics by probing codes.

object
bonus_credits
Any of:
integer
code
Any of:
string
description
Any of:
string
discount_type
Any of:
string
discount_value
Any of:
integer
error
Any of:
string
error_code
Any of:
string
plan_grant
Any of:
string
valid
required
boolean

422

Validation Error

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