How to build a mobile app on ERPNext's APIs: choose the right authentication, design custom endpoints, sync data safely, and handle weak or missing connections.

ERPNext is great at running the back office. But your sales team is in the field, your warehouse staff are walking around with a phone, and your delivery drivers are rarely at a desk. A mobile app gives them just the part of the ERP they need, in a form that works on a small screen.
The good news is that Frappe and ERPNext already expose APIs, so you don't have to build a backend from scratch. The harder parts are the ones around it: authentication, deciding what data to send to the phone, keeping it in sync, and handling poor connections.
In this post, we'll walk through each of those, with practical advice from building mobile apps on top of Frappe. If you're still deciding whether you need a native app at all, start with our guide to choosing between a mobile app, a web app, and a PWA.
Frappe exposes two main kinds of API:
/api/resource//api/method/Both respect the logged-in user's roles and permissions, so a user only sees and changes what they are allowed to in ERPNext itself.
The resource API is a good start, and it's fine for simple lists and forms. But for a real mobile app, you will usually add your own endpoints.
Authentication is the first decision, and the easiest to get wrong.
Option A: API key and secret. Each user can have an API key and secret, and requests send them in the Authorization header. It's simple, and it's good for server-to-server integrations.
Option B: Login-based sessions or tokens. The user signs in with their own credentials, and the app stores a session or token for that user. This suits mobile apps better, because every person has their own identity.
Option C: OAuth. Frappe also supports OAuth 2, which is a good fit if you need a more formal flow or third-party sign-in.
A few rules we follow:
A Sales Order in ERPNext can have dozens of fields and child tables. A phone screen needs a handful.
With the resource API, ask only for what you need:
const params = new URLSearchParams({
fields: JSON.stringify(["name", "customer", "grand_total", "status", "modified"]),
filters: JSON.stringify([["status", "=", "To Deliver and Bill"]]),
limit_page_length: "20",
limit_start: "0",
order_by: "modified desc",
});
const res = await fetch(`${BASE_URL}/api/resource/Sales Order?${params}`, {
headers: { Authorization: `Bearer ${token}` },
});
const { data } = await res.json();Smaller responses mean faster screens, less data use, and less to go wrong on a weak connection. Always paginate lists instead of loading everything at once.
Once a screen needs more than one request, or some logic, create a whitelisted method in a custom app:
import frappe
@frappe.whitelist()
def get_my_orders(start=0, limit=20):
return frappe.get_list(
"Sales Order",
fields=["name", "customer", "grand_total", "status", "modified"],
filters={"owner": frappe.session.user},
order_by="modified desc",
limit_start=int(start),
limit_page_length=int(limit),
)This gives you:
Put these endpoints in a proper custom app, not in scattered scripts. We explain why in Frappe custom app vs server scripts. A mobile API is exactly the kind of long-lived, testable code that belongs in version control.
Also remember that old app versions stay in users' pockets for a long time. Don't break existing endpoints, and add new ones instead of changing old ones. The same compatibility thinking applies to the rollout itself, which we cover in shipping a React Native rewrite while production stays live.
Field staff work in basements, warehouses, rural roads, and lifts. Assume the connection will drop.
Make reads resilient:
Make writes safe:
The duplicate problem is the one that causes real damage. If a request times out after the server already saved it, a naive retry creates a second record. Unique request IDs, checked on the server, solve this.
Syncing doesn't mean downloading everything every time.
modified timestamp - Ask only for records changed since the last successful syncKeep the first version simple. Often, a few key lists synced regularly plus a safe write queue is enough.
If you run a multi-tenant product, each customer is a separate site with its own address, which means your app needs to know which site to talk to. Common approaches are asking for a company code at login, or using a per-customer app configuration. The backend side of this is covered in multi-tenant SaaS on Frappe.
For a first version, a simple setup works well:
modified timestampsAdd complexity only when real users need it.
Frappe gives you a solid API foundation, but a good mobile app is built in the details: per-user authentication, small purpose-built endpoints, safe offline writes, and careful syncing. Get those right, and your team gets the right slice of the ERP in their pocket, even on a weak connection.
At Flitz Interactive, we build React Native apps on top of Frappe and ERPNext, from API design to app store release. If you're planning one, we'd be happy to talk it through.