Overview
Yabetoo’s promotion system consists of two entities:Coupon
Defines the discount to apply (percentage or fixed amount)
Promo Code
Code usable by customers, linked to a coupon with additional restrictions
Coupons
What is a Coupon?
A Coupon defines the type and amount of discount. It can be reused by multiple promo codes with different restrictions.Identifier format:
coupon_ followed by 24 alphanumeric characters.Example: coupon_summer2024_20percentCoupon Attributes
Discount Types
- Percentage
- Fixed Amount
- Multi-Currency
Percentage Discount
Applies a percentage discount on the total amount.Discount Duration
Once
One time onlyThe discount applies only to the first payment.Ideal for: welcome offers, first purchases
Forever
AlwaysThe discount applies to all future payments.Ideal for: permanent discounts, partnerships
Repeating
Limited timeThe discount applies for X months.Ideal for: temporary promotions on subscriptions
SKU Restrictions
Limit a coupon to certain products/SKUs:Promo Codes
What is a Promo Code?
A Promo Code (PromotionCode) is the code customers use. It’s associated with a coupon and can have additional restrictions.Identifier format:
promo_ followed by 24 alphanumeric characters.Example: promo_summer20_publicPromo Code Attributes
Create a Promo Code
The code is automatically converted to uppercase.
summer20 becomes SUMMER20.Advanced Restrictions
- Minimum Amount
- First Purchase
- Specific Customers
- Time Limited
Require a minimum purchase amount:The code only works if the cart exceeds €50.
Promo Code Validation
When using a promo code, the system performs several checks:1
Code exists and active
The code must exist and
active must be true2
Not expired
Current date must be before
expiresAt3
Limit not reached
timesRedeemed must be less than maxRedemptions4
Coupon valid
Associated coupon must be valid (
valid: true)5
Minimum amount
Cart must reach
minimumAmount if defined6
First purchase
If
firstTimeTransaction, verify it’s the first order7
Customer authorized
If
customerIds defined, verify customer is in the list8
Eligible SKUs
If coupon has
appliesToSkus, verify cart contains these SKUs9
Currency supported
Order currency must be supported by the coupon
Validation Errors
Usage History
Each coupon/promo code usage is recorded inCouponRedemption:
- Auditing of granted discounts
- Promotion performance analysis
- Verification of uses per customer
Discount Calculation
Percentage Discount
Fixed Amount Discount
Complete Example
API Responses
- Coupon
- Promo Code
Common Operations
Create a coupon
Create a promo code
Validate a promo code
Deactivate a promo code
Best Practices
Code naming
Code naming
- Use memorable and easy-to-type codes
- Avoid ambiguous characters (0/O, 1/l)
- Include context:
SUMMER20,WELCOME15,VIP50 - Keep codes short (6-12 characters)
Limits and expirations
Limits and expirations
- Always define a limit (
maxRedemptionsorexpiresAt) - Unlimited promotions can impact your margins
- Plan a safety margin on limits
Performance tracking
Performance tracking
- Analyze
CouponRedemptionregularly - Measure conversion rate per code
- Compare performance of different promotions
Communication
Communication
- Clearly display usage conditions
- Indicate expiration date to customers
- Explain why a code is rejected
Use Case Examples
- Welcome Offer
- Black Friday
- VIP Program
- Discounted Subscription
Next Steps
Create a checkout session
Use promo codes in your checkout sessions
Webhooks
Receive notifications when promo codes are used