Skip to content

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:

  1. Check if the order can be cancelled (whether trading process has started)
  2. If cancellable, execute cancellation operation (unlock order)
  3. Call this endpoint to notify the system of cancellation result

Request Parameters

FieldTypeRequiredDescription
order_hashstringYesOrder hash
taker_addressstringYesTaker address
cancellation_successbooleanYesWhether cancellation succeeded
messagestringYesResult message

Response Parameters

FieldTypeDescription
successbooleanWhether API call succeeded
messagestringResponse message
order_hashstringOrder 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_request WebSocket 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