Quickstart
Make your first request in a minute, then get a key and read your own merchant’s orders.
On this page
Five steps
Make a request without a key
Public data needs no key. Ask for the zones NexG delivers to:
Terminal curl https://api.nexgapp.com/v1/zonesResponse · 200 OK (shortened) { "ok": true, "data": { "items": [ { "id": "7f1e2d3c-4b5a-4968-8776-655443322110", "name": "Kilimani", "tier": "core", "eta_min": 20, "eta_max": 30, "cod_allowed": true, "…": "and the zone's bounding box" } ], "next_cursor": null }, "meta": { "api_version": "v1", "limit": 100 } }Every response has
ok, then eitherdataorerror, thenmeta. Lists sit indata.items, withnext_cursorfor the next page.Get a key
Sign in to the developer console with the NexG account you use on nexgapp.com, and issue a key. Choose what it may do:
- Read the public catalog (
public_read): merchants, zones, experiences and services. Any account can have this. - Read your merchant orders (
merchant_read): needs a merchant you own, which the console lists by name.
The key is shown once and NexG keeps only a hash of it, so copy it before you leave the page. Store it where your server reads secrets:
.env # On your server, in its secret store or environment. Never in a browser # bundle, a mobile app or a repository. NEXG_API_KEY=<the key from the developer console>- Read the public catalog (
Call the API with your key
Send the key in
X-Api-Key. With a key, your requests spend from your own rate limit instead of the shared anonymous one.curl "https://api.nexgapp.com/v1/catalog/merchants?city=nairobi&category=restaurant" \ -H "X-Api-Key: $NEXG_API_KEY"Read your orders
With a
merchant_readkey, list your merchant's orders, newest first. You never name the merchant: the key does.curl "https://api.nexgapp.com/v1/orders" \ -H "X-Api-Key: $NEXG_API_KEY"Handle errors and limits
Check
okon every response. When it is false, branch onerror.codeand the HTTP status, and on a429wait for the seconds inRetry-After. The Errors and Rate limits pages list every case.
Before you go live
- The key lives on your server only, and you can replace it without a code change.
- Your client handles
401(replace the key),403(wrong scope),429(wait, then retry) and5xx(retry with backoff). - You follow
next_cursoruntil it isnull. - You read amounts as integers: shillings in catalogues, cents on orders.
- You watch the changelog for changes to the endpoints you use.
Building for a bank or a partner system?
Those connect in a sandbox first. See Environments, then Bank collections or Connecting your systems.