HyperTrackDocs
Orders

Create Route

This API is used to plan a set of unplanned orders into a route

POST
/orders/routes/

This API is used to plan a set of unplanned orders into a route

Authorization

AuthorizationBasic <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/orders/routes/" \  -H "Content-Type: application/json" \  -d '{    "track_mode": "on_time",    "ops_group_handle": "SAN_JOSE_WH",    "orders": [      {        "order_handle": "order_handle_1"      },      {        "order_handle": "order_handle_2"      }    ],    "optimise": true  }'
{  "route_handle": "route-1",  "ops_group_handle": "SAN_JOSE_WH",  "plan_mode": "manual",  "status": "planned",  "version": 1,  "estimate": {    "start_by": "2023-03-14T23:20:00Z",    "distance": 1000,    "duration": 600,    "polyline": {      "type": "LineString",      "coordinates": [        [          77.72123,          12.89617        ],        [          77.72169,          12.89595        ],        [          77.72214,          12.89572        ]      ]    },    "start_location": {      "type": "Point",      "coordinates": [        -121.8924515,        37.4124516      ]    },    "end_location": {      "type": "Point",      "coordinates": [        -121.8984515,        37.5124516      ]    }  },  "orders": [    {      "order_handle": "order_handle_1",      "fulfillment_attempt": 1,      "status": "planned",      "ops_group_handle": "SAN_JOSE_WH",      "created_at": "2023-03-14T23:00:00Z",      "scheduled_at": "2023-03-14T23:50:00Z",      "scheduled_after": "2023-03-14T23:20:00Z",      "metadata": {        "customerId": "1223344"      },      "region": {        "city": "Fremont",        "state": "California",        "country": "United States of America"      },      "destination": {        "geometry": {          "type": "Point",          "coordinates": [            -121.8984515,            37.5124516          ]        },        "radius": 50,        "address": "Mission Peak, Fremont CA 94539"      },      "risk_status": false,      "expected_service_time": 600,      "product_type": [        "plumber"      ],      "capacity_used": 5    },    {      "order_handle": "order_handle_2",      "fulfillment_attempt": 1,      "status": "planned",      "ops_group_handle": "SAN_JOSE_WH",      "created_at": "2023-03-14T23:00:00Z",      "scheduled_at": "2023-03-15T01:30:00Z",      "scheduled_after": "2023-03-15T01:00:00Z",      "metadata": {        "customerId": "1224244"      },      "region": {        "city": "San Francisco",        "state": "California",        "country": "United States of America"      },      "destination": {        "geometry": {          "type": "Point",          "coordinates": [            -122.3779263,            37.7320465          ]        },        "radius": 50,        "address": "888 Innes Ave, San Francisco, CA 94124"      },      "risk_status": false,      "expected_service_time": 600,      "product_type": [        "plumber"      ],      "capacity_used": 5    }  ],  "embed_url": "https://embed.hypertrack.com/dkdkddnd"}
{  "detail": {},  "message": "string"}
{  "detail": {    "<location>": {      "<field_name>": [        "string"      ]    }  },  "message": "string"}