Skip to main content

Endpoint

POST /exchange

Request Body

ParameterTypeDescription
action*objectSee below
action.type*stringMust be "cancel"
action.cancels*arrayCancel items
action.cancels[].a*string | numberCompatibility asset selector
action.cancels[].o*stringInternal Notional order id
nonce*numberReplay-protection nonce
expiresAfternumberOptional expiration timestamp in ms
signature*objectEIP-712 signature

Response

{
  "status": "ok",
  "response": {
    "type": "cancel",
    "data": {
      "statuses": [{ "success": true }, { "pending": { "cloid": "0x1a2b3c..." } }]
    }
  },
  "metadata": {
    "results": [
      {
        "oid": "0x1a2b3c...",
        "status": "confirmed",
        "orderId": "0x1a2b3c..."
      },
      {
        "oid": "0x4d5e6f...",
        "status": "pending",
        "orderId": "0x4d5e6f..."
      }
    ]
  }
}

Status Variants

Response statusMeaning
success: trueVenue confirmed the cancel
pending.cloidCancel was submitted but venue confirmation timed out
errorValidation, reducer, or venue failure
metadata.results[].status may be confirmed, failed, pending, rejected, not_found, no_venue_id, or invalid_state.

Example Request

curl -X POST https://api.notional.xyz/exchange \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "type": "cancel",
      "cancels": [
        {
          "a": "BTC",
          "o": "0x1a2b3c4d5e6f7890..."
        }
      ]
    },
    "nonce": 1701234567890,
    "signature": {
      "r": "0x1234...",
      "s": "0x5678...",
      "v": 27
    }
  }'

Notes

  • Cancelable states are open, partial, and waitingForTrigger. - Maximum batch size is 256 cancels. - action.cancels[].o is always the internal Notional order id, not the venue order id.