Use Case
When a customer places an order, you want to immediately generate a coupon for them. This can be a referral code to share, an upsell incentive, or a reward for their purchase.
Common scenarios:
- Referral code for sharing with friends
- “Add more items” discount before shipping
- First-time buyer reward
- Order-specific promotional codes
- Bundle completion incentives
Step-by-Step Setup
1. Create a New Workflow
Navigate to Sequensy → Workflows in your WordPress admin and click Add New Workflow.
Name your workflow “Order Referral Code Generator” or “Instant Purchase Reward”.
2. Configure the Trigger
Select Order Created as your trigger.
Useful filters:
- First Order: Only for new customers
- Products: Specific products that trigger referrals
- Order Total: Minimum spend for rewards
- Customer Type: New vs returning
3. Set Up the Create Coupon Action
Configure your coupon:
| Setting | Recommended Value | Description |
|---|---|---|
| Coupon Code | REF-{customer_id} | Unique referral code |
| Discount Type | Percentage | 15% off |
| Discount Amount | 15 | For referral recipients |
| Usage Limit | Unlimited | Or set per-referral limits |
| Expiry | None | Permanent referral code |
4. Deliver the Coupon
Chain a Send Email action:
Subject: Share this code & earn rewards!
Hi {billing_first_name},
Thanks for your order! Here's your personal referral code:
{coupon_code}
Share it with friends and family:
- They get 15% off their first order
- You'll earn $10 store credit for each referral
Share now: {referral_share_url}
Your order #{order_id} is being processed—we'll send tracking
soon!
5. Test Your Workflow
- Enable the workflow
- Place a test order
- Verify coupon was created
- Check email with referral code
- Test the coupon works
Pro Tips
Referral tracking: Use customer ID in coupon codes to track who referred whom.
Two-way rewards: Create a system where both referrer and referee benefit.
Permanent codes: For referrals, don’t set expiry—let customers share anytime.
Fraud prevention: Add minimum order requirements to prevent coupon abuse.
Coupon Strategies
Referral Program
Code: FRIEND-{customer_id}
Discount: 15% off for new customers
Referrer Reward: $10 credit per use
Tracking: Link coupon uses to referrer
Add-On Incentive
Code: ADDON-{order_id}
Discount: 20% off next item
Expiry: 24 hours
Message: "Add to your order before it ships!"
First Purchase Thank You
Code: THANKS-{order_id}
Discount: $5 off next order
Min Order: $25
Expiry: 30 days
Bundle Completion
Trigger: Purchased Product A
Code: COMPLETE-{order_id}
Discount: 25% off Product B
Message: "Complete your set!"
Referral Program Setup
Structure
| Party | Benefit |
|---|---|
| New Customer (Referee) | 15% off first order |
| Existing Customer (Referrer) | $10 credit per referral |
Implementation
1. Order Created → Generate referral code
2. Track code usage via coupon analytics
3. When code used:
- Apply discount to new customer
- Credit referrer's account
Email Template
Subject: Your personal referral code is ready!
Hi {first_name},
You now have your own referral code to share:
YOUR CODE: {coupon_code}
🎁 Your friends get: 15% off their first order
💰 You get: $10 credit for each friend who orders
Easy sharing:
- Email: Forward this message
- Social: {social_share_links}
- Copy: {coupon_code}
Start sharing: {referral_dashboard_url}
Troubleshooting
Coupon not created?
- Verify WooCommerce is active
- Check workflow is enabled
- Review coupon settings
Duplicate codes?
- Use order ID or customer ID for uniqueness
- Check for multiple workflow triggers
- Review coupon code generation
Referral not tracking?
- Verify coupon usage is logged
- Check attribution system
- Review referrer credit workflow