curl --request DELETE \
--url https://api.example.com/order \
--header 'Content-Type: application/json' \
--data '
{
"orderId": "<string>"
}
'{
"success": true,
"error": "<string>"
}Cancel an existing open order
curl --request DELETE \
--url https://api.example.com/order \
--header 'Content-Type: application/json' \
--data '
{
"orderId": "<string>"
}
'{
"success": true,
"error": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/kuestcom/prediction-market/llms.txt
Use this file to discover all available pages before exploring further.
KUEST_ADDRESS - User’s wallet addressKUEST_API_KEY - API key from trading auth credentialsKUEST_PASSPHRASE - Passphrase from trading auth credentialsKUEST_TIMESTAMP - Current Unix timestamp (seconds)KUEST_SIGNATURE - HMAC signature of the requestContent-Type: application/jsonAccept: application/jsonorderID returned when the order was placed.| Status Code | Description |
|---|---|
404 | Order not found |
409 | Order is already filled or cancelled |
401 | Unauthorized - invalid credentials |
403 | Forbidden - order belongs to different user |
500 | Internal server error |
live - Active and waiting for matchespartially_filled - Partially executed, remainder is activefilled - Completely executedcancelled - Already cancelledexpired - Past expiration timerejected - Failed validationcurl -X DELETE 'https://api.kuest.io/order' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'KUEST_ADDRESS: 0x1234...' \
-H 'KUEST_API_KEY: your-api-key' \
-H 'KUEST_PASSPHRASE: your-passphrase' \
-H 'KUEST_TIMESTAMP: 1709467200' \
-H 'KUEST_SIGNATURE: computed-hmac-signature' \
-d '{
"orderId": "ord_abc123xyz789"
}'
```bash
## Example Success Response
```json
{
"success": true
}
```bash
## Example Error Response
```json
{
"error": "Order is already filled or cancelled."
}
```bash
## HMAC Signature Generation
The `KUEST_SIGNATURE` header must contain an HMAC-SHA256 signature of:
```bash
{timestamp}{method}{path}{body}
```bash
Where:
- `timestamp` - Unix timestamp in seconds (same as KUEST_TIMESTAMP header)
- `method` - HTTP method (`DELETE`)
- `path` - Request path (`/order`)
- `body` - JSON request body as string
**Example signature input:**
```bash
1709467200DELETE/order{"orderId":"ord_abc123xyz789"}
```bash
Use your CLOB secret key to generate the HMAC signature.
## Bulk Cancellation
To cancel multiple orders:
- Make multiple DELETE requests (can be done in parallel)
- Each order requires a separate cancellation request
- Failed cancellations don't affect other requests
## Rate Limiting
Order cancellation requests are subject to rate limits:
- Maximum 100 cancellations per minute per user
- Exceeded limits return 429 status code
## Best Practices
1. **Verify Order State** - Check order status before attempting cancellation
2. **Handle 404 Gracefully** - Order may have been filled between status check and cancellation
3. **Retry Logic** - Implement exponential backoff for temporary failures
4. **Track Cancelled Orders** - Update local state after successful cancellation
5. **WebSocket Updates** - Subscribe to order updates for real-time status changes
## See Also
- [Place Order](/api/trading/place-order) - Submit a new order
- [Get Orders](/api/trading/get-orders) - Retrieve user's orders
- [Orderbook](/api/trading/orderbook) - View market orderbook