EasyRoutes API

Add route Shopify orders

POST
/routes/{routeId}/shopify-orders

Adds Shopify orders to a route by route ID as SHOPIFY_ORDER stops. Unlike AddRouteStops, the orders don't need to be imported first. Each stop takes its address, note, and items from the order, and its duration and tasks from the route options. The shop's Shopify import settings and order import automation rules don't apply, so the result doesn't depend on how the shop is configured. Accepts up to 200 orders per request. A recently created order may not be synced to EasyRoutes yet; if it isn't found, retry later or refresh the orders list in the EasyRoutes app. If any order can't be added (for example, it isn't found, has no shipping address, or its address can't be geocoded), no stops are added. The new stops are added to the end of the route, and the route will not be optimized automatically, so the caller should reoptimize the route if needed via ReoptimizeRoute.

Authorization

bearerAuth
AuthorizationBearer <token>

Access token from /authenticate

In: header

Path Parameters

routeId*string

The ID of the route to add Shopify orders to.

Header Parameters

Idempotency-Key?string

A unique key for safely retrying this operation. For more information read our guide.

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[index: integer]?

Response Body

application/json

application/json

curl -X POST "https://example.com/routes/rte-123e4567-e89b-12d3-a456-426614174000/shopify-orders" \  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \  -H "Content-Type: application/json" \  -d '[    {      "shopifyOrderId": "6229749334323",      "itemSelection": "PREFER_UNFULFILLED"    }  ]'
{  "id": "rte-123e4567-e89b-12d3-a456-426614174000",  "name": "Morning route",  "driver": {    "id": "drv-123e4567-e89b-12d3-a456-426614174000",    "firstName": "John",    "lastName": "Doe",    "phone": "+14265551000",    "status": "ACTIVE"  },  "start": {    "address": {      "address1": "123 Main St",      "address2": "Apt 3B",      "city": "New York",      "provinceCode": "NY",      "countryCode": "US",      "zip": "10001"    },    "tasks": [      {        "id": "tsk-123e4567-e89b-12d3-a456-426614174000",        "title": "Delivery checklist",        "type": "TEXT_INPUT",        "items": [],        "input": {          "value": "020123456789",          "updatedAt": "2026-03-30T13:00:00Z",          "inputMethod": "SCANNED"        },        "requiredToMarkStopAsDelivered": true,        "requiredToMarkStopAsAttempted": true      }    ],    "status": "STARTED",    "updatedStart": "2026-03-30T09:05:00Z",    "scheduledStart": "2026-03-30T09:00:00Z",    "photos": [      {        "id": "att-123e4567-e89b-12d3-a456-426614174000",        "createdAt": "2026-03-30T09:05:00Z",        "url": "https://example.com/stop-attachment/attachment-2025-06-03-1"      }    ]  },  "end": {    "address": {      "address1": "123 Main St",      "address2": "Apt 3B",      "city": "New York",      "provinceCode": "NY",      "countryCode": "US",      "zip": "10001"    },    "tasks": [      {        "id": "tsk-123e4567-e89b-12d3-a456-426614174000",        "title": "Delivery checklist",        "type": "TEXT_INPUT",        "items": [],        "input": {          "value": "020123456789",          "updatedAt": "2026-03-30T13:00:00Z",          "inputMethod": "SCANNED"        },        "requiredToMarkStopAsDelivered": true,        "requiredToMarkStopAsAttempted": true      }    ],    "plannedArrival": "2026-03-30T17:00:00Z",    "distanceMeters": 1234.56,    "updatedArrival": "2026-03-30T17:05:00Z",    "status": "COMPLETED",    "photos": [      {        "id": "att-123e4567-e89b-12d3-a456-426614174000",        "createdAt": "2026-03-30T09:05:00Z",        "url": "https://example.com/stop-attachment/attachment-2025-06-03-1"      }    ]  },  "stops": [    {      "id": "rst-123e4567-e89b-12d3-a456-426614174000",      "type": "DELIVERY",      "deliveryStatus": "ATTEMPTED_DELIVERY",      "breakStatus": "COMPLETED",      "updatedAt": "2026-03-30T13:15:00Z",      "duration": "300s",      "plannedArrival": "2026-03-30T13:00:00Z",      "note": "Leave at door.",      "address": {        "address1": "123 Main St",        "address2": "Apt 3B",        "city": "New York",        "provinceCode": "NY",        "countryCode": "US",        "zip": "10001"      },      "contact": {        "firstName": "John",        "lastName": "Doe",        "company": "Roundtrip Systems Inc",        "phone": "+14265551000",        "email": "john.doe@roundtrip.ai"      },      "plannedCoordinates": {        "latitude": 40.7128,        "longitude": -74.006      },      "items": [        {          "name": "Bananas",          "quantity": 5,          "grams": 500,          "sku": "BANANA-001"        }      ],      "source": "IMPORTED_STOP",      "shopifyOrderId": "6229749334323",      "savedStopId": "sst-123e4567-e89b-12d3-a456-426614174000",      "deliveredCoordinates": {        "latitude": 0.1,        "longitude": 0.1      },      "proofOfDeliveryNote": "Left at door.",      "proofOfDeliveryPhotos": [        {          "id": "att-123e4567-e89b-12d3-a456-426614174000",          "createdAt": "2026-03-30T09:05:00Z",          "url": "https://example.com/stop-attachment/attachment-2025-06-03-1"        }      ],      "proofOfDeliverySignatures": [        {          "id": "att-123e4567-e89b-12d3-a456-426614174000",          "createdAt": "2026-03-30T09:05:00Z",          "url": "https://example.com/stop-attachment/attachment-2025-06-03-1"        }      ],      "tasks": [        {          "id": "tsk-123e4567-e89b-12d3-a456-426614174000",          "title": "Delivery checklist",          "type": "TEXT_INPUT",          "items": [],          "input": {            "value": "020123456789",            "updatedAt": "2026-03-30T13:00:00Z",            "inputMethod": "SCANNED"          },          "requiredToMarkStopAsDelivered": true,          "requiredToMarkStopAsAttempted": true        }      ],      "priority": 8,      "importedStopId": "ist-123e4567-e89b-12d3-a456-426614174000",      "orderName": "#1234",      "distanceMeters": 123.45,      "updatedArrival": "2026-03-30T13:05:00Z",      "timeWindows": [        {          "start": {            "hours": 9          },          "end": {            "hours": 17          }        }      ],      "deliveryDate": {        "year": 2025,        "month": 12,        "day": 16      },      "attributes": [        {          "key": "color",          "value": "blue"        }      ],      "clientStopId": "test-order-1234",      "tags": [        "foo",        "bar"      ],      "attemptedReason": "NOT_AVAILABLE",      "attemptedNote": "Customer did not answer the door.",      "customerRating": {        "rating": 5,        "comment": "Excellent delivery",        "createdAt": "2026-03-30T18:00:00Z"      },      "customSignatureDisclosure": "I acknowledge that I have received this delivery.",      "shopifyOrder": {        "orderNote": "Customer has paid.",        "customerNote": "Leave at door."      },      "proofOfDeliveryBarcodes": [        {          "value": "123456789012",          "createdAt": "2026-03-30T13:10:00Z"        }      ],      "proofOfDeliveryBarcodeIssues": [        {          "reason": "ITEM_MISSING",          "note": "Item was not packed.",          "createdAt": "2026-03-30T13:10:00Z"        }      ],      "orderReferenceUrl": "https://orders.example.com/orders/148977776"    }  ],  "createdAt": "2026-03-29T08:00:00Z",  "updatedAt": "2026-03-30T13:15:00Z",  "archivedAt": "2026-04-05T00:00:00Z",  "scheduledFor": "2026-03-30T09:00:00Z",  "totalDistanceMeters": 2387.2,  "totalItemQuantity": 50,  "totalItemGrams": "6000",  "optimized": true,  "dispatchedUntil": "2026-03-30T20:00:00Z",  "note": "Fragile items.",  "tags": [    "foo",    "bar"  ],  "defaultStopDuration": "300s",  "maxDuration": "28800s",  "maxStops": 50,  "maxItemCount": 200,  "maxKilograms": 500,  "avoidTolls": true,  "avoidUTurns": true,  "speedFactor": 0.8,  "vehicle": {    "id": "veh-123e4567-e89b-12d3-a456-426614174000",    "name": "Delivery Van 1",    "make": "Ford",    "model": "Transit",    "year": 2023,    "type": "CARGO_VAN",    "vin": "1FTBW2CM5NKA12345",    "license": "ABC-1234",    "isArchived": false,    "createdTimestamp": "2026-07-30T12:00:00Z"  }}
{  "code": 0,  "message": "string",  "details": [    {      "@type": "string"    }  ]}