In short: A delivery platform is not one app but five that share one backend: a customer app, a vendor app or tablet, a rider app, an admin console and, for restaurants and shops, a point-of-sale or kitchen screen. The parts that decide whether it works are not the screens but the order state machine, rider dispatch on real road distance, and the money: cash on delivery collected by riders, local payment rails such as Raast in Pakistan and mada in Saudi Arabia, and a commission ledger that vendors trust. A sensible first release covers one vertical in one service area, and is built so the next vertical is configuration rather than a rewrite.
Key takeaways
- Delivery fees, ETAs and rider assignment should use road distance from a routing engine, not straight-line distance, or fees and promises will be wrong wherever roads bend.
- OSRM is an open-source (BSD-2-Clause) routing engine built on OpenStreetMap data that you can host yourself, so routing does not become a per-request bill.
- In Pakistan, the State Bank's Raast instant payment system supports merchant payments by QR code, alias, IBAN and Request to Pay; in Saudi Arabia, mada cards work in Apple Pay, contactless and online.
| App | Who uses it | What it must do well |
| Customer app (and web) | Buyers | Browse, address with map pin, cart, promo codes, payment, live tracking, reorder, ratings |
| Vendor app or tablet | Restaurants, grocers, pharmacies | Accept or reject orders fast, mark items out of stock, set prep time, see payouts |
| Rider app | Delivery riders | Go online, receive offers, navigate, capture proof of delivery, track cash in hand |
| Admin console | Your operations and finance staff | Coverage zones, fees, commissions, refunds, rider management, reports, support |
| POS or kitchen display | Counter and kitchen staff | Merge walk-in and online orders in one queue so the kitchen is not running two systems |
Pharmacy delivery adds prescription upload and pharmacist review before dispatch; grocery adds substitutions and weighed items whose final price differs from the cart.
This guide is written by the ApexlyTech team at Apexly Technologies (Pvt) Ltd. We build our own delivery and commerce platform, GharTak, on the architecture described here, and build similar platforms for other businesses.
What does the order flow look like?
Every app reads the same order states from the backend. A typical flow:
- Placed: the customer pays or chooses cash on delivery; the platform checks the address is inside a coverage zone.
- Accepted: the vendor accepts within a time limit, or the order is cancelled and refunded automatically.
- Preparing: the vendor's prep time sets when a rider should be asked, so riders do not wait at the counter.
- Rider assigned: dispatch offers the job to a rider, who accepts or lets it pass to the next.
- Picked up and on the way: live location feeds the customer's tracking screen and ETA.
- Delivered: proof of delivery (photo, PIN or signature) closes the order, and the ledger posts the vendor's share, the platform's commission and the rider's earning.
Cancellations, partial refunds and missing items are where flows break. Decide early who bears the cost in each case, the vendor, the platform or the rider, and encode it, rather than leaving support staff to decide each time.
How should rider dispatch and routing work?
Road distance, not straight lines
Straight-line (haversine) distance underestimates the real trip wherever a river, a highway or a one-way system sits between rider and customer, so fees, ETAs and rider pay come out wrong. Use a routing engine for fee distance, customer ETA, rider trip distance and dispatch ranking, and keep straight-line maths for geometry such as coverage checks.
Self-hosted routing with OSRM
OSRM (Open Source Routing Machine) is a C++ routing engine designed to run on OpenStreetMap data, released under the BSD-2-Clause licence. Its map data is OpenStreetMap's, which is licensed under the Open Database License and must be credited on your maps. It offers route, table (distance and time matrices), match (snapping noisy GPS traces to roads), trip and nearest services over HTTP. Hosting it yourself means a dispatch decision that compares twenty riders is one table request to your own server, not twenty paid API calls. The trade-off: you must rebuild the map data periodically and fall back visibly if the router is down.
Dispatch rules
Start simple: offer the order to the nearest available rider by road time, with a short acceptance window, then widen the radius. Add batching, vehicle type and rider fairness once you have data, and keep every rule configurable from the admin console.
How do payments and cash on delivery work?
Wherever customers can pay cash at the door, the platform must treat rider cash as money in transit, not as settled revenue:
- Track cash in hand per rider and stop offering cash orders above a limit until the rider deposits.
- Reconcile deposits against delivered cash orders at the end of each shift.
- Post every order to a double-entry ledger, so vendor payouts, commissions, refunds and rider earnings always balance.
Pakistan: Raast and wallets
Raast is the State Bank of Pakistan's instant payment system. The SBP's December 2023 instructions let merchants accept Raast payments through unified QR codes, Raast aliases such as mobile numbers, IBANs and Request to Pay, and told banks and other regulated entities not to charge their customers a fee for paying through Raast. Mobile wallets such as JazzCash and easypaisa offer their own merchant integrations, and easypaisa users have been able to pay Raast P2M QR codes since June 2024. A Request to Pay sent at checkout or at the door is a practical way to shrink cash on delivery.
Saudi Arabia and the Gulf: mada, Apple Pay and wallets
mada is a national payment system owned by the Saudi Central Bank (SAMA). mada cards can be added to Apple Pay for in-store and online payments, support contactless payment through mada Atheer, and work online through 3-D Secure. Wallet users are moving too: stc pay has become STC Bank, a SAMA-licensed digital bank. A payment gateway licensed in each market handles cards, mada and Apple Pay; your platform should treat each method as a plug-in so adding one does not touch the order flow.
Which commission and fee model should you use?
| Revenue line | Paid by | Notes |
| Commission per order | Vendor | A percentage of the food or basket value; vary it by category or vendor contract |
| Delivery fee | Customer | A base fee plus road distance, with surge rules for peak hours or rain |
| Service or small-basket fee | Customer | Covers payment costs on low-value orders |
| Subscription | Customer or vendor | Free delivery for customers, or a flat plan for vendors instead of commission |
| Promoted listings | Vendor | Paid placement; label it as sponsored |
Whatever the mix, make it data in the admin console, not code. Tax also matters: commission invoices to vendors are tax invoices, and in Saudi Arabia and Pakistan those may fall under e-invoicing rules, so plan for them from the start.
Build, white-label or SaaS?
| Option | Good for | Watch out for |
| SaaS ordering tool | One restaurant or chain taking its own orders | Per-order or monthly fees, limited control of dispatch and data |
| White-label clone | Fast demos | Code you do not own or understand, weak local payments, hard to change |
| Custom build on a proven architecture | A marketplace that is the business itself | Higher first cost; needs a clear MVP scope |
Ask any supplier who owns the source code and whether routing is a paid third-party API.
A phased MVP plan
- Phase 1, one vertical, one service area: customer, vendor, rider and admin apps; card or wallet payment plus cash on delivery; road-distance fees; manual dispatch override.
- Phase 2, operations: automatic dispatch rules, rider cash limits, vendor payouts from the ledger, promo codes, ratings.
- Phase 3, growth: a second vertical, subscriptions, POS and kitchen display for vendors, WhatsApp notifications.
- Phase 4, scale: more areas, analytics, read replicas, and load testing before peak seasons such as Ramadan.
If you plan to send order updates on WhatsApp, our WhatsApp Business API pricing guide explains what they cost.
How ApexlyTech can help
We build branded delivery, marketplace and restaurant-POS platforms on the same architecture we run for our own platform, GharTak: customer, vendor and rider apps, an admin console, self-hosted road routing and a double-entry ledger. See our delivery app development page for what is included, or contact us for a fixed quote on your scope.
Frequently asked questions
Usually four to five: a customer app, a vendor app or tablet, a rider app, an admin console, and optionally a POS or kitchen display for vendors. All of them share one backend and one set of order states.
Can a delivery app accept Raast payments?
Yes. The State Bank of Pakistan's Raast P2M service lets merchants accept payments by QR code, alias, IBAN and Request to Pay, through a bank or licensed payment provider that is integrated with Raast.
How do you control cash on delivery?
Track the cash each rider holds, cap it, require deposits at the end of each shift, and reconcile deposits against delivered cash orders in a ledger. Offering instant payment at the door also reduces how much cash is in transit.
Should we build or use a white-label app?
If delivery is a feature of your shop, a SaaS ordering tool may be enough. If the marketplace is the business, own the code and the data.
Sources
All sources checked 19 November 2026.