post https://api.keeptruckin.com/v2/dispatches
Create a dispatch
This API only accepts a JSON object in the body of the request and is used to create a new dispatch. The JSON object should take the following general form.
The following includes examples of trips with stops besides shipper and consignee stops (vendor_shipper_id and vendor_consignee_id). We can include more trips that can potentially encompass multiple stops. Stops across trips need to be unique.
Sample Requests
{
"vendor_id":"VV-4",
"status":"planned",
"vendor_shipper_id":"VSS-1",
"vendor_consignee_id":"VDS-1",
"dispatch_trips":[
{
"vendor_id":"VT-6",
"driver_id":4805,
"vehicle_id":2596,
"vendor_stop_ids":[
"VSS-1",
"VDS-1"
],
"status":"not_started"
}
],
"shipper_form_ids":[
"582e259f-c1fe-4a7f-9cb8-1873833057bc",
"51bb4fef-9f15-4e87-8121-3b6a99e7af6c"
],
"consignee_form_ids":[
"de05ebc6-5873-43b4-82fd-1dffe6805558",
"8df8e98c-9e6d-411e-8f86-0d7c3a545e70"
],
"vendor_shipper_dispatch_location_id":"VDSL-1",
"vendor_consignee_dispatch_location_id":"VDSL-2",
"shipper_type":"pickup",
"consignee_type":"dropoff"
}
{
"vendor_id":"VV-5",
"status":"planned",
"vendor_shipper_id":"VSS-1",
"vendor_consignee_id":"VDS-1",
"dispatch_trips":[
{
"vendor_id":"VT-6",
"driver_id":4805,
"vehicle_id":2596,
"vendor_stop_ids":[
"VSS-1",
"VCS-1",
"VDS-1"
],
"status":"not_started"
}
],
"dispatch_stops":[
{
"vendor_id":"VCS-1",
"type":"delivery",
"number":1,
"form_ids":[
"be4cd651-5aca-436b-8cf3-e7881c3d76b8",
"e93b8563-53cc-4318-b957-369b5fda18d0"
],
"early_date":"2017-07-13T19:13:00+00:00",
"late_date":"2017-07-15T19:13:00+00:00",
"vendor_dispatch_location_id":"VDSL-3"
}
],
"shipper_form_ids":[
"582e259f-c1fe-4a7f-9cb8-1873833057bc",
"51bb4fef-9f15-4e87-8121-3b6a99e7af6c"
],
"consignee_form_ids":[
"de05ebc6-5873-43b4-82fd-1dffe6805558",
"8df8e98c-9e6d-411e-8f86-0d7c3a545e70"
],
"vendor_shipper_dispatch_location_id":"VDSL-1",
"vendor_consignee_dispatch_location_id":"VDSL-2",
"shipper_type":"pickup",
"consignee_type":"dropoff"
}
{
"vendor_id":"VV-6",
"status":"planned",
"vendor_shipper_id":"VSS-1",
"vendor_consignee_id":"VDS-1",
"dispatch_trips":[
{
"vendor_id":"VT-6",
"driver_id":4805,
"vehicle_id":2596,
"vendor_stop_ids":[
"VSS-1",
"VCS-1"
],
"status":"not_started"
},
{
"vendor_id":"VT-7",
"driver_id":4806,
"vehicle_id":3596,
"vendor_stop_ids":[
"VCS-2",
"VDS-1"
],
"status":"not_started"
}
],
"dispatch_stops":[
{
"vendor_id":"VCS-1",
"type":"delivery",
"number":1,
"form_ids":[
"be4cd651-5aca-436b-8cf3-e7881c3d76b8",
"e93b8563-53cc-4318-b957-369b5fda18d0"
],
"early_date":"2017-07-13T19:13:00+00:00",
"late_date":"2017-07-15T19:13:00+00:00",
"vendor_dispatch_location_id":"VDSL-3"
},
{
"vendor_id":"VCS-1",
"type":"delivery",
"number":1,
"form_ids":[
"be4cd651-5aca-436b-8cf3-e7881c3d76b8",
"e93b8563-53cc-4318-b957-369b5fda18d0"
],
"early_date":"2017-07-13T19:13:00+00:00",
"late_date":"2017-07-15T19:13:00+00:00",
"vendor_dispatch_location_id":"VDSL-4"
}
],
"shipper_form_ids":[
"582e259f-c1fe-4a7f-9cb8-1873833057bc",
"51bb4fef-9f15-4e87-8121-3b6a99e7af6c"
],
"consignee_form_ids":[
"de05ebc6-5873-43b4-82fd-1dffe6805558",
"8df8e98c-9e6d-411e-8f86-0d7c3a545e70"
],
"vendor_shipper_dispatch_location_id":"VDSL-1",
"vendor_consignee_dispatch_location_id":"VDSL-2",
"shipper_type":"pickup",
"consignee_type":"dropoff"
}
The above examples would create a dispatch with dispatch trips and dispatch stops
Disclaimer: The above sample request will not work as-is because form ids and dispatch location ids will be different for your fleet. Please change these values appropriately before making a request to the API.