Dashboard
APIValidate Coupon API - Check Discount Code | BotSubscription
api.botsubscription.com
GET/v1/endpoint
AuthenticationBearer
Token
Stays in this tab. Required for this endpoint — the value below is what gets sent.
Mock
curl --request GET \
  --url https://api.botsubscription.com/v1/endpoint \
  --header 'Authorization: Bearer sk_live_•••'

Validate Coupon - Check Discount Code Eligibility via API

Check if a coupon code is valid for a specific user and purchase amount before applying it. The response shows whether the coupon is eligible, the calculated discount, and the final price—or the reasons why the coupon cannot be used.

POST/v2/projects/{project_id}/coupons/validate

Authorization

Bearer TokenRequired

Path Parameters

project_idstringrequired

The unique identifier of the project.

Request Body

coupon_idstring

Coupon UUID. Either coupon_id or code is required.

codestring

Coupon code (case-insensitive). Either code or coupon_id is required.

amountstringrequired

Order amount to evaluate against, as a decimal string.

currencystringrequired

The currency of the amount (e.g., USD).

user_idstring

The user ID, used to evaluate per-user limits and audience scope.

plan_idstring

Plan being purchased, used for plan_scope checks. Omit for top-up previews.

is_renewalboolean

Whether the purchase is a renewal, used for renewal_constraint.

is_churnedboolean

Whether the user is churned, used for renewal_constraint.

contextobject

Additional eligibility hints: is_invitee, is_new_user.

Last updated: