Gift Cards
Sell gift cards that arrive on time and redeem cleanly against a real order total.
What it adds
Purchasable gift cards with a delivered code, a tracked balance, and redemption applied at checkout alongside other payment.
What your agent is told to do
5
What your agent is told to do
5-
1
Treat a gift card as a balance with an immutable ledger of transactions, not a mutable number. Issue, redeem, refund, and expire are all entries; the balance is their sum, which makes every discrepancy traceable.
-
2
Generate codes that cannot be guessed or enumerated, store only a hash of the code, and show the full code once at purchase and in the delivery email. A recoverable code is a recoverable bearer instrument.
-
3
Apply a card at checkout as payment, not as a discount. It reduces the amount due after tax and shipping are calculated, and the remainder goes to the card or wallet on file.
-
4
If the app already has Credit Balance or Coupon and Promotion Codes, extend the balance ledger and the checkout payment step rather than adding a parallel one. A gift card is a funded balance; a promotion code is a price rule, and conflating them breaks refunds.
-
5
Do not let redemption be validated on the client. Every application of a card must be a server-side operation that locks the card row, checks the balance, and records the entry atomically.
Edge cases it handles
8
Edge cases it handles
8- Two checkouts using the same card at once must not both succeed against the same funds. Serialise redemptions on the card record and make the balance check and the ledger write a single atomic operation so the balance can never go negative.
- A card rarely covers the whole order. Support partial redemption where the card supplies what it has and the remainder is charged to a payment method, and make the split visible on the order and the receipt.
- Refunding an order paid partly by gift card must return the card portion to the card and the charged portion to the payment method. Refunding the whole amount to the card, or to the card holder's payment method, quietly creates or destroys money.
- Delivery can be scheduled for a future date, which means the send can fail long after the buyer has gone. Handle a bounced or rejected recipient address by notifying the buyer with the code so the gift is not simply lost.
- Expiry and dormancy rules differ by jurisdiction and in several places gift card funds may not expire at all. Make expiry configurable rather than hardcoded, keep the balance recoverable after the nominal expiry date, and record which rule applied.
- A card bought and then refunded before delivery must be voided, and a code that has already been sent must be handled as compromised rather than reissued to the same recipient.
- Repeated code entry attempts must be rate limited. Without it, the checkout field is a brute-force oracle against every card you have ever issued.
- The recipient may not have an account. Redemption must work for a guest checkout and must not require registration to spend a balance someone already paid for.
Definition of done
9
Definition of done
9- Every issue, redemption, refund, and adjustment appears as a ledger entry and the balance is their sum.
- Concurrent redemptions cannot take the balance below zero.
- A partial redemption charges the remainder to a payment method and shows the split on the order.
- Refunds return the gift card portion to the card and the charged portion to the original payment method.
- Scheduled delivery sends on the chosen date and a bounce notifies the buyer with the code.
- Codes are stored hashed, rate limited on entry, and unguessable.
- Expiry rules are configurable and the balance is not silently destroyed.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Usage Limits
Usage Limits
Cap what free accounts can do — visibly and fairly.
What it does
Per-plan usage limits, enforced server-side, with the user always able to see where they stand.
How it works
- 1 Define limits per plan in one place. Do not scatter magic numbers through the codebase.
- 2 Enforce on the server at the point of creation. A client-side check is decoration.
- 3 Show current usage BEFORE the user hits the wall — surprise limits feel like a bug.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/usage-limits
Upgrade Modal
Upgrade Modal
Sell the upgrade at the exact moment someone wants it.
What it does
A focused upsell that appears when a free user reaches for a paid capability.
How it works
- 1 Trigger it at the point of intent — when they click the locked thing — not on a timer or on page load.
- 2 Name the specific feature they just tried to use. A generic pricing modal converts far worse.
- 3 State the price plainly and give one button to upgrade.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/upgrade-modal
Billing Portal
Billing Portal
Let people manage their own subscription.
What it does
A billing area where users can see their plan, change payment method, get invoices, and cancel.
How it works
- 1 Use the payment provider's hosted billing portal if it has one. Do not rebuild card management — it's a PCI liability you don't need.
- 2 Show the current plan, renewal date, and payment method on your own account page.
- 3 Make cancelling possible without emailing support. Dark patterns here generate chargebacks.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/billing-portal
How it works
-
1
Copy the link
Grab the Markdown instruction URL for this feature.
-
2
Give it to your AI
Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.
-
3
It inspects, then implements
Your agent reads your existing app first, then adds the feature to fit it.
Works with your stack
These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.
Need it tighter than that? Customize the feature and tell it exactly what you're running.