Docs

Promo Codes

Manage Stripe promo codes via the Admin API

Promo Codes API

Manage promotional codes for your Stripe integration. Promo codes are customer-facing codes that apply coupons to subscriptions or checkout sessions.

Endpoints

GET /api/admin/stripe/promo-codes

List all promo codes from your Stripe account.

Query Parameters

ParameterTypeDescription
limitnumberMaximum number of promo codes to return (default: 10, max: 100)
starting_afterstringCursor for pagination
couponstringFilter by coupon ID

Response

{
  "data": [
    {
      "id": "promo_1234567890",
      "object": "promotion_code",
      "code": "WELCOME2024",
      "coupon": {
        "id": "coupon_1234567890",
        "object": "coupon",
        "name": "Welcome Discount",
        "percent_off": 20,
        "duration": "once"
      },
      "active": true,
      "customer": null,
      "expires_at": null,
      "max_redemptions": 100,
      "times_redeemed": 15,
      "restrictions": {
        "first_time_transaction": false,
        "minimum_amount": null,
        "minimum_amount_currency": null
      },
      "created": 1234567890
    }
  ],
  "has_more": false
}

POST /api/admin/stripe/promo-codes

Create a new promotional code.

Request Body

{
  "code": "BLACKFRIDAY2024",
  "coupon": "coupon_1234567890",
  "active": true,
  "max_redemptions": 500,
  "expires_at": 1732982400,
  "restrictions": {
    "first_time_transaction": true,
    "minimum_amount": 5000,
    "minimum_amount_currency": "usd"
  }
}

Parameters

ParameterTypeRequiredDescription
codestringYesThe customer-facing promo code (case-insensitive)
couponstringYesThe coupon ID to associate with this promo code
activebooleanNoWhether the promo code is active (default: true)
max_redemptionsnumberNoMaximum number of times the code can be redeemed
expires_attimestampNoUnix timestamp when the promo code expires
restrictionsobjectNoRestrictions on the promo code usage

Restrictions Object

ParameterTypeDescription
first_time_transactionbooleanLimit to first-time customers only
minimum_amountnumberMinimum order amount in cents
minimum_amount_currencystringCurrency for minimum amount (e.g., "usd")

Response

{
  "id": "promo_1234567890",
  "object": "promotion_code",
  "code": "BLACKFRIDAY2024",
  "coupon": {
    "id": "coupon_1234567890",
    "object": "coupon",
    "name": "Black Friday Discount",
    "percent_off": 30,
    "duration": "once"
  },
  "active": true,
  "customer": null,
  "expires_at": 1732982400,
  "max_redemptions": 500,
  "times_redeemed": 0,
  "restrictions": {
    "first_time_transaction": true,
    "minimum_amount": 5000,
    "minimum_amount_currency": "usd"
  },
  "created": 1234567890
}

PATCH /api/admin/stripe/promo-codes

Update an existing promo code. Note: Only active can be updated after creation.

Request Body

{
  "id": "promo_1234567890",
  "active": false
}

Parameters

ParameterTypeRequiredDescription
idstringYesThe promo code ID to update
activebooleanYesActive status

Response

{
  "id": "promo_1234567890",
  "object": "promotion_code",
  "code": "BLACKFRIDAY2024",
  "coupon": {
    "id": "coupon_1234567890",
    "object": "coupon",
    "name": "Black Friday Discount",
    "percent_off": 30,
    "duration": "once"
  },
  "active": false,
  "customer": null,
  "expires_at": 1732982400,
  "max_redemptions": 500,
  "times_redeemed": 150,
  "restrictions": {
    "first_time_transaction": true,
    "minimum_amount": 5000,
    "minimum_amount_currency": "usd"
  },
  "created": 1234567890
}

Promo Code vs Coupon

Understanding the difference:

FeatureCouponPromo Code
PurposeDefines the discount amount and durationCustomer-facing code that applies a coupon
Customer FacingNoYes
Multiple CodesOne coupon, one codeOne coupon, many promo codes
RestrictionsNoneCan have usage restrictions

Example Usage

Create a Simple Promo Code

curl -X POST /api/admin/stripe/promo-codes \
  -H "Content-Type: application/json" \
  -d '{
    "code": "WELCOME2024",
    "coupon": "coupon_1234567890"
  }'

Create a Limited-Time Promo Code

curl -X POST /api/admin/stripe/promo-codes \
  -H "Content-Type: application/json" \
  -d '{
    "code": "FLASHSALE",
    "coupon": "coupon_1234567890",
    "max_redemptions": 100,
    "expires_at": 1704067200
  }'

Create a First-Time Customer Promo

curl -X POST /api/admin/stripe/promo-codes \
  -H "Content-Type: application/json" \
  -d '{
    "code": "FIRSTORDER",
    "coupon": "coupon_1234567890",
    "restrictions": {
      "first_time_transaction": true,
      "minimum_amount": 2500,
      "minimum_amount_currency": "usd"
    }
  }'

List All Promo Codes

curl /api/admin/stripe/promo-codes?limit=20

List Promo Codes for a Coupon

curl "/api/admin/stripe/promo-codes?coupon=coupon_1234567890"

Deactivate a Promo Code

curl -X PATCH /api/admin/stripe/promo-codes \
  -H "Content-Type: application/json" \
  -d '{
    "id": "promo_1234567890",
    "active": false
  }'

On this page