> For the complete documentation index, see [llms.txt](https://docs.deltadefi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.deltadefi.io/start-trading/developers/api-documentation/order/build-cancel-order-transaction.md).

# 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"}}}}}}
```
