Taking payment for tickets that can only be sold once
The backend behind a prize-draw app. A user reserves ticket numbers and pays. They either get their tickets, or the reservation is released, and nothing is left half-done.
DrawApp - Taking payment for tickets that can only be sold onceThe challenge
There are only so many ticket numbers, so a reservation has to hold real tickets while the payment company finishes the payment. If the payment fails, is cancelled or never comes back, those tickets must be released every time. One single buy step can't do that. And the app on the phone can't be trusted to decide whether the payment worked, because a phone app that decides that for itself can be tricked into issuing free tickets.
Consumer transactional. DrawApp.
Our approach
We split buying into three clear steps, reserve, confirm and cancel, so tickets are never held by accident while a request is still in progress. The server checks the payment with the payment company before any ticket is issued. The app reports what happened and never decides it. Refunds run in the background so a slow payment company can't hold up a user. The API is described in an OpenAPI file, so the mobile app and the server can't quietly drift apart.
Designed and built end to end.
What we built
- Phone number login with a one-time code (Firebase), swapped on the server for a secure access token (Laravel Sanctum)
- Reserve, pay, then issue tickets, with tickets released automatically if anything fails
- Razorpay payments checked on the server, with refunds run in the background
- Admin panel for draws, orders, users, banners, FAQs and notifications
- In-app bug reports, support ticketing, and account deletion that meets app store rules
- A way to make users update to the latest version of the app
The results
Built and documented across the whole draw, from sign-up with a one-time code to ticket issue and refunds.
3 steps: reserve, confirm, cancel
A travel website built around the trip dates
Got something like this to build?
Tell us what you're working on and what's slowing you down. A short call is usually enough to know whether we're the right fit - no proposal required first.


