Create Coupon
Generate WooCommerce discount coupons automatically.
Overview
The Create Coupon action generates a new WooCommerce coupon code. This is powerful for automated promotions, loyalty rewards, and personalized discounts.
Configuration
Required Fields
| Field | Type | Description |
|---|
| Code | string | Coupon code |
| Discount Type | select | Type of discount |
| Amount | number | Discount value |
Optional Fields
| Field | Type | Description |
|---|
| Description | string | Internal description |
| Expiry Date | date | When coupon expires |
| Usage Limit | integer | Total uses allowed |
| Usage Limit Per User | integer | Uses per customer |
| Minimum Spend | number | Minimum order total |
| Maximum Spend | number | Maximum order total |
| Individual Use | boolean | Can’t combine with others |
| Exclude Sale Items | boolean | Don’t apply to sale items |
| Product IDs | array | Restrict to products |
| Category IDs | array | Restrict to categories |
| Email Restrictions | array | Allowed email addresses |
| Free Shipping | boolean | Include free shipping |
Discount Types
| Type | Description |
|---|
percent | Percentage discount |
fixed_cart | Fixed cart discount |
fixed_product | Fixed product discount |
Example Configurations
Welcome Discount
Code: WELCOME-{{Trigger.user_id}}
Discount Type: percent
Amount: 10
Usage Limit: 1
Usage Limit Per User: 1
Expiry Date: +30 days
Email Restrictions: {{Trigger.user_email}}
Order Thank You
Code: THANKS-{{Trigger.order_number}}
Discount Type: fixed_cart
Amount: 5
Minimum Spend: 25
Usage Limit: 1
Expiry Date: +14 days
Email Restrictions: {{Trigger.billing.email}}
VIP Discount
Code: VIP-{{random:8}}
Discount Type: percent
Amount: 20
Free Shipping: true
Individual Use: false
Expiry Date: +7 days
Product-Specific
Code: PRODUCT10
Discount Type: fixed_product
Amount: 10
Product IDs: [123, 456]
Exclude Sale Items: true
Dynamic Codes
Generate unique codes using variables:
WELCOME-{{Trigger.user_id}} → WELCOME-42
THANKS-{{Trigger.order_number}} → THANKS-1234
LOYALTY-{{random:6}} → LOYALTY-A3X9K2
{{date:YMMDD}}-{{random:4}} → 231215-B7K2
Output Data
| Variable | Type | Description |
|---|
{{Action.coupon_id}} | integer | Created coupon ID |
{{Action.code}} | string | Coupon code |
{{Action.amount}} | string | Discount amount |
Common Workflows
Welcome Coupon
- Trigger: User Registered
- Action: Create Coupon
- Code: Welcome + user ID
- Amount: 10%
- Action: Send Email
Post-Purchase Reward
- Trigger: Order Completed
- Action: Create Coupon
- Personalized code
- Limited time
- Action: Send Email
Referral Program
- Trigger: Referral completed
- Action: Create Coupon
- Action: Create Coupon
Best Practices
- Use unique codes per customer
- Set reasonable expiration dates
- Limit usage to prevent abuse
- Track coupon performance