# Cancel Order

## Cancels an order under exchange client

<mark style="color:red;">`DELETE`</mark> `https://api.ajaib.co.id/coin/internal/v1/order`

**Functionality:** Cancels or withdraws an open order belonging to the exchange client's trading account.&#x20;

Instruction is valid if the order is open (only orders with status `NEW`, `OPEN`, `PARTIALLY_FILLED`). Otherwise, this instruction will be rejected automatically.&#x20;

A successful response returned simply means the exchange has received (order) instructions to act upon. However, it is no guarantee all (order) instructions have been processed successfully.

**Authentication**: Required

#### Request Param

<table><thead><tr><th width="145">Name</th><th width="107">Type</th><th width="123" data-type="checkbox">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>order_id</td><td>long</td><td>true</td><td>Unique identifier generated by Ajaib exchange for orders submitted successfully</td></tr><tr><td>symbol</td><td>string</td><td>true</td><td>Symbol of trading pair . Refer to <a href="/pages/1XiqY9MA12NdesoNIyPT#asset-symbols-trading-pairs">this</a></td></tr></tbody></table>

{% tabs %}
{% tab title="200 Sent Success" %}

```
{
  "status": "CANCEL_SENT"
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```
{
    "error": "order_already_closed"
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

```
{
    "error": "invalid_client"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ajaib.gitbook.io/coin-exchange/api-references/spot-trading/cancel-order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
