
When adding a store locator to a public marketing website, most developers call the Map API straight from the browser because it is fast to wire up. Bringing address search, distance calculation, or route planning into internal systems such as Odoo, SAP, a warehouse management system (WMS), or a custom CRM is a different story.
In internal software, the payloads passing through the Map API are no longer public store addresses. They are B2B customer lists, warehouse locations, order values, and daily fleet schedules. Deciding whether to call the API from the employee’s browser (frontend) or route requests through an internal server (backend) directly affects both data security and the monthly API bill.
1. What happens when employee browsers call the Map API directly
If ERP or CRM screens call the Map API straight from the browser, the API key sits inside the JavaScript bundle downloaded to every workstation. Even with domain restrictions, anyone opening browser DevTools can inspect the key and request structure.
The second issue is losing shared caching. In a dispatch room where 15 coordinators open the same 500 recurring distributor addresses throughout the day, direct browser calls mean paying 15 separate times for identical geocoding or distance matrix lookups.
The third issue is cost attribution and logging. When the monthly Map API bill spikes unexpectedly, IT teams struggle to identify which screen or department (sales, warehouse, or finance) generated the extra traffic if everything shares a single client-side key.
2. Draw a clear boundary: what stays on the frontend and what belongs on the backend
In practical enterprise ERP and CRM architectures, you do not need to force every single request through your application server. The cleanest setup splits traffic by API type.
Keep Map Tiles (interactive base maps for fleet tracking or territory views) on the frontend. Map tiles carry no proprietary customer data and rely on parallel edge downloads so panning and zooming stay smooth. Proxying dozens of tile requests per screen through an internal ERP server only consumes internal bandwidth without adding security value.
By contrast, all data and calculation APIs (Geocoding, Reverse Geocoding, Convert Address, Distance Matrix, Routing, and VRP) should run through a backend service layer, commonly built as an Adapter or Backend-for-Frontend (BFF). For Autocomplete on order-entry forms, teams can either route lookups through an internal backend endpoint to enforce per-user rate limits, or isolate it on a tightly restricted frontend key when lowest keystroke latency matters most.
| API group | Recommended placement | Main reason |
|---|---|---|
| Map Tiles (base map) | Frontend (browser / app) | No sensitive customer data; needs fast parallel loading without taxing ERP server bandwidth |
| Geocoding / Convert Address | Backend | Runs in batches or on record save; persists coordinates to the database so addresses are not geocoded repeatedly |
| Distance Matrix / Routing / VRP | Backend | Involves sensitive depot and order data; enables shared depot-to-customer caching and centralized freight calculation |
| Autocomplete (address search) | Backend proxy or isolated frontend key | Protects the primary server key and makes per-user rate limiting straightforward |
3. Three immediate gains from placing an adapter layer on the backend
The first gain is locking down access with IP Whitelist and keeping keys off the client. On TrackAsia, backend keys can be restricted to the static IP range of your ERP or CRM servers (with OAuth 2.0 available for enterprise setups). The key lives strictly in server environment variables and never reaches an employee’s browser.
The second gain is cutting API spend through centralized caching. When coordinator A looks up the driving distance from a Binh Duong warehouse to Distributor X, the backend calls TrackAsia Distance Matrix once and stores the result in Redis or a database cache table with a sensible TTL (such as 7 or 30 days for fixed corridors). Five minutes later, when coordinator B opens the same order in Odoo or SAP, the system serves the cached distance at zero extra API cost.
The third gain is upgrading or failing over without touching dozens of ERP screens. If your team later needs to switch API versions, enable dual administrative boundary parameters (new_admin=true&include_old_admin=true), or log slow responses centrally, engineers update one backend service instead of hunting through every UI module.
4. Three common mistakes when building a backend proxy
Even with a clean backend architecture, three implementation mistakes show up frequently during rollout.
First is forgetting request timeouts on outbound calls. If office connectivity fluctuates and a synchronous Geocoding call inside the “Save Order” handler has no timeout (such as 3 to 5 seconds) and no fallback path, employees clicking Save will watch the ERP screen freeze. Tasks that do not need an immediate UI response, such as batch address normalization or route recalculation, belong in a background queue.
Second is caching forever. A warehouse coordinate rarely moves, but roads, bridges, and administrative wards do change over time. Cache tables should always store an updated_at timestamp so stale entries refresh on a schedule rather than persisting for years.
Third is putting every environment on one API key. Even behind a backend proxy, keep at least separate keys for development/staging and production, and separate the frontend Map Tiles key from the backend calculation key. If usage jumps unexpectedly, per-key metrics let IT isolate the source within minutes.
Architecture guidance for ERP and CRM Map API integrations
If your IT team is planning a TrackAsia Map API integration for Odoo, SAP, or an in-house ERP/CRM and wants advice on proxy architecture, IP Whitelist setup, or centralized monthly plans, contact TrackAsia’s engineers via support@track-asia.com or Hotline.