Creating Promotional Codes
Create promotional codes that customers can use at checkout. Each promotional code must be linked to an existing coupon.Manual vs Auto-Generated Codes
Manual Codes
Specify the exact code string you want to create:Auto-Generated Codes
Let the system generate codes based on a structure:SAVEJOHN8X4Z
Code Structure Options
When using auto-generated codes, you can combine:- firstName: Include affiliate’s first name
- lastName: Include affiliate’s last name
- email: Include part of affiliate’s email (before @)
- discountAmount: Include the discount value
- couponName: Include the coupon name
- randomChars: Add random characters
Additional Settings
- active: Whether the code is currently active
- expiresAt: Expiration date for the code
- maxRedemptions: Maximum number of times the code can be used
- firstTimeOrder: Limit to first-time customers only
- minimumAmount: Minimum purchase amount required
- limitToAffiliate: Only the affiliate can use this code
- limitToCustomers: Restrict to specific customers
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Promotional code details
The coupon ID this promotional code belongs to
The promotional code string (required if not auto-generated)
The affiliate ID to assign this code to
The affiliate email (alternative to affiliateId)
External ID (e.g., Stripe promotion code ID)
Whether the code is active (default: true)
Expiration date
Maximum redemptions
Limit to first-time orders (default: false)
Minimum purchase amount
Currency for minimum amount
Limit to specific customers (default: false)
Specific customer ID
Only affiliate can use (default: false)
Whether to auto-generate the code (default: false)
Structure for auto-generated codes (required if isAutoGenerated is true)
Prefix for auto-generated codes
Length of random characters (default: 4)
Case for random characters (default: mixed)
uppercase
, lowercase
, mixed
Response
Promotional code created successfully
The promotional code ID
The actual promotional code string
The parent coupon ID
The affiliate ID this code is assigned to
External ID (e.g., Stripe promotion code ID)
Whether the promotional code is active
Expiration date for the code
Maximum number of times this code can be used
Number of times this code has been redeemed
Whether this code is limited to first-time orders
Minimum purchase amount required
Currency for minimum amount
Whether code is limited to specific customers
Specific customer ID this code is limited to
Whether only the affiliate can use this code
Whether this code was auto-generated
Timestamp when the code was created
Timestamp when the code was last updated
The parent coupon details
Affiliate details