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

FieldTypeDescription
CodestringCoupon code
Discount TypeselectType of discount
AmountnumberDiscount value

Optional Fields

FieldTypeDescription
DescriptionstringInternal description
Expiry DatedateWhen coupon expires
Usage LimitintegerTotal uses allowed
Usage Limit Per UserintegerUses per customer
Minimum SpendnumberMinimum order total
Maximum SpendnumberMaximum order total
Individual UsebooleanCan’t combine with others
Exclude Sale ItemsbooleanDon’t apply to sale items
Product IDsarrayRestrict to products
Category IDsarrayRestrict to categories
Email RestrictionsarrayAllowed email addresses
Free ShippingbooleanInclude free shipping

Discount Types

TypeDescription
percentPercentage discount
fixed_cartFixed cart discount
fixed_productFixed 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

VariableTypeDescription
{{Action.coupon_id}}integerCreated coupon ID
{{Action.code}}stringCoupon code
{{Action.amount}}stringDiscount amount

Common Workflows

Welcome Coupon

  1. Trigger: User Registered
  2. Action: Create Coupon
    • Code: Welcome + user ID
    • Amount: 10%
  3. Action: Send Email
    • Include coupon code

Post-Purchase Reward

  1. Trigger: Order Completed
  2. Action: Create Coupon
    • Personalized code
    • Limited time
  3. Action: Send Email
    • Thank you + coupon

Referral Program

  1. Trigger: Referral completed
  2. Action: Create Coupon
    • Referrer reward
  3. Action: Create Coupon
    • Referee reward

Best Practices

  • Use unique codes per customer
  • Set reasonable expiration dates
  • Limit usage to prevent abuse
  • Track coupon performance