Update Route Sequence

Put the orders on a route in the order you choose

A PUT request to the /routes/{routeUuid}/sequence endpoint sets the order in which a route visits its orders. Routific applies your sequence exactly as sent and recalculates the route's arrival times, distance and working time. Nothing is re-optimized, and no order moves to another route.

Use it when your own rules decide the order of stops — loading order, customer priority, or a driver's local knowledge — rather than the optimized sequence.

Request URL

📘

Send the whole route

The request lists every order on the route, in the new order. Orders you leave out aren't removed or kept in place — the request is rejected. Read the current sequence from Fetch route timeline, reorder it, and send the full list orderUuids back.

Sample Request Payload

{
    "orders":
    [
        "6a8e071a-4ee0-470b-982e-b24ed1d1b90c",
        "9b3f2c44-1d7e-4a90-b3c1-8f2e6a91d445",
        "1c7d5e90-3a2b-4f61-8e47-2d9c0b6a5f13"
    ]
}
FieldTypeDescription
orders (required)String ArrayThe uuid of every order on the route, in the order they should be visited. Each order must appear exactly once.

The list contains orders only. Routific places the start location, end location, breaks and any waiting time around them.

Routes a driver has started

You can re-sequence a route the driver is already working. Orders at stops the driver has arrived at or completed must stay in their current positions. Everything after that can be reordered, including the stop the driver is currently driving to.

🚧

Completed route cannot be re-sequenced

A route that has been completed by the driver or has visited all of the orders in the route returns a 409 status code.

Orders at the same stop

When several orders are delivered at one stop, the sequence you send decides how they're grouped:

  • Orders you keep next to each other stay one stop.
  • Orders you separate become separate stops at the same address, visited at the points you placed them.
📘

Time windows aren't enforced

Your sequence is applied even if it means an order is reached after its time window. Each late order is marked isLate: true in the route timeline, and the action result says how many orders are late, so you can decide whether to keep the sequence.

Sample Response Payload

A valid request returns 202 Accepted. The new sequence is applied in the background.

{
    "actionUuid": "f81d4fae-7dec-11d0-a765-00a0c91e6bf6",
    "actionName": "resequenceRoute",
    "status": "pending"
}

Poll Fetch route action status with the actionUuid until status is finished

FieldTypeDescription
actionUuidStringUnique identifier of the re-sequencing action. Use this to check the status of the action.
actionNameStringName of the action being performed. Always resequenceRoute.
statusStringCurrent status of the action. Possible values: pending, finished, and failed.
🚧

Published routes need publishing again

Re-sequencing changes the route's working copy, not what the driver currently has. When unpublishedChanges is true, publish the route to send the new sequence to the driver.