Step 10. Create a dispatch!

Steps 8-12 are the driver workflow, the heart of your daily activity. In this step, you actually create a dispatch by POSTing to the dispatches endpoint. A dispatch is a collection of stops, each with their own set of forms, which can be in either a planned, active, cancelled, or completed state.

A dispatch is a collection of stops, each with their own set of forms, which can be in either a planned, active, cancelled, or completed state. A driver can have only one active dispatch while having any number of planned dispatches.

A dispatch consists of a minimum of two stops. The first is called the shipper stop (where the dispatch begins) and the last is called the consignee stop (where the dispatch is completed). Any other stops in between are considered additional stops, and are called dispatch stops in our system.

At this point, you have all the ingredients for a well planned dispatch. From your TMS system, you have collected all the information needed to plan the best vehicle-asset-driver combination for your dispatch (steps 5-6). You have also collected the forms to include in your dispatch as well as the list of stops (steps 8-9). Let’s create a dispatch by POSTing to the /dispatches endpoint.

POST https://api.keeptruckin.com/v1/dispatches

The POST method for this endpoint only accepts a JSON object in the body of the request. It creates a new dispatch that will be visible to the driver, and that contains the IDs of all involved vehicles, assets, driver, stops, and forms, along with many other details, in addition to up to ten custom fields where you can store additional dispatch information.

The sample request in this workflow is an example of a dispatch with one additional stop. The response echoes the details of the POST request, and is not paginated.

📘

Learn more

Read our reference documentation about the Dispatch object and about the POST method to this endpoint for details.

Language
Authorization
Header
Click Try It! to start a request and see the response here!