Cancellation Response
Endpoint Information
Endpoint: POST /api/v1/orders/cancel-result
Description: When Maker requests to cancel a locked order, Taker returns the cancellation result through this endpoint
Authentication: API Key credential authentication
Use Case
When Taker receives a cancellation_request message via WebSocket, it needs to:
- Check if the order can be cancelled (whether trading process has started)
- If cancellable, execute cancellation operation (unlock order)
- Call this endpoint to notify the system of cancellation result
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| order_hash | string | Yes | Order hash |
| taker_address | string | Yes | Taker address |
| cancellation_success | boolean | Yes | Whether cancellation succeeded |
| message | string | Yes | Result message |
Response Parameters
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether API call succeeded |
| message | string | Response message |
| order_hash | string | Order hash |
Request Examples
Cancellation Success
bash
curl -X POST "/api/v1/orders/cancel-result" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_hash": "0x1234567890abcdef...",
"taker_address": "0xabcdef1234567890...",
"cancellation_success": true,
"message": "Order cancelled successfully"
}'Cancellation Failure
bash
curl -X POST "/api/v1/orders/cancel-result" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_hash": "0x1234567890abcdef...",
"taker_address": "0xabcdef1234567890...",
"cancellation_success": false,
"message": "Order already in trading process, cannot cancel"
}'Response Example
json
{
"code": 0,
"data": {
"success": true,
"message": "Cancellation result recorded",
"order_hash": "0x1234567890abcdef..."
}
}Notes
- This endpoint must be called after receiving a
cancellation_requestWebSocket message - If cancellation succeeds (cancellation_success=true), the order will be unlocked and updated to cancelled or expired status
- If cancellation fails (cancellation_success=false), the order remains locked, and Taker should continue to complete the trade
- Recommend responding promptly after receiving cancellation request to avoid timeout