Skip to main content
Cancels a specific open order by removing it from the order book. The order must belong to the specified user and match the provided price and side.

Endpoint

DELETE /api/v1/order

Request

Body parameters

order_id
string
required
The unique identifier of the order to cancel
user_id
string
required
The unique identifier of the user who owns the order
price
decimal
required
The price of the order to cancel (must match the original order)
side
string
required
The order side (“BUY” or “SELL”) - must match the original order
market
string
required
The trading pair market (e.g., “SOL_USDC”, “BTC_USDT”)

Response

Success response

status
string
Status message indicating the order was cancelled
order_id
string
The unique identifier of the cancelled order

Error response

status
string
Status message indicating the order cancellation failed

Example

curl -X DELETE http://localhost:8080/api/v1/order \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "550e8400-e29b-41d4-a716-446655440000",
    "user_id": "user123",
    "price": "150.50",
    "side": "BUY",
    "market": "SOL_USDC"
  }'
Success response:
{
  "status": "Cancelled Order",
  "order_id": "550e8400-e29b-41d4-a716-446655440000"
}
Error response:
{
  "status": "Failed to Cancel Order"
}

Error codes

  • 200 OK - Order cancelled successfully
  • 500 Internal Server Error - Failed to cancel the order or Redis connection error

Build docs developers (and LLMs) love