Skip to main content

Coupon Code

Coupon Code allows customers to apply promotional or gift card discounts during checkout in ERPNext’s eCommerce store. Coupon codes work together with Pricing Rules to automatically apply eligible discounts and help businesses run promotional campaigns, marketing offers, and customer reward programs.

Summary

  • Create promotional or gift card coupon codes.
  • Link coupons with Coupon Code Based Pricing Rules.
  • Control coupon validity, usage limits, and descriptions.
  • Customers can apply coupons manually or through promotional URLs.
  • Discounts are automatically calculated during checkout.

Prerequisites

Before creating Coupon Codes, ensure the following requirements are completed:

  • Enable Show Apply Coupon Code in E Commerce Settings.
  • Create a Pricing Rule with the Coupon Code Based option enabled.
Tip

A coupon does not apply discounts by itself. It must always be linked to a Pricing Rule that defines the actual discount amount or percentage.

How to Create a Coupon Code

  1. Open the Coupon Code list.
  2. Click New.
  3. Enter a Coupon Name (for example, SAVE20).
  4. Select a Coupon Type.
    • Promotional – Used for public marketing campaigns.
    • Gift Card – Generates a unique random code for individual customers.
  5. The system automatically generates a unique Coupon Code.
    • Promotional codes remove spaces and use the first eight characters of the coupon name.
    • Example: SAVE20
    • Gift Card codes are automatically generated as random 11-character values.
    • Example: AP48K7CT9LP
  6. Select the Pricing Rule that has the Coupon Code Based option enabled.
  7. Save the document.

Coupon Features

1. Validity Period

You can define when a coupon becomes active and when it expires.

  • Valid From — Starting date of the promotion.
  • Valid To — Expiration date after which the coupon becomes invalid.

2. Usage Limits

Coupons can be restricted to prevent unlimited use.

  • Maximum Use limits how many times the coupon may be redeemed.
  • Used automatically tracks the number of successful redemptions.

3. Coupon Description

The Coupon Code Description field can store promotional text explaining the offer. This description can also be reused in email templates and marketing campaigns.

Example

Coupon Name: Summer Sale
Coupon Code: SUMMERS
Discount: 20% Off
Maximum Uses: 500
Validity: 1 June – 30 June

Applying Coupon Codes

Customers can redeem coupon codes in two different ways.

Method 1: Automatically Through URL

Coupon codes can be included as a URL parameter in promotional emails, advertisements, or social media campaigns.

Example:

https://yourstore.com/products/golden-ring?cc=SAVE5

When the customer opens this link, ERPNext automatically fills the coupon code in the checkout page.

Method 2: Manual Entry

Customers can manually enter the coupon code in the Apply Coupon Code field during checkout and click Apply Coupon Code.

If the coupon is valid, ERPNext immediately recalculates the order total and applies the corresponding Pricing Rule discount.

Result

After successful validation, the shopping cart updates automatically to reflect the discounted price before the customer places the order.

Coupon Types

Coupon Type Purpose Code Generation
Promotional General marketing campaigns available to multiple customers. Generated from the coupon name.
Gift Card Individual rewards and customer-specific promotions. Randomly generated unique code.
Note

  • Coupon codes only work when the associated Pricing Rule is active.
  • Expired or fully used coupons cannot be redeemed.
  • Each successful Sales Order automatically increments the coupon usage count.
  • Coupon discounts are calculated before order submission.

Best Practices

  • Use Promotional coupons for seasonal sales and marketing campaigns.
  • Use Gift Card coupons for customer loyalty rewards and one-time offers.
  • Set expiry dates to prevent outdated promotions from remaining active.
  • Configure usage limits to control promotional budgets.
  • Include coupon URLs in marketing emails for a smoother shopping experience.
Rating: 0 / 5 (0 votes)