---
title: "Delete Orders by Order Number"
method: DELETE
path: "/orders/order-number/{order_number}"
tags: ["Orders"]
---

# Delete Orders by Order Number

`DELETE /orders/order-number/{order_number}`

## Request

- Base URL: `https://api.smartroutes.io/v2`
- URL: `https://api.smartroutes.io/v2/orders/order-number/{order_number}`
- Auth: none declared

Delete an order from your depot using your own order number instead of the SmartRoutes `id`. The match is exact. URL-encode order numbers that contain characters such as `/`. The response gives the number of orders and line items deleted.

Deleting an order also deletes:
- its line items, custom fields, capacities, time windows and other details
- its links to any route stops and plans it was on
- proof of delivery photos and signatures recorded against the order

If the order is one half of an exchange, its partner order is deleted too and counted in `orders_count`.

If no order in your depot has this number, the request still succeeds, with `orders_count: 0`. It does not return 404. If you later send the same order number to `POST /orders`, the order is restored under its original `id`.

## Path parameters

- `order_number` string, required

## Response `200`

Successful response

## Other responses

- `403`: Forbidden. Returned for rate-limit exhaustion (`name = FORBIDDEN`, with `details.retry_after_seconds` and `Retry-After` header) and permission gate failures (`name = PERMISSION`). Inspect `name` to disambiguate. Send `x-sr-api-features: rate-limit-429` to receive `429 RATE_LIMIT_EXCEEDED` for the rate-limit case instead, leaving `403` to mean permission failures only — see [API Features](#section/Getting-started/API-Features).
- `404`: The requested resource was not found.
- `429`: Rate limit exceeded (`name = RATE_LIMIT_EXCEEDED`). **Only returned to callers that opt in** with the `x-sr-api-features: rate-limit-429` request header; without it the same condition returns `403` with `name = FORBIDDEN` and an otherwise identical body. See [API Features](#section/Getting-started/API-Features).
- `500`: An unexpected server error occurred. The body carries only `name` and `description`: internal details are never returned.

---

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