Skip to content

Validate Coupon

GET
/api/v1/coupons/validate
curl --request GET \
--url 'https://api.ultimateteam.ai/api/v1/coupons/validate?code=example' \
--header 'X-API-Key: <X-API-Key>'

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?}.

code
required
Code

Coupon code

string
>= 1 characters <= 50 characters

Coupon code

Successful Response

Media typeapplication/json
CouponValidationResponse

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
Valid
boolean
Examplegenerated
{
"bonus_credits": 1,
"code": "example",
"description": "example",
"discount_type": "example",
"discount_value": 1,
"error": "example",
"error_code": "example",
"plan_grant": "example",
"valid": true
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}