Connect API

Batch import orders

POST
/orders:import

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 up to 100 orders for the authenticated retailer in one request. Always returns 200; per-item 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:import.

application/json
  1. body

Input shape accepted by POST /orders:import.

orders*array<>

The orders to create. At most 100 per request.

Items1 <= items <= 100

Response Body

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

application/json
  1. response

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

success*array<>

The ids of the orders created successfully.

failed*array<>

The inputs that failed, each with the public error code.

Example Request
curl -X POST 'https://api.spoke.com/connect/v1/orders:import' \  -H 'Content-Type: application/json' \  -d '{  "orders": [    {      "address": {}    }  ]}'
Example Response
{  "success": [    "string"  ],  "failed": [    {      "order": {        "address": {          "addressLineOne": "string",          "addressLineTwo": "string",          "city": "string",          "state": "string",          "zip": "string",          "country": "string",          "addressName": "string",          "latitude": -90,          "longitude": -180        },        "recipient": {          "name": "string",          "email": "user@example.com",          "phone": "string",          "externalId": "string"        },        "packageInfo": {          "products": [            "string"          ],          "packageCount": 1,          "weight": {            "amount": 0,            "unit": "kilogram"          },          "packageLoadAmount": 1,          "externalId": "string"        },        "deliveryInstructions": {          "notes": "string",          "expectedDeliveryDate": {            "day": 1,            "month": 1,            "year": 2000          },          "proofOfAttemptRequirements": {            "enabled": true          },          "handOffInfo": {            "handOffType": "ship_to_courier",            "pickupLocationId": "string"          }        },        "index": -9007199254740991      },      "error": {        "code": "string",        "message": "string"      }    }  ]}

Was this page helpful?