# DELETE Cancel Order

```
DELETE https://api.liquidcharts.com/dxsca-web/accounts/{account code}/orders/{order code}
```

```
DELETE https://api.liquidcharts.com/dxsca-web/accounts/{account code}/orders/group
```

Cancel an existing order on an account

This API allows canceling order on an account. Users can always cancel orders on their own accounts, but can only cancel orders on behalf of other accounts if a special permission is set.

Only conditional requests are accepted.

```
// Request

Empty request

Authorization header should be included in case of basic authentication
```

```
// Path Parameters

accountCode - unique code assigned to an account (URL-encoded, https://en.wikipedia.org/wiki/Percent-encoding). See account code
order code - either a client order id (assigned by the client during order placement) or an internal code assigned by the system ("action key" of the order chain). The code should be URL-encoded.
```

```
// Query Parameters

The following query arguments are supported for the /orders/group resource:

order-codes - comma-separated list of order codes. Note that the order in this list is important for groups with parent, first order in list is parent, next orders are children.
contingency-type - contingency type of order group to cancel.
```

```
// Response

Order Response for the cancelled order or a list of Order Responses for all orders in a group (if a group was submitted)

The ETag header is not sent in response.
```

```
// Errors

Common errors

API is not permitted for the user or account with the given id doesn't exist or account with the given id is not accessible for the user or an order with such an id is not found

Status code: 404 Not Found
Error code: 2
Description: Entity not found at server
An attempt is made to cancel order which cannot be cancelled (e.g. is already in a final state)

Status code: 409 Conflict
Error code: <various>
Description: <various>
User didn't submit the conditional request header (If-Match)

Status code: 403 Forbidden
Error code: 99
Description: Conditional request required
Conditional request header (If-Match) doesn't match the current order state

Status code: 412 Precondition Failed
Error code: N/A
Description: N/A
```
