A promotion code gives its coupon's discount. A coupon can have many codes, each with limits of its own within the coupon's.
Attributes
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier, starting promo_. |
object | string | Always promotion_code. |
livemode | boolean | true in live mode. |
coupon | string | Its coupon, cpn_.... |
code | string | The code itself. |
active | boolean | Whether it can be used. |
first_time_only | boolean | Only customers who have never paid you. |
one_per_customer | boolean | Each customer can use it once. |
minimum_amount | integer or null | The order's items must come to this, in cents, before discounts and tax. |
customer | string or null | Only this customer can use it. |
expires_at | timestamp or null | Its last moment; null: as long as the coupon. |
max_redemptions | integer or null | A limit of its own. |
times_redeemed | integer | How many times it was used. |
created | timestamp | When it was created. |
Example
Endpoints
| Endpoint | What it does |
|---|---|
POST /v1/promotion_codes | Add a code to a coupon. |
GET /v1/promotion_codes/{id} | Get a promotion code by its ID. |
POST /v1/promotion_codes/{id}/deactivate | Stop a code working. |
POST /v1/promotion_codes/{id}/activate | Let a deactivated code work again. |
GET /v1/promotion_codes | List your promotion codes, newest first. |