Create a new stop
The playground uses your live account
Create a new stop with the given data on live plans. When the plan is not writable, this endpoint starts an editing session and the action can be applied through a new optimization, or be discarded. 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.
BasicAuthAuthorizationBasic <token>Use the API key as the username and leave the password empty.
planId*stringThe plan id
^[a-zA-Z0-9---_]{1,50}$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- 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?|nullrecipient?|nullorderInfo?|nullpaymentOnDelivery?|nullproofOfAttemptRequirements?|nullallowedDrivers?array<>|Driver IDs that are allowed to be assigned to this stop. These drivers must be configured as part of the plan to be valid.
activity?|Activity type
"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
clientId?|Client ID of the retailer in Spoke Connect
barcodes?array<>List of barcode IDs associated with this stop
items <= 200customProperties?|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.
serviceInfo?|nullSuccess
application/json- response
Success
pending*booleanstop*A stop of a plan, can be related to a route.
curl -X POST 'https://api.spoke.com/public/v1/plans/string/stops:liveCreate' \ -H 'Content-Type: application/json' \ -d '{ "address": {}}'{ "pending": true, "stop": { "id": "string", "address": { "address": "string", "addressLineOne": "string", "addressLineTwo": "string", "latitude": -90, "longitude": -180, "placeId": null, "placeTypes": [ "string" ] }, "barcodes": [ "string" ], "allowedDrivers": [ "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" ], "invoiceNumber": null, "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, "timeAtStopInfo": { "status": "available", "value": { "arrivedAt": 0, "departedAt": 0, "isEstimated": true } }, "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": { "status": "available", "value": { "estimatedArrivalAt": 0, "estimatedLatestArrivalAt": 0, "estimatedEarliestArrivalAt": 0 } }, "timing": { "timeWindows": [ { "earliestAttemptTime": { "hour": 0, "minute": 0 }, "latestAttemptTime": { "hour": 0, "minute": 0 } } ], "estimatedAttemptDuration": null, "earliestAttemptTime": { "hour": 0, "minute": 0 }, "latestAttemptTime": { "hour": 0, "minute": 0 } }, "optimizationOrder": "first", "customProperties": { "property1": "string", "property2": "string" }, "clientId": null, "serviceInfo": { "status": "available", "value": { "identifier": "string", "name": "string", "slaStartsAt": 0, "slaDueDate": { "day": 1, "month": 1, "year": 2000 }, "slaDueTime": { "hour": 0, "minute": 0 }, "deliveryHorizon": { "unit": "days", "value": 0 }, "price": { "value": 0, "currency": "AED" }, "hasPaymentOnDelivery": true, "definedAt": 0 } } }}