There are two ways to get rid of an order you no longer want to ship:

- **Cancel** sets the status to *Cancelled* and takes the order off all pick lists. The order stays in X-Sitter and remains traceable.
- **Delete** removes the order and all its lines permanently. This is only possible as long as the order is not on a pick list.

![Screenshot: Order details with the "Delete" button in the header and the status dropdown](/orders/images/cancel-or-delete-order-details.png)

## Before you start
- To cancel, your user needs the permission to change the order status.
- To delete, your user needs the permission to delete orders.
- To take an order off a pick list, your user needs the permission to delete pick lists.

Ask your administrator if a button is missing.

!!!
If you are not sure, cancel instead of deleting. A cancelled order keeps its history; a deleted order cannot be restored.
!!!

## Step by step

### Cancel an order
1. Open the order in **Orders › Overview** (*Aufträge › Übersicht*).
2. In the [order details](/orders/order-details.md) choose **Cancelled** (*Storniert*) in **Change status** (*Status ändern*).

To cancel several orders, tick them in the overview and use **Actions** (*Aktionen*) › **Change status** (*Status ändern*). See [Order statuses](/orders/order-statuses.md).

![Screenshot: Status dropdown with "Cancelled" selected](/orders/images/cancel-or-delete-order-cancel.png)

### Take an order off a pick list
If deleting fails because the order is on a pick list:
1. Open the order details and go to the **Pick lists** (*Picklisten*) area.
2. Remove the order and confirm **Remove the entire order from this pick list?** (*Kompletten Auftrag von dieser Pickliste entfernen?*).

If it was the only order on the pick list, the pick list is deleted as well.

![Screenshot: Pick lists area of the order details with the confirmation "Remove the entire order from this pick list?"](/orders/images/cancel-or-delete-order-remove-picklist.png)

### Delete one order
1. In the order details click **Delete** (*Löschen*).
2. Confirm the question **Delete order?** (*Auftrag löschen?*) – "Should this order really be deleted permanently? This action cannot be undone."
3. You see **The order has been deleted.** (*Auftrag wurde gelöscht.*)

![Screenshot: Confirmation dialog "Delete order?"](/orders/images/cancel-or-delete-order-confirm.png)

### Delete several orders
1. In **Orders › Overview** tick the orders.
2. Click **Actions** (*Aktionen*) › **Delete** (*Löschen*) and confirm.

## What happens

| Action | Effect |
|---|---|
| Cancel | The order is removed from pick lists. With a JTL connection, the order is also cancelled line by line in JTL (single change only). If cancelling in JTL fails, the status stays unchanged. Stock is recalculated and the change is logged in the order history. |
| Delete | X-Sitter checks that the order is not on a pick list. Then the order and its lines are deleted and the stock of the affected articles is recalculated. |
| Remove from pick list | The order is taken off the pick list. An empty pick list is deleted. |

In all cases, stock reserved for the order is released again.

## Good to know / Troubleshooting

| Message | Cause | Solution |
|---|---|---|
| *Keine Berechtigung, Auftrag zu löschen.* (no permission to delete) | You lack the permission to delete orders. | Ask your administrator. |
| *Auftrag … kann nicht gelöscht werden, da er sich bereits auf einer Pickliste befindet.* | The order is on a pick list. | Take it off the pick list first, or cancel it instead. |
| *Auftrag … nicht gefunden oder keine Berechtigung.* | The order belongs to another client or was already deleted. | Reload the overview. |
| *… Aufträge gelöscht, aber es gab Fehler: …* | Some orders were deleted, others not. | Read the error text and handle the remaining orders. |
| **The order could not be deleted.** (*Der Auftrag konnte nicht gelöscht werden.*) | Server error. | Try again. |
