A valid request URL is required to generate request examples{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "percent",
"percent_off": 123,
"amount_minor": 123,
"currency": "BRL",
"currency_exponent": 123,
"duration": "once",
"duration_months": 123,
"max_redemptions": 123,
"expires_at": "2023-11-07T05:31:56Z",
"archived": true,
"providers": [
{
"provider": "stripe",
"provider_account_id": "<string>",
"provider_coupon_id": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}Create a coupon
Requires billing:write. Adds a discount to one environment’s catalogue. Build it in test and the live catalogue is untouched.
The kind decides which fields carry the discount, in both directions — the other kind’s fields are refused rather than ignored, because a request naming both is naming two discounts:
percent—percent_offis required, 1 to 100, a whole number.amount_minorandcurrencyare refused.amount—amount_minorandcurrencyare required and travel together, the catalogue’s money rule: an amount without a currency is not money.percent_offis refused. An amount coupon can only discount a price in its own currency — R50offaUS29 price is not an exchange-rate question, and the checkout refuses the pair.
duration is how long the discount keeps applying to a recurring subscription: once is the first invoice, forever is every invoice, and repeating is duration_months of them — required for that duration and refused for the other two.
A coupon’s terms are immutable. They are what somebody was promised, a subscription bought under them keeps producing invoices that only make sense against the terms as they were, and the database refuses any edit. There is no update endpoint; a different discount is a new coupon, and POST /v1/organization/catalogue/coupons/{id}/archive withdraws this one.
Nothing is created at any payment provider here. The gateway’s own coupon object is minted lazily, by the first checkout that applies this coupon on each gateway account.
A valid request URL is required to generate request examples{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "percent",
"percent_off": 123,
"amount_minor": 123,
"currency": "BRL",
"currency_exponent": 123,
"duration": "once",
"duration_months": 123,
"max_redemptions": 123,
"expires_at": "2023-11-07T05:31:56Z",
"archived": true,
"providers": [
{
"provider": "stripe",
"provider_account_id": "<string>",
"provider_coupon_id": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}Authorizations
Headers
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.
Query Parameters
Body
A coupon on the way in. Every field is stated — there is no PATCH on a coupon, so no request carrying this is editing one. The kind decides which fields carry the discount, and the other kind's fields are refused rather than ignored: a request naming both is naming two discounts.
Response
The coupon. providers is empty — the gateway's own coupon is minted by the first checkout that applies it.
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.