A coupon is a discount you apply to a payment link, an invoice or a subscription, or that customers get with a promotion code. Its discount and what it applies to are fixed once it's created.
Attributes
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier, starting cpn_. |
object | string | Always coupon. |
livemode | boolean | true in live mode. |
name | string | Shown on receipts and invoices. |
discount | object | type percent with percent_bps, in basis points from 1 to 10,000 (2000 is 20%), or type amount with amount in cents and currency. |
duration | enum | On a subscription: once (the first payment), repeating (for duration_months) or forever. |
duration_months | integer or null | For repeating. |
products | array of strings or null | The products it applies to, or null for every product. |
max_redemptions | integer or null | How many times it can be used in all, through every code. |
redeem_by | timestamp or null | Its last moment. |
times_redeemed | integer | How many times it was used. |
status | enum | active or archived. |
created | timestamp | When it was created. |
Example
Endpoints
| Endpoint | What it does |
|---|---|
POST /v1/coupons | Create a discount. |
GET /v1/coupons/{id} | Get a coupon by its ID. |
POST /v1/coupons/{id} | Rename a coupon. Its discount and what it applies to never change. |
POST /v1/coupons/{id}/archive | Stop a coupon being redeemed. Whatever it was applied to keeps its discount. |
GET /v1/coupons | List your coupons, newest first. |