Connect API

Edit an order

PATCH
/orders/{id}

The playground uses your live account

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

Edit an order for the authenticated retailer. An omitted field is left unchanged, an explicit null clears a nullable field, an empty nested object changes nothing, and arrays replace the whole stored array. A provided address replaces the stored address in full and is re-geocoded exactly as on create. A read-only order (added by the courier, or already on a route) cannot be edited.

Authorization

headerAuthorizationBearer <token>

Pass the API key directly as the token.

Path Parameters

id*string

The Spoke order ID.

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

Request Body

Input shape accepted by PATCH /orders/{id}. An omitted field is left unchanged, an explicit null clears a nullable field, an empty nested object changes nothing, and arrays replace the whole stored array.

application/json
  1. body

Input shape accepted by PATCH /orders/{id}. An omitted field is left unchanged, an explicit null clears a nullable field, an empty nested object changes nothing, and arrays replace the whole stored array.

address?

The address of the delivery. A provided address replaces the stored address in full and is re-geocoded exactly as on create.

recipient?

The recipient of the delivery.

packageInfo?

Package details: products, quantities, and the retailer's own id. Set weight or packageLoadAmount, not both.

deliveryInstructions?

How and when to deliver.

Response Body

The updated order.

application/json
  1. response

The updated 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 PATCH 'https://api.spoke.com/connect/v1/orders/string' \  -H 'Content-Type: application/json' \  -d '{}'
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?