---
title: "Import Orders Into Dispatch Plan"
method: POST
path: "/v1/plans/{planId}/orders:import"
tags: ["Dispatch plans"]
---

# Import Orders Into Dispatch Plan

`POST /v1/plans/{planId}/orders:import`

## Request

- Base URL: `https://api.sandbox.usenash.com`
- URL: `https://api.sandbox.usenash.com/v1/plans/{planId}/orders:import`
- Auth: none declared

Add up to 22,000 orders per request to the plan's unplanned backlog. Orders the plan already holds are reported as unchanged, so a retry is safe. The whole selection is refused when any id is unknown or ineligible (400 `PLAN_SELECTION_INVALID`, naming the ids) or another plan holds one of its orders (409 `ORDER_HELD_BY_PLAN`). More ids than one request takes fail with 422 `VALIDATION_ERRORS`. A plan holds at most 22,000 orders, 1,500 routes and 24,000 stops; an import that would grow it past them is refused with 400 `PLAN_DOCUMENT_INVALID`. Fails with 409 `PLAN_LEASE_HELD` (naming `heldBy`) while anyone has the plan open in the Planner, and with 409 `PLAN_REVISION_STALE` (naming `currentRevision`) when the plan changed since `expectedRevision`.

## Path parameters

- `planId` string, required

## Request body

- ImportDispatchPlanOrders
  - `expectedRevision` integer, required: The `revision` of the plan you last read.
  - `orderIds` string[], required: Orders to add to the backlog.

## Response `200`

OK

- ImportedDispatchPlanOrders
  - `planId` string, required
  - `revision` integer, required
  - `contentHash` string, required
  - `importedOrderIds` string[], required: Orders that joined the plan's backlog.
  - `unchangedOrderIds` string[], required: Orders the plan already held, left as they were.
  - `memberCount` integer, required: Orders the plan holds now.

## Other responses

- `422`: Unprocessable Content

---

[API](https://skmtc.dev/nash/apis/nash-api.md) - [All operations](https://skmtc.dev/nash/apis/nash-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nash/apis/nash-api/revisions/e3713837c5c9?raw)
