Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A staff session token, uk_st_…. Minted by sign-up, sign-in or the two-factor exchange. Only a 401 means it is spent; not_a_member (403) is about the organization named in X-Organization-Id and leaves the token good for the others.

Headers

X-Organization-Id
string

The organization the caller is acting on — the org_… code that appears in the panel URL. It identifies; the membership JOIN is what authorizes, so a forged code reads nothing: the answer is not_a_member (403), which does not mean the session is over. Absent, the session's default organization answers, or — if that membership was revoked while the session was open — any other one the caller still holds.

Path Parameters

id
string<uuid>
required

The coupon to withdraw. One from the other environment answers 404.

Query Parameters

environment
enum<string>
default:live

Which environment to act in. A view parameter, valid only on the staff surface — a machine credential never chooses its environment, it is resolved from the key.

Available options:
live,
test

Response

The coupon, now archived.

A discount you promise on your own catalogue. Its terms are immutable — a subscription bought under a coupon keeps producing invoices that only make sense against the terms as they were — so there is no update: a different discount is a new coupon, and this one is withdrawn by archiving.

The fields of the other kind and the other durations are null, never 0: 0% off and an amount of nothing are numbers a screen would render.

id
string<uuid>
name
string

What the payer sees beside the discount at the gateway's checkout.

kind
enum<string>
Available options:
percent,
amount
percent_off
integer | null

A whole percentage, 1–100. null on an amount coupon.

amount_minor
integer<int64> | null

The amount off, an integer in the currency's minor unit. null on a percent coupon.

currency
string | null

ISO 4217, uppercase — the amount never travels without it. null on a percent coupon.

Example:

"BRL"

currency_exponent
integer | null

How many decimal places the currency has, so amount_minor can be rendered without hard-coding a divisor. null on a percent coupon.

duration
enum<string>

How long the discount keeps applying to a recurring subscription: the first invoice, duration_months of them, or every one.

Available options:
once,
repeating,
forever
duration_months
integer | null

How many invoices repeating covers. null on the other durations.

max_redemptions
integer | null

How many redemptions the offer is good for, across all customers. null is no cap.

expires_at
string<date-time> | null

When the offer stops being redeemable. null is never. Subscriptions already discounted keep their discount either way.

archived
boolean

Withdrawn: no new checkout may apply it. Existing discounts survive.

providers
object[]

How this coupon is known at each payment provider. Empty is the ordinary state — the gateway's coupon is minted by the first checkout that applies this one on each account.

created_at
string<date-time>