Sample Checkout Workflow
In this page, we outline a sample workflow for partners that want to embed Nash into their custom checkout workflows. We define a few terms and specify all relevant Nash endpoints that we recommend using to seamlessly use Nash to fulfill delivery for your customers in their checkout experience.
Relevant Concepts
Step 1: Fetching Order Quotes
If you want to validate that Nash has a delivery option or if you want to pull the delivery price quotes from Nash for your customer’s cart, you should use the Get Order Quotes endpoint to fetch all the valid quotes for the order.
Some fields you want to include in this request are:
- Pickup location: you should determine the location you would like to fulfill from. Alternatively, Nash can help you determine the closest location to the customer that has inventory of the item, if you use our Store Locations.
- Customer Address: the dropoff location for the order. You’ll need a full, valid address to obtain delivery quotes.
- Estimated Pickup + Dropoff times: pass the time your customer would like to have the order delivered. If only the dropoff time is sent, Nash will compute the pickup time based on the driving distance between the pickup and dropoff.
- Order / cart ID (if available): associating a unique identifier to the Nash Order will allow you to recognize it in the Nash dashboard.
- DispatchStrategyId (optional): we highly recommend leveraging Dispatch Automations to determine the dispatch strategy for an order, but if you want to specify the dispatch strategy at the quote creation step, then you can set up Dispatch Strategies and pass the ID.
Processing the Quotes Response
How you process the quotes from Nash depends on the type of integration you are building. For instance, do you plan to show your customers an accurate delivery price in the checkout or will you just charge them a fixed fee for delivery, regardless of the Nash price? Here’s a few fields that may be relevant:
- id: This is the Nash Order ID that you’ll use in the following steps of the checkout.
- Quotes: this is a list of quotes that you can process. If using Dispatch Strategies, then look for the quote with
autodispatch_preferred_quote
inquote.tags
. - FailedQuotes: a list of quotes from providers that can’t fulfill the order, along with the failure reason.
If your customer abandons the cart, you don’t need to cancel the Nash Order that was created to obtain quotes.
Step 2: Updating Order
If your customer decides to place the order for local delivery, then you should initially use the Update Order
endpoint to add any fields that were missing when you first obtained your quotes. For this endpoint, you will use the Order ID returned in
Step 1, and you should consider adding any new information that’s relevant for the order. For example, if an order is
created in your system, then you should add it in the externalId
field. Similarly, you can update the description
,
itemsCount
, pickupInstructions
, and dropoffInstructions
fields to give the driver what they need to ensure a
successful delivery.
You can also call Update Order anytime your customer updates their cart and tries to fetch a new delivery quote. To avoid excessive calls, you should only call update order when your customer is ready to check out and wants the latest delivery price.
Step 3: Dispatching Orders for Delivery
Once your customer has placed the order, you should indicate to Nash that the order should be dispatched to the provider. Nash will forward the delivery information about the order (addresses, pickup + dropoff times, order details, etc.) to the chosen provider.
There are two ways you can dispatch the order, and it depends on whether you are using Dispatch Strategies:
- With Dispatch Strategies: Autodispatch Order Autodispatching an order selects a quote based on the dispatch strategy.
- Without Dispatch Strategies: Select Order Quote choose the quote your customer has accepted in the checkout page.
Step 4: Tracking your Deliveries
Once the customer’s order is placed and booked with the provider, you might want to track the status of the delivery in your app. To do that, you can either use the GET Order endpoint or set up webhook updates.
FAQs
(Optional) Zip / Postal Code Validation
Some merchants want their customers to validate that delivery is available for them before they reach the checkout page. A common question is “What if I want to check for local delivery availability in the pre-checkout step before a customer inserts their full address?”
If you want to add a delivery widget option, we recommend adding a step in your cart page or a banner in your website to ask your customers to check if they are eligible for Local Delivery. If your system already tracks stores, you can store a list of zip / postal codes that are reachable by local delivery for each store, or you can rely on the Nash Store Locations to check which areas are serviceable from your stores.
Example delivery widget
Refreshing Quotes
Quotes have an expireTime
. You can use the Refresh Quotes
endpoint to refresh the quotes. The pricing shouldn’t change assuming no other information about the order has changed.