A member walks up to a clinic reception in Riyadh, hands over a plastic discount card, and the receptionist asks the question every card business dreads: "Is this still valid?" The next ten minutes are a phone call to head office while a patient waits.
Short answer: a medical discount card app moves the card, the clinic network and the purchase into the member's phone. Members subscribe (with family members) and pay in the app, carry a digital card with a QR code, find participating clinics sorted by distance, and buy clinic services in advance with identity checks, Buy Now Pay Later and the correct VAT for Saudi and non-Saudi buyers.
The business problem
Membership and discount-card businesses (medical networks, loyalty programs, employee benefits) usually start with a printed card, a PDF list of partner clinics, and a call center for everything else. That stops working once the network spans regions and cities.
The costs show up in three places:
- At the counter. Nobody at the desk can confirm the membership is active, so discounts get disputed or refused. A card the clinic doesn't trust is a card the member stops renewing.
- In discovery. Partner lists go stale the month they are printed. Members don't know which clinic near them is in the network, so they don't use the card, and an unused card doesn't get renewed either.
- In revenue. The card is sold once a year. The consultations, lab tests and dental work between renewals earn the card business nothing.
Takaful Golden, a Saudi medical discount card, is a clear example. The product describes itself honestly in the app: a discount card, not health insurance, open to citizens, residents and visitors, with discounts that vary by center. The challenge was to make that promise usable on a phone.
Your options
| Option | What you get | Trade-off |
|---|---|---|
| Keep plastic cards, add a website directory | Cheapest to start | Validity still can't be checked at the counter; directory still goes stale |
| White-label membership app | Fast launch, standard screens | Hard to fit your plans, family cards, Arabic quality and local payment methods |
| Custom app on your own backend | Card, network and store shaped around your business | Higher upfront investment; you need a team that will own quality over years |
| Custom app plus an in-app store | Revenue between renewals from clinic services | Adds payments, identity checks, VAT rules and clinic-facing paperwork |
The last row is easy to underestimate. Selling clinic services in the app creates revenue between renewals, and it also makes you a merchant, with everything that implies in Saudi Arabia.
How we built it in Takaful Golden
Takaful Golden is a Flutter app for iOS and Android, Arabic-first with a full English version, backed by the client's Laravel API. Our team builds and maintains it, and the app is organized around four jobs.
1. Get a member to their region before anything else. On first run, every route redirects to a region picker until the member chooses one, so the home screen never loads without a location to filter the network by. Members sign in with their national ID, and several accounts can be saved on one phone. A parent who manages cards for the family switches between them instantly, without signing in again, as long as that account's session is still valid.
2. Sell the card without a call center. The member picks a plan, fills in the main cardholder's details, and adds the extra cards the plan includes (a name and ID for each family member). They can pay online through PayTabs' hosted payment page inside a WebView, or choose to pay on delivery. After an online payment, the app asks the backend to confirm the result rather than trusting the redirect alone.
3. Make the card something a receptionist believes. The digital card carries a QR code and can be exported as a printable certificate PDF. On screen it behaves like a physical card: it flies in, tilts under your finger or with the phone's motion sensor, catches the light, and flips on tap to show the back. That is the moment a member shows the card across a desk, so it has to look official. For users who turn on reduced motion, the tilt, glare and shine switch off and the flip becomes instant.
the animated membership card flying in, tilting, and flipping to the back with the QR code
4. Find the nearest clinic and buy from it. The network list shows the distance to each clinic and sorts nearest first. A separate store module lets a verified cardholder buy clinic offers in advance, pay with Tabby, and receive an authorisation letter to present at the clinic.
We built and run the whole system behind these screens: the Flutter app for members, and the Laravel and MySQL backend that issues cards, manages the clinic network and offers, and processes payments.
Under the hood: distance that doesn't lie
Showing distance to each clinic sounds simple. It has more failure modes than it looks.
permission check ──► denied forever? ──► show "open settings", no prompt loop
│
▼ granted
last known fix (instant) ──► show distances now
│
▼
fresh fix, medium accuracy, 8 s limit ──► refine if moved more than 50 m
│
▼ timeout / error
keep the last position, never show an error
Three edge cases shaped the code:
- Permanently denied permission. On Android, a plain permission check never reports "denied forever"; only a permission request does. Without memory, the app would treat a user who said "never" as askable on every launch. We persist that state, and on iOS we treat a denial that survives a request as permanent too. The member gets a button to the right settings screen: app settings for a denied permission, location settings when the phone's GPS is off.
- A stuck fix. The app shows the last known position immediately, then asks for a fresh one with an 8-second limit. If that times out, the member keeps the distances they already have. A missing location is a normal state, not an error dialog. Movements under 50 meters are ignored so the list doesn't reshuffle from GPS jitter.
- Clinics at 0,0. Some records arrive with
0,0or malformed coordinates. Those would place a Riyadh clinic in the Gulf of Guinea, thousands of kilometers away. We reject them and sort those clinics last, keeping their original order.
GeoPoint? geoPointFrom(String? lat, String? long) {
final latitude = parseCoordinate(lat, isLatitude: true);
final longitude = parseCoordinate(long, isLatitude: false);
if (latitude == null || longitude == null) return null;
if (latitude == 0 && longitude == 0) return null; // placeholder, not a place
return GeoPoint(latitude, longitude);
}
Centers are cached on the device in Hive with a 24-hour lifetime in production, together with a prebuilt search index, so search works offline. Search text is normalized for Arabic (diacritics and tatweel stripped, hamza forms folded to a bare alef, teh marbuta matched to heh), so a clinic name typed either way is found. The import runs in a background isolate so the UI never freezes.
clinic network list in Arabic with distances in km, nearest first
Under the hood: a store that sells clinic services
The clinic-offers store is where the business gets revenue between renewals, and it is where most of the rules live.
One center per cart. A cart holds services from one center only. Adding an offer from a different center asks the member whether to replace the cart. That keeps each order to a single provider and a single authorisation letter.
Identity before payment. Checkout asks for three things in order: national ID, nationality, then a one-time code sent by SMS to the phone registered on the Takaful card, shown masked on screen. The server confirms the person holds a valid card before the code is sent. Only then does the app check Tabby eligibility and enable the pay button.
VAT depends on nationality. This is why the nationality step exists. Under Royal Order A/86 (2018), the Saudi state bears the VAT on private healthcare services provided to Saudi citizens. ZATCA's Healthcare Sector Guideline (second edition, May 2026, at the time of writing) says private facilities issue citizens invoices without VAT after verifying identity and recording the national ID, while services to everyone else carry the standard 15%. The guideline also states the rule does not extend to GCC citizens or to non-Saudi family members of citizens. Note the wording: ZATCA does not describe this as "zero-rating"; the state bears the tax. The app shows a preview, and the server's figure is the one that counts:
/// Client-side preview only; the server's `vat` is authoritative.
double vatRateFor(String? nationality) =>
nationality == null || nationality == saudiNationality ? 0 : 0.15;
This is general information, not tax advice. Confirm the treatment of your own services with your tax advisor.
Tabby, with an eligibility check first. Tabby's documentation recommends a background pre-scoring (eligibility) call before showing the payment option. We run it after verification and only enable "Pay with Tabby" when the answer is yes. If the check fails for a network reason, the member stays on the ready step with a retry button instead of being sent back to the start.
store checkout showing the verification steps: national ID, nationality, SMS code, then Tabby
The server decides the outcome. The Tabby page runs in a WebView, but a redirect URL is not proof of payment. The app polls the order status every three seconds until it is paid, failed or cancelled:
Future<void> pollOnce() async {
final uuid = state.uuid;
if (uuid == null || state.phase != PaymentPhase.awaiting || _polling) return;
_polling = true;
try {
final order = await _api.fetchOrder(uuid);
await _apply(order.paymentStatus, order.isPaid, order);
} catch (error) {
if (error is ApiFailure && error.statusCode == 401) {
_timer?.cancel();
emit(PaymentState(phase: PaymentPhase.reauth, uuid: state.uuid));
} // anything else: the next tick asks again
} finally {
_polling = false;
}
}
Polling pauses when the app goes to the background and resumes, with an immediate check, when it returns. If the store session expires mid-payment (a 401), the member is asked to verify again instead of watching a spinner forever. When the order is paid, the cart is cleared, but only if the paid items are the cart's items, so paying an old order from "My orders" never wipes a new cart. The member then gets the authorisation letter to present at the clinic.
Arabic-first quality, guarded by tests
An Arabic-first app degrades quietly: a hardcoded string, a key missing in Arabic, a dark-mode screen with white cards. The project carries 72 test files, and several exist only to stop that drift:
- A locale parity test fails if English and Arabic don't define exactly the same keys, or if any translation is empty.
- A no hardcoded Arabic test scans
lib/and fails on any Arabic string literal outside an explicit allow-list (the printed certificate, which is Arabic by design, and language names). - A copy review test keeps retired, ambiguous wording from coming back.
- A no hardcoded surface colors test fails if listed screens use raw color literals instead of the dark-mode tokens in the design system.
Updates follow the same discipline. Firebase Remote Config holds a required and a recommended minimum version per platform, the app reminds about new store releases at most once a day, and on Android it uses Google Play's flexible in-app update, which downloads in the background and installs on restart. If you are weighing the cross-platform choice itself, our comparison of Flutter and native for MENA products covers it, and our notes on Arabic RTL design mistakes cover what these tests are protecting.
Checklist: building a membership or discount-card app
- Decide what the receptionist sees. The card screen is the product; give it the shortest path in the app and a QR or code the clinic can check.
- Model family and extra cards from day one: who pays, whose ID is on each card, and who can switch between accounts on one phone.
- Treat location as optional. Handle denied, permanently denied, GPS off and timed-out fixes without error dialogs.
- Validate partner coordinates. Reject
0,0and out-of-range values before computing distance. - Cache the network on the device with an expiry, and normalize Arabic search text.
- If you sell services, verify identity before payment and tie it to the card's registered phone.
- Let the server decide payment outcomes; poll order status and handle expired sessions.
- Get VAT right per buyer. For Saudi healthcare services, nationality changes the invoice; read ZATCA's current guideline and confirm with your advisor.
- Put translation parity and hardcoded-string checks in your test suite, not in a review checklist.
Frequently asked questions
What is a medical discount card app?
It is a mobile app that replaces a physical medical discount card. Members subscribe, show a digital card with a QR code at participating clinics, and browse the network of centers that honour the discount. It is not health insurance; the member pays the clinic directly at the discounted price.
Can members add family members to one subscription?
Yes, if your plans allow it. In Takaful Golden a plan can include extra cards, and the request form collects a name and ID for each additional member. Several accounts can also be saved on one phone so a parent can switch between them.
Do Saudi citizens pay VAT on private healthcare services?
Under Royal Order A/86, the Saudi state bears the VAT on private healthcare services provided to Saudi citizens, and ZATCA's guideline says facilities invoice citizens without VAT after verifying identity. Non-Saudis, including GCC citizens, are charged the standard 15%. Goods such as medicines and eyeglasses follow their own VAT treatment.
Can I offer Tabby for clinic services inside the app?
Yes, if Tabby approves your business as a merchant. The integration should check eligibility before showing the option, open Tabby's hosted page for payment, and confirm the result from your server rather than from the redirect. The same server-side discipline applies to any money flow; our notes on idempotency and ledgers go deeper.
Next step
If you run a membership, discount-card or benefits network and still rely on plastic cards and phone calls, start by writing down your plans, family rules and how a clinic confirms a member today. Send us a project brief and we will tell you which parts belong in version one and which can wait.