Background
Overview of Nash Jobs
Jobs represent the actual delivery process. A Job holds the package(s) to be delivered, the quotes from fleets willing to deliver the package(s), and the current delivery status if one was selected.
Within each job, there’s a structure that includes Job Configurations, Tasks, and Deliveries that manage the details and processes of delivery.
Job Data Model
Here’s how the data model relates to each other:
- Job: This is the primary object that represents a delivery. It contains all the specifications for the package(s) to be delivered, such as the size, value, and the pickup and dropoff locations.
- Job Configuration: Within each Job, there is a JobConfiguration. It includes information on the dispatch strategy, special instructions, and other configurations specific to this job.
- Task: Under each Job Configuration, there can be a list of Tasks. A Task is where the action happens; it involves a set of Quotes and a Delivery object. When you create a new Task, you’re seeking quotes for a new delivery to occur. After requesting a Task, you will receive a set of quotes from different providers, and upon selecting one, you will initiate a Delivery object that tracks the job’s delivery lifecycle.
- Delivery: The Delivery object holds information on the actual progress of the delivery, such as the status, estimated delivery time, courier details, and proof of delivery. It is created after you choose a quote for a Task and it becomes active when a delivery is underway.
Putting it into Practice
Here’s an example scenario: You create a Job to deliver an order using your internal fleet (this would be your first Task). If you later realize that you don’t have an internal driver available, you might create a new Task for the same Job to get quotes from third-party fleets within Nash. Once you select a new quote, this initiates another Delivery object associated with the second Task.
Common Paths in the Job Object
The Job object contains various nested structures. Here are the most commonly used paths to access important information:
Basic Job information
- Job ID:
Job["id"]
Quotes and Tasks
- All quotes for the first task:
Job["jobConfigurations"][0]["tasks"][0]["quotes"]
- ID of a specific quote (replace
Index
with the quote’s index):Job["jobConfigurations"][0]["tasks"][0]["quotes"][INDEX]["id"]
Advanced Tasks
When a job has multiple tasks (e.g. it has been reassigned to a different delivery provider), use this to get the most advanced (aka latest) task in the process:
Job["jobConfigurations"][0]["advancedTask"]
Delivery Status
- Check if a provider has been assigned:
Job["jobConfigurations"][0]["tasks"][0]["delivery"]
If this value isnull
, no provider has been assigned yet. - Access delivery information:
Job["jobConfigurations"][0]["tasks"][0]["delivery"]
This object contains useful attributes such as:status
dropoffEta
courierName
courierPhoneNumber
courierLocation
Example Job Object
Note: All timestamps are in UTC and in this format %Y-%m-%dT%H:%M:%S.%f
The Job object returned for most endpoints looks like this:
Public tracking URL
Nash provides your end customers with a way to track deliveries without having to be logged into the Nash portal. Nash will automatically send text alerts which include the tracking link for a live delivery to the end recipient, unless you would like to disable this feature for your organization. To get a public tracking link for a given job:
https://portal.usenash.com/tracking/[JOB_ID]
https://portal.sandbox.usenash.com/tracking/[JOB_ID]