v1

latestOpenAPI 3.1.02026-07-261444991.2 MB
Coupon

Create coupon

This endpoint allows the creation of coupons, which can then be redeemed at subscription creation or plan change.

post/coupons

Request body

redemption_codestring required

This string can be used to redeem this coupon for a given subscription.

duration_in_monthsinteger nullable

This allows for a coupon's discount to apply for a limited time (determined in months); a null value here means "unlimited time".

max_redemptionsinteger nullable

The maximum number of redemptions allowed for this coupon before it is exhausted;null here means "unlimited".

Example request

{
  "redemption_code": "HALFOFF",
  "duration_in_months": 12
}

Response

Created

idstring required

Also referred to as coupon_id in this documentation.

redemption_codestring required

This string can be used to redeem this coupon for a given subscription.

times_redeemedinteger required

The number of times this coupon has been redeemed.

duration_in_monthsinteger nullable required

This allows for a coupon's discount to apply for a limited time (determined in months); a null value here means "unlimited time".

max_redemptionsinteger nullable required

The maximum number of redemptions allowed for this coupon before it is exhausted; null here means "unlimited".

archived_atstring date-time nullable required

An archived coupon can no longer be redeemed. Active coupons will have a value of null for archived_at; this field will be non-null for archived coupons.

Example response

{
  "id": "7iz2yanVjQoBZhyH",
  "redemption_code": "HALFOFF",
  "discount": {
    "applies_to_price_ids": [
      "h74gfhdjvn7ujokd",
      "7hfgtgjnbvc3ujkl"
    ],
    "percentage_discount": 0.15
  },
  "duration_in_months": 12
}