# Cancel Order

Cancel a single order by order ID. This endpoint directly cancels the order without requiring a separate build/submit step.

## Cancel an order

> Cancel a single order by order ID

```json
{"openapi":"3.1.1","info":{"title":"Espresso API Server","version":"1.0"},"paths":{"/order/{orderId}/cancel":{"post":{"description":"Cancel a single order by order ID","tags":["order"],"summary":"Cancel an order","parameters":[{"schema":{"type":"string"},"description":"Order ID","name":"orderId","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/espresso_internal_api_response.CancelOrderResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/espresso_internal_api_response.ErrorJSONWithCodeResponse"}}}},"404":{"description":"Order Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/espresso_internal_api_response.ErrorJSONWithCodeResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/espresso_internal_api_response.ErrorJSONWithCodeResponse"}}}}}}}},"components":{"schemas":{"espresso_internal_api_response.CancelOrderResponse":{"type":"object","properties":{"order_id":{"type":"string"}}},"espresso_internal_api_response.ErrorJSONWithCodeResponse":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"string"}}}}}}
```


---

# 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://docs.deltadefi.io/start-trading/developers/api-documentation/order/build-cancel-order-transaction.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.
