Skip to main content
Skip to Content
Dispatch API
This is the documentation for Dispatch API v0.2b, which is no longer actively maintained. For up-to-date documentation, see the latest version (v1.0).

Create a new stop

POST
/plans/{planId}/stops

The playground uses your live account

Requests are sent with your real API key, so creating, updating or deleting here changes your production data.

Create a new stop with the given data. Prefer using the batch import endpoint if you want to create multiple stops at once as it is more efficient and will produce better geocoding results. If the plan is not writable, this will fail, prefer using the Live Create Stop API instead.

Authorization

BasicAuth
headerAuthorizationBasic <token>

Use the API key as the username and leave the password empty.

Path Parameters

planId*string

The plan id

Match^[a-zA-Z0-9---_]{1,50}$

Request Body

The request body for creating a stop. The only required field is address, you need to provide at least one of the fields in it. The latitude and longitude fields will override any of the other fields if they are set(and they need to be both set if any of them are). The more fields you provide the more accurate the geocoding will be.

application/json
  1. body

The request body for creating a stop. The only required field is address, you need to provide at least one of the fields in it. The latitude and longitude fields will override any of the other fields if they are set(and they need to be both set if any of them are). The more fields you provide the more accurate the geocoding will be.

address*

Address of the stop, at least one of the fields is required. If the latitude and longitude fields are set they will override any of the others. The addressName field is not used for geocoding and is only for display purposes.

timing?|null
recipient?|null
orderInfo?|null
paymentOnDelivery?|null
proofOfAttemptRequirements?|null
driver?|

Deprecated. Prefer using the allowedDrivers field instead. Driver ID that should be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the allowedDrivers field.

allowedDrivers?array<>|

Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization. This field is mutually exclusive with the driver field. When the stop is first created, all the drivers in this list will be added to the plan as well. If the stop is updated, no changes will be made to the plan, so if you want to add a driver to the plan, you must also add them to the plan separately, if they are not already.

activity?|

Activity type

Default"delivery"
optimizationOrder?|

The preferred order of this stop in the optimized route. If not provided or "default", the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either "first" or "last".

packageCount?|

Number of packages in the stop

weight?|

Weight information for this stop.

notes?|

Notes for the stop

circuitClientId?|

Client ID of the retailer in Spoke Connect

barcodes?array<>

List of barcode IDs associated with this stop

Itemsitems <= 200
customProperties?|

Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.

Response Body

The created stop

application/json
  1. response

The created stop

id*string

The id of the stop, in the format plans/<id>/stops/<id>.

Match^plans\/[a-zA-Z0-9---_]{1,50}\/stops\/[a-zA-Z0-9---_]{1,50}$
address*

The address of the stop.

barcodes*array<string>

List of Barcode IDs associated with the stop.

driverIdentifier*|

The driver identifier. This field is deprecated, prefer using allowedDriversIdentifiers.

allowedDriversIdentifiers*array<string>

The allowed drivers that can be assigned to this stop, replaces the driverIdentifier field.

estimatedTravelDuration*|

Estimated time that the driver will take to arrive at this stop from the previous stop in seconds.

estimatedTravelDistance*|

The distance in meters between the previous stop and this stop.

notes*|

Notes for the stop.

packageCount*|

The number of packages.

weight*|null
type*string

The type of the stop. start is the first stop of the route, stop is a stop in the middle of the route, and end is the last stop of the route.

Value in"start""stop""end"
packageLabel*|

The label of the package.

stopPosition*|

The position of the stop in the route.

trackingLink*|

The recipient tracking link.

webAppLink*string

The web app link.

orderInfo*

The order information of the stop.

placeInVehicle*|null
recipient*

The recipient of the stop.

activity?string
Default"delivery"
Value in"delivery""pickup"
deliveryInfo*|null
paymentOnDelivery*|null
proofOfAttemptRequirements*

The proof of attempt requirements of the stop.

plan*string

The id of the plan, in the format plans/<id>.

Match^plans\/[a-zA-Z0-9---_]{1,50}$
route*|

The route of the stop, if any.

eta*|null
etaNullReason*|null
timing*

The timing data of the stop.

optimizationOrder?string
Default"default"
Value in"first""last""default"
customProperties*|

Custom properties of the stop, can be used to store additional information.

circuitClientId*|

The associated Client ID of the Spoke Connect

Example Request
curl -X POST 'https://api.spoke.com/public/v0.2b/plans/string/stops' \  -H 'Content-Type: application/json' \  -d '{  "address": {}}'
Example Response
{  "id": "string",  "address": {    "address": "string",    "addressLineOne": "string",    "addressLineTwo": "string",    "latitude": -90,    "longitude": -180,    "placeId": null,    "placeTypes": [      "string"    ]  },  "barcodes": [    "string"  ],  "driverIdentifier": null,  "allowedDriversIdentifiers": [    "string"  ],  "estimatedTravelDuration": null,  "estimatedTravelDistance": null,  "notes": null,  "packageCount": null,  "weight": {    "amount": 0,    "unit": "kilogram"  },  "type": "start",  "packageLabel": null,  "stopPosition": null,  "trackingLink": null,  "webAppLink": "string",  "orderInfo": {    "products": [      "string"    ],    "sellerName": null,    "sellerOrderId": null,    "sellerWebsite": null  },  "placeInVehicle": {    "x": "left",    "y": "front",    "z": "floor"  },  "recipient": {    "name": null,    "email": null,    "phone": null,    "externalId": null  },  "activity": "delivery",  "deliveryInfo": {    "attempted": true,    "attemptedAt": 0,    "arrivedAt": 0,    "timeAtStopInfo": {      "arrivedAt": 0,      "departedAt": 0,      "isEstimated": true    },    "timeAtStopInfoNullReason": {      "reason": "subscription_not_supported",      "message": "string",      "url": "string"    },    "attemptedLocation": {      "latitude": 0,      "longitude": 0    },    "driverProvidedInternalNotes": "string",    "driverProvidedRecipientNotes": "string",    "photoUrls": [      "string"    ],    "recipientProvidedNotes": "string",    "signatureUrl": "string",    "signeeName": "string",    "succeeded": true,    "state": "delivered_to_recipient"  },  "paymentOnDelivery": {    "amount": 0,    "currency": "string"  },  "proofOfAttemptRequirements": {    "enabled": null  },  "plan": "string",  "route": {    "id": "string",    "title": "string",    "stopCount": 0,    "driver": "string",    "state": {      "completed": true,      "completedAt": 0,      "distributed": true,      "distributedAt": 0,      "notifiedRecipients": true,      "notifiedRecipientsAt": 0,      "started": true,      "startedAt": 0    },    "plan": "string"  },  "eta": {    "estimatedArrivalAt": 0,    "estimatedLatestArrivalAt": 0,    "estimatedEarliestArrivalAt": 0  },  "etaNullReason": {    "reason": "not_optimized",    "message": "string",    "url": "string"  },  "timing": {    "estimatedAttemptDuration": null,    "earliestAttemptTime": {      "hour": 0,      "minute": 0    },    "latestAttemptTime": {      "hour": 0,      "minute": 0    }  },  "optimizationOrder": "first",  "customProperties": {    "property1": "string",    "property2": "string"  },  "circuitClientId": null}