Skip to content

Promotion Codes

What This Is

Promotion Codes are the shopper-facing keys that activate a promotion in cart. They belong to a promotion and define the usage limits for that redemption path.

When You Would Use It

Use Promotion Codes when you need to:

  • create a public or private code for a promotion
  • generate many codes at once for a campaign
  • limit how many times a code can be used
  • control how many times each customer can use that code

Do not use a code when the underlying promotion itself is not ready. A code cannot fix a misconfigured promotion.

Before You Start

Before you create or edit a code, make sure:

  • the parent promotion already exists
  • you know whether you need one code or a bulk-generated set
  • you know the usage rules for the campaign

How To Use It In The Admin

  1. Open the parent promotion.
  2. Go to the Codes block.
  3. Choose whether you want:
    • a single code
    • a bulk code set with a prefix
  4. Enter the code or prefix.
  5. Set optional limits:
    • total usage limit
    • usage limit per customer
  6. Save the code or codes.
  7. Use the code details dialog later if you need to edit limits or review redemptions.

What It Changes In The Storefront

Promotion Codes affect:

  • whether a shopper can apply a discount in cart
  • whether the discount succeeds or is rejected
  • the redemption history attached to that promotion

Common Tasks

Create a single code

Use this for one named campaign code such as SUMMER20.

Generate codes in bulk

Use prefix mode when you need many unique codes from one promotion.

Update a code

Use the code details dialog to change the code or its limits.

Review redemptions

Use the code details dialog to inspect how the code has been used.

Import or export codes

Use the promotions Excel workbook when you need bulk review or maintenance.

Rules, Limits, And Things To Watch

  • Codes must be unique.
  • A valid code can still fail if the parent promotion is inactive, expired, not combinable, or not eligible for the current order.
  • Per-customer limits are evaluated against the customer account's user set, not just one user login.

Troubleshooting

The code exists, but it does not apply

Check the parent promotion first: active state, date range, conditions, shipping cutoff, and combinability.

The code was used once and now fails

Check whether the global or per-customer usage limit has been reached.

I need many codes quickly

Use bulk mode with a prefix instead of creating each code manually.

Sources

  • packages/admin/src/Livewire/Admin/Settings/Promotion/Codes/CreateDialog.php
  • packages/admin/src/Livewire/Admin/Settings/Promotion/Codes/DetailsDialog.php
  • packages/admin/src/Livewire/Admin/Settings/Promotion/Codes/Block.php
  • packages/framework/src/Services/Promotion/PromotionCodeService.php
  • packages/framework/src/Models/PromotionCode.php
  • packages/framework/src/Imports/Promotions/PromotionCodesSheetImport.php
  • packages/storefront/src/Livewire/Storefront/Cart/PromotionSection.php