Connect API

Batch submit orders

POST
/orders:submit

The playground uses your live account

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

Submit up to 100 draft orders to a connected courier in one request. Submitted orders are picked up at the pickup location (or shipped to the courier) and delivered from the courier's depot. Always returns 200 when the courier is valid; per-order outcomes are split across success and failed.

Authorization

headerAuthorizationBearer <token>

Pass the API key directly as the token.

Request Body

Input shape accepted by POST /orders:submit.

application/json
  1. body

Input shape accepted by POST /orders:submit.

orderIds*array<>

The orders to submit. At most 100 per request.

Items1 <= items <= 100
courierId*string

The courier to submit the orders to. Must be a courier connected to the retailer.

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

Response Body

The per-order results. Always returned when the request itself is valid, even when every order fails.

application/json
  1. response

The per-order results. Always returned when the request itself is valid, even when every order fails.

success*array<>

The ids of the orders processed successfully.

failed*array<>

The order ids that failed, each with the public error code.

Example Request
curl -X POST 'https://api.spoke.com/connect/v1/orders:submit' \  -H 'Content-Type: application/json' \  -d '{  "orderIds": [    "string"  ],  "courierId": "string"}'
Example Response
{  "success": [    "string"  ],  "failed": [    {      "orderId": "string",      "error": {        "code": "order_not_found",        "message": "string"      }    }  ]}

Was this page helpful?