Skip to content

Search API reference

Find an endpoint or a guide of the Sovgate API reference and jump straight to it.

The coupon object

A discount: what it takes off, from what, and for how long.

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

NameTypeDescription
idstringUnique identifier, starting cpn_.
objectstringAlways coupon.
livemodebooleantrue in live mode.
namestringShown on receipts and invoices.
discountobjecttype percent with percent_bps, in basis points from 1 to 10,000 (2000 is 20%), or type amount with amount in cents and currency.
durationenumOn a subscription: once (the first payment), repeating (for duration_months) or forever.
duration_monthsinteger or nullFor repeating.
productsarray of strings or nullThe products it applies to, or null for every product.
max_redemptionsinteger or nullHow many times it can be used in all, through every code.
redeem_bytimestamp or nullIts last moment.
times_redeemedintegerHow many times it was used.
statusenumactive or archived.
createdtimestampWhen it was created.

Example

json
{  "id": "cpn_20b5e71de063737f5f3e2920",  "object": "coupon",  "livemode": false,  "name": "Launch 20% off",  "discount": {    "type": "percent",    "percent_bps": 2000  },  "duration": "repeating",  "duration_months": 3,  "products": null,  "max_redemptions": 100,  "redeem_by": "2026-12-31T23:59:59Z",  "times_redeemed": 12,  "status": "active",  "created": "2026-11-20T09:30:00Z"}

Endpoints

EndpointWhat it does
POST /v1/couponsCreate 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}/archiveStop a coupon being redeemed. Whatever it was applied to keeps its discount.
GET /v1/couponsList your coupons, newest first.