Skip to main content
Version: 2.0.0

Gift Cards

Navigate to yStore → Marketing → Gift Cards.

yStore has a complete gift card system that handles the full lifecycle: create gift card products in the catalog, sell them at checkout, auto-generate PDF vouchers, deliver codes by email, and let customers redeem balances at checkout. All code generation, balance tracking, and PDF creation happens automatically.

Enterprise feature

Gift card functionality requires the yStore Enterprise edition.


Overview


The three tabs

Lists all generated gift card codes across all purchases.

ColumnDescription
CodeThe unique redemption code
BalanceCurrent remaining value
Initial valueOriginal card value at generation time
Statusactive / redeemed / expired / disabled
CustomerAccount linked to this code, if any
OrderThe order this code was generated for
ExpiresExpiry date (if configured), or — for no expiry

Actions available from this tab:

  • Search and filter by code, status, customer, or date
  • Click a code to view its full transaction history (every partial redemption)
  • Disable a code immediately (e.g., for fraud cases)
  • Export the full list as CSV

How a gift card purchase works

  1. Customer adds a gift card product to the cart and completes checkout.
  2. yStore generates a unique code automatically as a background queue job.
  3. The code is stored in the Codes tab with its full initial value.
  4. The PDF voucher is generated using the design assigned to the product.
  5. A delivery email is sent to the purchaser's email (or a recipient email if you collect one at checkout) with the code and PDF attached.
Generation is asynchronous

Code generation runs as a queue job after order completion. On a busy server, there may be a short delay between order placement and email delivery. If a customer reports not receiving their code, check yStore → Jobs for any stuck or failed queue jobs.


How redemption works

At checkout, customers enter their gift card code in the payment step.

  1. The system validates the code: active status, not expired, balance > 0.
  2. The available balance is applied as a discount on the order total.
  3. If the order total exceeds the balance, the remainder is charged to the selected payment method.
  4. After the order is placed, the code balance is reduced by the amount used.
  5. If balance reaches €0, the code status changes to redeemed.
Partial redemption

Gift cards support partial redemption. A €50 card used on a €30 order retains a €20 balance and can be used again on a future order.


Configuration

Go to yStore → Settings → Sales → Marketing → Gift Cards.

SettingDescription
Code lengthNumber of characters in generated codes
Code formatCharacter set: alphanumeric, numeric, or alpha-only
Code prefixOptional prefix prepended to all codes, e.g. GC-
Default expiry (days)Days from purchase until the code expires; set 0 for no expiry
Email templateThe email template used for the delivery email
Allow combined paymentWhether customers can pay part gift card + part payment method

Manual code generation (CLI)

You can generate codes outside the normal purchase flow — for example, to issue a refund as a gift card or to create promotional codes.

# Generate 10 codes worth €50 each in EUR
php craft yui/gift-card/generate --amount=50 --currency=EUR --count=10

# Generate with a specific design
php craft yui/gift-card/generate --amount=100 --currency=EUR --count=5 --design=corporate

# Output codes to a CSV file
php craft yui/gift-card/generate --amount=25 --currency=EUR --count=100 --output=/tmp/codes.csv

Generated codes are stored in the Codes tab and are immediately redeemable. They are not linked to any order.


Disabling a code

If a gift card code is reported stolen, fraudulently obtained, or needs to be invalidated:

  1. Go to yStore → Marketing → Gift Cards → Codes.
  2. Search for the code.
  3. Open the code detail and click Disable.

The code is immediately marked as disabled and cannot be redeemed. The remaining balance is frozen — it is not automatically transferred. If you need to re-issue the balance, generate a new code manually via the CLI.


Gift cards and flows

Gift cards can be integrated into automation flows:

Flow actionWhat it does
Create Coupon → [gift card coupon type]Issue a gift card code as a promotional reward

Additionally, the gift card purchase order fires the standard Order Placed trigger, so you can build post-purchase flows that fire specifically for gift card orders by adding an Order Contains Product condition filtered to your gift card product.

See Flow Manager for details.


Common questions

Q: Can a customer have multiple gift card codes? Yes. Customers can hold and redeem multiple codes. At checkout they enter one code at a time; each applies its balance in sequence if multiple are used across multiple checkouts.

Q: What happens if the gift card product is deleted? Generated codes remain active and redeemable. The code record retains the original order and value regardless of whether the source product still exists.

Q: Can gift cards be used with coupons? Yes, unless the active coupon has exclusivity enabled. Gift card redemption and coupon discounts are independent — the gift card applies first, then the coupon discount, then the remaining balance is charged.

Q: Are gift cards taxable? In most jurisdictions, gift cards are not taxable at purchase — tax is collected when the card is redeemed and the underlying goods are purchased. Consult your accountant for your specific setup. yStore records the redemption amount per order for reporting purposes.