---
title: "Using order delete"
slug: "using-order-delete"
abstract: "How to delete an offline order using the Batch API."
---
# Using order delete

The [Order Delete endpoint](https://doc.sitecore.com/cdp/en/developers/api/batch-api/batch-api-offline-orders/order-delete-data-model.html "Order delete data model") in the Sitecore CDP Batch API enables you to delete an order and all order items associated with the order. After you delete an order, it is no longer visible in the guest profile. You cannot undo this operation. After you delete an order, you cannot retrieve the order or any related order items.

The Order Delete API uses a combination of the `referenceId` and `orderedAt` values to identify the order to delete. This is because some organizations recycle `referenceId` values so providing the `orderedAt` value ensures you are identifying the correct order for deletion.

To delete an order, you must [upload a batch file](https://doc.sitecore.com/cdp/en/developers/api/batch-api/upload-a-batch-file/upload-batch-file.html "Upload batch file") containing the order. You must use `delete` mode.

The Order Delete endpoint then attempts to find any orders that match the `referenceId` and `orderedAt` values:

- If the Order Delete endpoint finds one order with a matching `referenceId` value, the Order Delete endpoint returns a 200 Response `Order and associated entities deleted`. The order is permanently deleted along with its order items.
- If the Order Delete endpoint finds more than one order with the same `referenceId` value and you didn't provide a date for the `orderedAt` value, the Order Delete endpoint returns a 400 Response  *More than one order exists with that referenceId, please supply the orderedAt date for the order you wish to delete*.
- If the Order Delete endpoint doesn't find an order with the provided `referenceId` value and `orderedAt` value, the Order Delete endpoint returns a 404 Response *No order found for the provided referenceId and orderedAt attributes*.