Connect API

Create an order

POST
/orders

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 order for the authenticated retailer.

Authorization

headerAuthorizationBearer <token>

Pass the API key directly as the token.

Request Body

Input shape accepted by POST /orders and POST /orders:import. Only address is required.

application/json
  1. body

Input shape accepted by POST /orders and POST /orders:import. Only address is required.

address*

Address of the delivery. Every field is optional on its own, but you must provide at least one that can locate the delivery. addressName is a display-only label and is never used for geocoding, so it does not count. When latitude and longitude are set they must be set together and override the other fields for geocoding.

recipient?|null
packageInfo?|null
deliveryInstructions?|null

Response Body

The created order.

application/json
  1. response

The created order.

id*string

The Spoke order ID.

Match^orders\/[a-zA-Z0-9_-]{1,50}$
createdAt*number

Timestamp in seconds when the order was created.

recipient*

Recipient of the delivery.

packageInfo*

Package details: products, quantities, and the retailer's own id for this order.

address*

Address of the delivery as returned on an Order.

deliveryInstructions*

How and when an order should be delivered: notes, the expected delivery date, proof-of-attempt requirements, and hand-off details.

courier*|

The courier this order has been submitted to. null until the order is submitted.

submitted*boolean

Whether the order has been submitted to a courier.

submittedAt*|

Timestamp in seconds when the order was submitted to a courier.

progress*|

Progress for the order. null until the courier assigns the order to a route.

readOnly*boolean

Whether the order is read-only. Read-only orders cannot be edited or withdrawn.

source*string

Where the order originated. retailer: created by the retailer. courier: added by the courier on the retailer's behalf, surfaced read-only.

Value in"retailer""courier"
barcodes*array<string>

List of barcodes associated with the Order.

Example Request
curl -X POST 'https://api.spoke.com/connect/v1/orders' \  -H 'Content-Type: application/json' \  -d '{  "address": {}}'
Example Response
{  "id": "string",  "createdAt": 0,  "recipient": {    "name": null,    "email": null,    "phone": null,    "externalId": null  },  "packageInfo": {    "products": [      "string"    ],    "packageCount": 0,    "weight": {      "amount": 0,      "unit": "kilogram"    },    "packageLoadAmount": null,    "externalId": null  },  "address": {    "address": "string",    "addressLineOne": "string",    "addressLineTwo": "string",    "latitude": null,    "longitude": null,    "placeId": null,    "placeTypes": [      "string"    ]  },  "deliveryInstructions": {    "notes": null,    "expectedDeliveryDate": {      "day": 1,      "month": 1,      "year": 2000    },    "proofOfAttemptRequirements": {      "enabled": null    },    "handOffInfo": {      "handOffType": "ship_to_courier",      "pickupLocationId": "string"    }  },  "courier": "string",  "submitted": true,  "submittedAt": null,  "progress": {    "trackingLink": "string",    "eta": {      "status": "available",      "value": {        "estimatedArrivalAt": 0,        "estimatedEarliestArrivalAt": 0,        "estimatedLatestArrivalAt": 0      }    },    "attempted": true,    "attemptedAt": 0,    "state": "delivered_to_recipient",    "routeStartDate": {      "day": 1,      "month": 1,      "year": 2000    },    "routeStarted": true,    "succeeded": true,    "photoUrls": [      "string"    ],    "signatureUrl": "string",    "signeeName": "string",    "driverProvidedRecipientNotes": "string"  },  "readOnly": true,  "source": "retailer",  "barcodes": [    "string"  ]}

Was this page helpful?