The challenge
The business had outgrown its first website. It needed one system to run a card scheme with three groups of users, each wanting something different.
- Card buyers and families needed to buy cards in shops and online, check balances and find classes their children could use them on.
- Activity providers, often small independent businesses, needed a simple way to list classes, accept cards and see what they were owed.
- The operations and finance team needed to manage card stock, reconcile sales from several retail and digital partners, pay providers on time and report accurately.
The card had to be sold through national retail and digital gift card networks. Each network had its own API, file formats and certification rules, and none of them could be allowed to issue or activate a card incorrectly. Years of data from the old site also had to move across without disrupting live customers.
The solution
I built a single headless platform. One back end serves every audience through its own interface: a back office, a provider portal and an API for the public website and outside partners.
Back office
Staff manage card stock, orders, cardholders, providers, classes, promotional codes and gift items. Card numbers and PINs are generated in batches, assigned in bulk and tracked through their whole life, from creation to sale, activation, redemption and expiry.
Provider portal
Providers sign up, list venues, classes, prices and timetables, and answer enquiries from families. They redeem cards, see their balance and download remittances. Bulk spreadsheet imports let large providers load hundreds of classes at once.
Website and partner APIs
A versioned REST API feeds class search and online ordering to the public website. Separate endpoints let gift card networks and digital distributors request, activate and void cards in real time.
Automation
More than 20 scheduled jobs handle the routine work. They generate cards overnight, pick up partner sales files every 15 minutes, send fortnightly provider redemption statements and monthly referral commissions, and chase unanswered enquiries.
Architecture and integrations
Every audience reaches the same core through its own entry point, so card rules live in one place.
The public website and partner systems connect only through the versioned API. Background jobs handle all slow or scheduled work, so partner calls stay fast.
Reliability, security and compliance
A gift card is stored money, so every design decision put correctness first.
- Certified partner integrations. Retail network endpoints are built to each network's certification spec. Any refactor is checked against the certified version with equivalence tests that replay recorded partner requests.
- Unique, collision-safe card numbers. Every card number and PIN pair is unique, and generation runs in bounded batches so a large order cannot exhaust server resources.
- Locked-down APIs. Partners authenticate with per-client credentials. Each client also has its own IP allowlist, and credentials can be rotated without downtime. Plain-text secrets were removed from storage.
- Account security. Portal users can sign in with SMS two-factor authentication and have role-based permissions.
- Observability. Error tracking, partner connection logging and automated file checks catch failed activations and missing data before customers notice.
- Tested and type-checked. Feature tests cover cards, redemptions, billing, reports and the REST API, with front-end component tests and static analysis on the PHP code.
Outcomes
The business now runs its whole card scheme from one platform, from issuing a card to paying the provider who accepts it.
- Multi-channel distribution. The card sells through national high-street retail networks and digital gift card platforms, as well as directly online.
- Less manual work. Partner sales, provider statements, commissions and accounting sync run on a schedule instead of by hand.
- Faster provider onboarding. Self-service sign-up and bulk imports let providers go live without staff keying in their data.
- Finance the team can trust. Outstanding balances, redemption reports and accounting exports come from the same source of truth.
- Room to grow. The headless design lets the public website be rebuilt, or new partners added, without touching core card logic.
Technology
| Back end | PHP 8.4, Laravel, queued jobs and scheduler |
|---|---|
| Front end | Vue 3 single-page app, Vite, Bootstrap, rich-text editing |
| Data | PostgreSQL, Redis for cache and queues |
| Real time | WebSocket broadcasting for live notifications |
| Infrastructure | Docker, a single lean web server with PHP-FPM, process supervision |
| Quality | PHPUnit feature tests, Vitest component tests, static analysis, auto-generated API docs |
| Integrations | Retail and digital gift card networks, payments, accounting, email marketing, SMS, live chat, mapping |