Store credit
Stub — full content forthcoming.
Store credit is currency you hold on Cambridge TCG that can be spent at checkout. It is recorded in the store_credit_ledger table — every grant and spend is an append-only ledger row, with a balance_after column you can reconcile against.
Where this lives in code. The ledger isstore_credit_ledger; the balance cache isusers.store_credit_balance; spend at checkout is a one-shot Stripe coupon applied during the checkout session.
How credit is earned
- Cashback on B2C orders — % of the line total per your membership tier.
- Trade-in (credit option) — accept the credit quote instead of cash.
- Bounty sell-back — sell a vault item back to the platform for 77% spot price.
- Refunds to credit — when applicable, refunds may be issued as credit.
- Liquidity mining — the market-maker incentive program (if active).
- Operator grants — staff or retention adjustments.
How credit is spent
Credit is applied at checkout as a one-shot Stripe coupon for the available balance (or the order total, whichever is smaller). The deduction happens on checkout.session.completed via the Stripe webhook.
Credit cannot be cashed out. It is non-transferable (no gifting between accounts) and does not expire today, though that policy may change — the change would land here in the same PR.