gift-cards

Implement gift card issuance, redemption, and ledger-based balance tracking across ecommerce platforms.

3|1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/tomtoto757/ecomm-ai-team --skill gift-cards-tomtoto757
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gift-cards
Source: https://github.com/tomtoto757/ecomm-ai-team/tree/main/skills/pricing-promotions-loyalty/finsilabs/pricing-promotions/gift-cards
Command: npx skills add https://github.com/tomtoto757/ecomm-ai-team --skill gift-cards-tomtoto757

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Selling and accepting gift cards requires secure code generation, accurate balance tracking across partial redemptions, and protection against race conditions — mistakes here create accounting liabilities and lost customer funds. ## Core Features & Use Cases - Platform Setup Guidance: Step-by-step configuration for Shopify, WooCommerce, and BigCommerce native gift card features, including refund-to-gift-card flows. - Custom Ledger Implementation: SQL schema and TypeScript code for an append-only ledger with row-level locking to prevent concurrent over-redemption. - Use Case: A headless storefront needs gift cards with partial redemption. Use this Skill to build a ledger-based system where a $100 card can cover $60 of an order, with the remaining $40 tracked via immutable transaction rows. ## Quick Start Use the gift-cards skill to implement a gift card system with secure code generation and partial redemption support for my custom storefront.

Frequently Asked Questions about gift-cards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add gift cards to my Shopify store?▼

Shopify includes native gift cards on all plans except Basic. Go to Products → Gift cards in your admin, add a gift card product with denominations as variants, and Shopify automatically generates and emails codes on purchase.

How to implement gift card partial redemption in a custom storefront?▼

Use an append-only ledger table recording every debit and credit, and compute balance by summing transactions. Apply Math.min(balance, orderTotal) inside a transaction with SELECT FOR UPDATE row locking to cap the redemption safely.

Does WooCommerce support gift cards natively?▼

Core WooCommerce does not include gift cards. Use the official WooCommerce Gift Cards extension (~$49/year) or YITH WooCommerce Gift Cards (~$80/year), both of which support email delivery, partial redemption, and balance inquiry shortcodes.

Why does the same gift card get redeemed twice during concurrent checkouts?▼

This race condition happens when balance is read and the debit is inserted as separate steps without locking. Fix it by wrapping redemption in a database transaction with SELECT ... FOR UPDATE on the card row before reading the balance.

Can gift cards legally have expiration dates?▼

Many US states and other jurisdictions restrict or prohibit gift card expiration. Check local regulations before enabling expiry dates, and ensure your implementation enforces expiration at balance lookup time.

How should gift card codes be generated securely?▼

Generate codes with cryptographically secure randomness (crypto.randomBytes, not Math.random), omit ambiguous characters like 0, O, 1, and I, and never expose full codes in URLs or server logs.