This endpoint requires signature authentication. See our comprehensive Authentication via Signatures guide for implementation details.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
Required parameters
-
action
(object, required) — The cancel action object containing:type
(string) — Must be"cancel"
cancels
(array) — Array of cancel objects with:a
(number) — Asset indexo
(number) — Order ID to cancel
-
nonce
(number, required) — Current timestamp in milliseconds (must be recent) -
signature
(object, required) — EIP-712 signature of the action
Optional parameters
vaultAddress
(string, optional) — Address when trading on behalf of a vault or subaccountexpiresAfter
(number, optional) — Timestamp in milliseconds after which the request is rejected
Returns
Returns an object with cancellation status:status
—"ok"
if request processedresponse
— Contains cancellation details:type
—"cancel"
data.statuses
— Array of status results:"success"
— Order successfully cancelederror
— Object with error message if cancellation failed
Example request
Response examples
Successful cancellation
Failed cancellation
Multiple orders mixed results
Use cases
- Risk management — Quickly cancel orders when market conditions change
- Order management — Clean up open orders that are no longer needed
- Algorithmic trading — Programmatically manage order lifecycle
- Portfolio rebalancing — Cancel orders before placing new ones
You can cancel multiple orders in a single request by including multiple objects in the
cancels
array. Each cancellation is processed independently.Attempting to cancel an order that doesn’t exist, was already canceled, or was filled will return an error but won’t affect other cancellations in the same request.
Body
application/json
Current timestamp in milliseconds
EIP-712 signature of the action with r, s, v components
Address when trading on behalf of a vault or subaccount (optional)
Timestamp in milliseconds after which the request is rejected (optional)