Delivery plans
A delivery plan is a group of shipments that leave together, usually in one of your own vehicles. It is also called a trip or a dispatch. The API uses the path /api/v1/plans, and the events use the name Dispatch.
Use a delivery plan for your own fleet. For a shipment that a carrier moves, read Carriers and quotations.
Create a delivery plan
In the portal, select New Delivery Plan. The plan builder shows the shipments that are not in a plan yet. Select the shipments, a vehicle, and one or more drivers.
With the API:
- Send
GET /api/v1/plans/codeto get a new plan code. - Send
GET /api/v1/plans/unassigned-shipmentsto find the shipments that are not in a plan. - Send
POST /api/v1/planswith the code, a description, theshipmentIds, thedriverIds, and thevehicleId.
{
"dispatchCode": "<plan-code>",
"description": "South Coast run, Tuesday",
"shipmentIds": ["<shipment-id-1>", "<shipment-id-2>"],
"driverIds": ["<driver-id>"],
"vehicleId": "<vehicle-id>"
}
Miridia raises the OnDispatchCreated event.
Change the shipments of a plan
| Task | Request |
|---|---|
| Add a shipment | POST /api/v1/plans/{deliveryPlanId}/shipments with the shipmentId |
| Remove a shipment | DELETE /api/v1/plans/{deliveryPlanId}/shipments/{shipmentId} |
| Find the plan of a shipment | GET /api/v1/plans/in-shipment/{shipmentId} |
Status of a plan
A plan has one of these statuses: Draft, Unassigned, Pending, Active, Dispatched, InTransit, Complete, and Cancelled. Your team sets the status as the plan moves. Filter the list of plans by status in the portal or with the API.
To change the status or the dates, send PUT /api/v1/plans/{deliveryPlanId}. A plan records the scheduled departure, the actual departure, and the completion. Each change raises the OnDispatchUpdated event.
The timeline
GET /api/v1/plans/{deliveryPlanId}/timeline returns the time of each step of the plan and of each shipment on it. The steps are: the order placed, the shipment created, the shipment added to the plan, the departure, the collection, and the delivery. The portal draws the timeline as a Gantt chart. Use it to find the step that takes the most time.
The map
The portal shows each plan on a map, with the stops and the road route between them. To see where a vehicle is now, read Fleet and tracking.
Route optimisation
Cargopilot orders the stops of a plan for the shortest route. It uses the delivery time windows, the capacity of the vehicle, and the shifts of the drivers. It can also plan more than one vehicle at a time.
Auto-batch
POST /api/v1/plans/{dispatchId}/autobatch groups the open shipments into the plan by delivery zone and delivery window. It also raises the OnDispatchUpdated event, so a workflow can apply your own rules.
The schedule
The Schedule Overview page is a calendar of the business. A schedule event has a type: Dispatch, Incoming, Task, or Production. Use a Dispatch event to put a delivery run on the calendar of the team. Manage the events with /api/v1/schedule/events. Add mine=true to read only your own events.
Read the plans
GET /api/v1/plansreturns a page of plans. Filter bystatusand by a date range withfromandto.GET /api/v1/plans/overviewreturns the numbers for the delivery plan dashboard.
API reference
Waybills and labels
Download a waybill PDF for a shipment, list the waybills of your recent shipments, and print carrier labels as PDF or ZPL.
Fleet and tracking
Record the vehicles of your fleet, import them from a CSV file, link a GPS tracker, and see the last position and the travel history of each vehicle.