Skip to main content

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_20percent

Coupon Attributes

Discount Types

Percentage Discount

Applies a percentage discount on the total amount.
Example: 20% on a €100 cart = €80 to pay

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:
If appliesToSkus is defined, the discount only applies to the listed SKUs. Other cart items don’t get the discount.

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_public

Promo Code Attributes

Create a Promo Code

The code is automatically converted to uppercase. summer20 becomes SUMMER20.

Advanced Restrictions

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 true
2

Not expired

Current date must be before expiresAt
3

Limit not reached

timesRedeemed must be less than maxRedemptions
4

Coupon valid

Associated coupon must be valid (valid: true)
5

Minimum amount

Cart must reach minimumAmount if defined
6

First purchase

If firstTimeTransaction, verify it’s the first order
7

Customer authorized

If customerIds defined, verify customer is in the list
8

Eligible SKUs

If coupon has appliesToSkus, verify cart contains these SKUs
9

Currency supported

Order currency must be supported by the coupon

Validation Errors


Usage History

Each coupon/promo code usage is recorded in CouponRedemption:
This history allows:
  • Auditing of granted discounts
  • Promotion performance analysis
  • Verification of uses per customer

Discount Calculation

Percentage Discount

Fixed Amount Discount

Complete Example


API Responses


Common Operations

Create a coupon

Create a promo code

Validate a promo code

Deactivate a promo code


Best Practices

  • 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)
  • Always define a limit (maxRedemptions or expiresAt)
  • Unlimited promotions can impact your margins
  • Plan a safety margin on limits
  • Analyze CouponRedemption regularly
  • Measure conversion rate per code
  • Compare performance of different promotions
  • Clearly display usage conditions
  • Indicate expiration date to customers
  • Explain why a code is rejected

Use Case Examples

Result: -€10 for new customers with cart > €30

Next Steps

Create a checkout session

Use promo codes in your checkout sessions

Webhooks

Receive notifications when promo codes are used