When to use this
- Guests order in your own app or website and choose delivery at checkout.
- You want to show a delivery fee and arrival time before the guest pays.
- Your kitchen needs couriers to arrive when food is ready, not before.
- You want delivery status in your app, your POS, or your kitchen display.
How it works
Your app calls Nash twice, once to quote and once to dispatch. Everything after that comes back as webhooks.
Before you start
Build and test in Sandbox first. Sandbox has its own API keys and Portal, and pairs simulated fleets with your test orders, so a test order never sends a real courier.1
Create an API key and find your Org ID
Every request sends
Authorization: Bearer $NASH_API_KEY and the Nash-Org-Id header. See Authentication.2
Add your restaurants as store locations
Add each restaurant as a store location, with your own store number as its external ID. A quote then only needs
pickupExternalStoreLocationId; Nash uses the store’s saved address and contact details.3
Set up a dispatch strategy
A dispatch strategy holds your rules for choosing a provider: cost, speed, a preferred fleet first, a fee cap, auto-reassignment. Apply it with a dispatch automation so you don’t send
dispatchStrategyId on every call. Keep Enable Autodispatch off, so an order isn’t booked the moment you quote it.4
Register a webhook endpoint
In the Portal, under Settings > Webhook Management, add an HTTPS endpoint subscribed to
delivery events. Copy its signing secret for verification.Step 1: Quote during checkout
Call Create Quote once the guest has entered a full delivery address and you know which store will make the food. The response gives the delivery fee and arrival time to show, and a Nash orderid to keep with the cart.
Call it after the address is confirmed and the cart is close to final, not on every keystroke or cart edit. If the guest changes the address or store, quote again. If they change only the cart, update the order (Step 2).
Choose which time to send
Quote with the earliest pickup time, and let the provider’s ETA set the first delivery time the guest sees.- First quote: send the pickup time only. Set
pickupStartTimeto the earliest the food can be ready: now plus the restaurant’s prep time, plus any buffer you want to give the kitchen. Don’t send dropoff times. - Show the ETA as the first available time. Each quote comes back with a
dropoffEta: the provider’s expected arrival for that pickup time. Show the preferred quote’sdropoffEtato the guest as the earliest delivery time they can choose. - Update the order to match what the guest chose. Before you dispatch (Step 2), send the time that matches the guest’s choice:
Don’t send both a pickup time and a guest-chosen dropoff time for the same order. One anchors the delivery; Nash calculates the other.
Send the address: single line or components
Nash needs a deliverable dropoff address to quote. You can send it two ways, and you pick one per request; mixing them returns a validation error.
Send components if you have them. The address the guest confirmed at checkout is the one the courier gets, with the unit number in its own field and the pin where your autocomplete put it, rather than a second geocode of a typed string. Required components are
dropoffAddressFormattedStreet, dropoffAddressCity, dropoffAddressZip, dropoffAddressCountry, dropoffLat, and dropoffLng.
dropoffAddress or dropoffPlaceId alongside components. A Google Place ID (dropoffPlaceId) works like the single line: Nash looks it up and geocodes it. The pickup side follows the same rules, but with pickupExternalStoreLocationId Nash takes the pickup address from the store location. See Order address validation and Order validations.
Read the response
idis the Nash order ID. Store it with the cart; Steps 2 and 3 use it.quoteslists the options, each withtotalPriceCents,dropoffEta,expireTime, andproviderName. Show the guest the quote whosetagsincludeautodispatch_preferred_quote; that’s the one autodispatch will book.failedQuoteslists providers that can’t take the order. Ifquotesis empty, delivery isn’t available to this address, so offer pickup instead.
Step 2: Dispatch after checkout completes
Once payment succeeds and the order exists in your POS, update the Nash order with the final details, then dispatch it. Dispatching books the delivery with the provider and returns a job (delivery), which you track in Step 3.Update the order
Use Update Order with the Nash orderid from Step 1. Swap in the POS order number and add what the courier needs at the counter and at the door:
referenceId is shown to the courier where the provider supports it, so use the short number your staff call out at the counter.
If the guest chose a later delivery time instead of the first available one, send the time change in the same update: switch deliveryMode to scheduled, clear the pickup time, and send their chosen dropoff time (see Choose which time to send).
Dispatch the order
Call Autodispatch Order. Nash books the quote your dispatch strategy prefers, the one taggedautodispatch_preferred_quote, which is the quote you showed the guest in Step 1. Your provider rules live in the strategy, so you can change them in the Portal without a code change.
Select Quote (
POST /v1/select_quote with a quoteId) books one specific quote. It’s available, but use it only when Nash’s built-in selection strategies can’t express what you need. It hard-codes the provider choice in your code, and you lose strategy features like auto-reassignment and fee caps. If you think you need it, talk to Nash first; a strategy change usually covers it.{ "job": { ... } }. Save job.id on your POS order; webhooks reference it.
- Check the quote hasn’t expired. Every quote has an
expireTime. If the guest spent a long time in checkout, call Refresh Quotes with theorderIdfirst. The price shouldn’t change unless the order did. - Dispatch once per order. Mark the POS order as dispatched when the call succeeds. If the call times out, don’t retry blindly: read the order with Get Order and dispatch again only if it has no job.
- Plan for a failed dispatch. If the call returns an error or no provider can take the order, alert the store, then retry after refreshing quotes, switch the order to pickup, or refund the delivery fee.
Step 3: Receive status updates through webhooks
After dispatch, Nash sends a webhook every time the delivery changes status, so you don’t need to poll. Every payload has three fields:type (delivery for status changes), event (the new status), and data (the full job, the same shape as the dispatch response).
Map statuses to what the guest sees
Nash normalizes every provider’s statuses into one list. A fast casual app usually needs only a few guest-facing states:
Every completed delivery passes the seven statuses below in order; Nash infers a status if a provider skipped it. Other statuses can arrive in between, and not every provider sends every status.
With auto-reassignment on, a provider cancel isn't the end: Nash books another provider on the same job, and a new task starts again at created.
Build your webhook handler
- Verify the signature. Nash sends webhooks through Svix. Check the
svix-id,svix-timestamp, andsvix-signatureheaders against your endpoint’s signing secret, ideally with a Svix SDK. See Verifying webhooks. - Respond with a
2xxquickly. Queue the work and acknowledge right away. Failed deliveries are retried on a backoff; see the retry policy. - Deduplicate. Retries and multiple tasks can send the same event twice. Key on
svix-id, and never move an order backward: ignoredropoff_enrouteonce you’ve seendropoff_complete. - Handle reassignments. When Nash reassigns a delivery, the old task ends and a new task starts on the same job. A cancel on the old task doesn’t mean the delivery is over; read
jobConfigurations[].advancedTaskfor the attempt that’s live. See Reassignments and courier changes. - Match on the job ID. Look up your order by
data.id, thejob.idyou saved in Step 2.
Real-time tracking for the guest
You can show the guest a live map two ways: build it yourself from location webhooks, or let Nash host it. The hosted page is the faster path, since it needs no map or backend work on your side.
You can also mix them: embed the hosted page in your app and use
delivery webhooks for your own order-status screen and kitchen display.
Edge cases
Go-live checklist
- Every restaurant is a store location with its external store number
- A dispatch strategy and automation are set, and Enable Autodispatch is off
- Checkout quotes only after a full address and shows the fee and ETA (or your flat fee)
- Addresses go to Nash as components (with coordinates) wherever your checkout has them
- The first quote sends only
pickupStartTime(prep time plus buffer), and the guest’s first available time is the quote’sdropoffEta - A later time the guest chooses goes on the update as
dropoffStartTime, withdeliveryModeset toscheduledandpickupStartTimeset tonull - An empty
quoteslist hides delivery and offers pickup - The Nash order
idandjob.idare saved on the POS order - Dispatch runs once per order, after payment, with a refresh if the quote expired
- The webhook endpoint verifies Svix signatures, returns
2xxquickly, and deduplicates onsvix-id - Every terminal status (
dropoff_complete, cancels,failed,expired) updates the guest and the store - Tested in Sandbox: quote, dispatch, a full status run, a cancel, and a provider failure
- Production API key, Org ID, and webhook endpoint are set up separately from Sandbox
Beyond the basics
Quote, dispatch, and webhooks cover the core flow. Most other day-to-day work happens in the Nash Portal, and most of it is also in the API, so you can build it into your own systems when that fits better.
For more advanced builds, such as embedded ops tooling, custom workflows, or syncing refunds into your finance systems, reach out to your Nash team or support@usenash.com.
Related
Sample checkout workflow
The general quote, update, dispatch, and track pattern for any checkout.
Webhooks
Event types, payload shape, signature verification, and retries.
Delivery status
Every normalized status, terminal statuses, and the guaranteed order.
Embed live tracking
Put Nash’s hosted tracking page inside your app or site.