Skip to main content
POST
/
coupons
Create a new coupon
curl --request POST \
  --url https://www.pushlapgrowth.com/api/v1/coupons \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "externalId": "<string>",
  "couponType": "PERCENTAGE",
  "percentOff": 123,
  "amountOff": 123,
  "currency": "<string>",
  "duration": "once",
  "durationInMonths": 123,
  "maxRedemptions": 123,
  "limitToProducts": true,
  "productIds": [
    "<string>"
  ],
  "valid": true,
  "redeemBy": "2023-11-07T05:31:56Z",
  "integrationType": "<string>"
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "externalId": "<string>",
  "couponType": "PERCENTAGE",
  "percentOff": 123,
  "amountOff": 123,
  "currency": "<string>",
  "duration": "once",
  "durationInMonths": 123,
  "maxRedemptions": 123,
  "limitToProducts": true,
  "productIds": [
    "<string>"
  ],
  "valid": true,
  "redeemBy": "2023-11-07T05:31:56Z",
  "integrationType": "<string>",
  "affiliateProgramId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "promotionalCodes": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "code": "<string>",
      "couponId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "affiliateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "externalId": "<string>",
      "active": true,
      "expiresAt": "2023-11-07T05:31:56Z",
      "maxRedemptions": 123,
      "timesRedeemed": 123,
      "firstTimeOrder": true,
      "minimumAmount": 123,
      "minimumAmountCurrency": "<string>",
      "limitToCustomers": true,
      "customerId": "<string>",
      "limitToAffiliate": true,
      "isAutoGenerated": true,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "coupon": {},
      "affiliate": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "firstName": "<string>",
        "lastName": "<string>",
        "email": "jsmith@example.com"
      }
    }
  ]
}

Creating Coupons

Create a new coupon definition that can be used to generate promotional codes for your affiliates.

Coupon Types

  • PERCENTAGE: Discount based on a percentage (e.g., 20% off)
  • FLAT: Fixed amount discount (e.g., $10 off)

Duration Options

  • once: Applies to a single payment
  • forever: Applies to all future payments
  • repeating: Applies for a specific number of months
After creating a coupon, you’ll need to create promotional codes linked to this coupon. Promotional codes are the actual discount codes that customers will enter at checkout.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Coupon details

name
string
required

Name of the coupon

externalId
string

External ID (e.g., Stripe coupon ID)

couponType
enum<string>

Type of discount - percentage or flat amount (default: PERCENTAGE)

Available options:
PERCENTAGE,
FLAT
percentOff
number

Percentage off (1-100) - required for percentage coupons

amountOff
number

Amount off - required for flat coupons

currency
string

Currency (e.g., USD, EUR) - required for flat coupons

duration
enum<string>

How long the discount applies (default: forever)

Available options:
once,
forever,
repeating
durationInMonths
integer

Number of months - required for repeating duration

maxRedemptions
integer

Maximum number of times this coupon can be redeemed

limitToProducts
boolean

Whether coupon is limited to specific products (default: false)

productIds
string[]

Array of product IDs this coupon applies to

valid
boolean

Whether the coupon is currently valid (default: true)

redeemBy
string<date-time>

Date by which the coupon must be redeemed

integrationType
string

Integration type (e.g., stripe, custom)

Response

Coupon created successfully

id
string<uuid>

The coupon ID

name
string

Name of the coupon

externalId
string | null

External ID (e.g., Stripe coupon ID)

couponType
enum<string>

Type of discount - percentage or flat amount

Available options:
PERCENTAGE,
FLAT
percentOff
number | null

Percentage off (1-100) for percentage coupons

amountOff
number | null

Amount off for flat coupons

currency
string | null

Currency for flat amount coupons (e.g., USD, EUR)

duration
enum<string>

How long the discount applies

Available options:
once,
forever,
repeating
durationInMonths
integer | null

Number of months for repeating duration

maxRedemptions
integer | null

Maximum number of times this coupon can be redeemed

limitToProducts
boolean

Whether coupon is limited to specific products

productIds
string[]

Array of product IDs this coupon applies to

valid
boolean

Whether the coupon is currently valid

redeemBy
string<date-time> | null

Date by which the coupon must be redeemed

integrationType
string | null

Integration type (e.g., stripe, custom)

affiliateProgramId
string<uuid>

The affiliate program ID

createdAt
string<date-time>

Timestamp when the coupon was created

updatedAt
string<date-time>

Timestamp when the coupon was last updated

promotionalCodes
object[]

Promotional codes associated with this coupon

I