Cancel All Orders After

This endpoint provides a Dead Man's Switch mechanism to protect the user from network malfunctions. The user can send a request with a timeout in seconds which will trigger a countdown timer that will cancel all user orders when timeout expires. The user has to keep sending request to push back the timeout expiration or they can deactivate the mechanism by specifying a timeout of zero (0).

The recommended mechanism usage is making a call every 15 to 20 seconds and provide a timeout of 60 seconds. This allows the user to keep the orders in place on a brief network failure, while keeping them safe in case of a network breakdown.

Authentication is required.

Endpoint

Request Type Permissible API Keys
/api/v3/cancelallordersafter
POST Read-write, Master
Argument Type Required Description
timeout
positive integer Yes The timeout specified in seconds.
Sample Call

https://futures.kraken.com/derivatives/api/v3/cancelorderallordersafter?timeout=60

https://futures.kraken.com/derivatives/api/v3/cancelorderallordersafter?timeout=0

Sample Return if Successful

{  
   "result":"success",
   "status":{  
      "currentTime":"2018-06-19T16:51:23.839Z",
      "triggerTime":"2018-06-19T16:51:28.839Z"
   },
   "serverTime":"2018-06-19T16:51:23.839Z"
}

{  
   "result":"success",
   "status":{  
      "currentTime":"2018-06-19T16:54:29.419Z",
      "triggerTime":"0"
   },
   "serverTime":"2018-06-19T16:54:29.419Z"
}

Field

Type Description
result
String Always success
serverTime
ISO8601 datetime The server date and time
status
structure The status of the switch
currentTime ISO8601 datetime The server date and time that server received the request
triggerTime ISO8601 datetime The server date and time that the switch will be activated

 

Sample Return if Unsuccessful
 {  
   "result":"error",
   "serverTime":"2016-02-25T09:45:53.818Z",
   "error":"apiLimitExceeded"
}

Field

Type Description
result
String Always error
serverTime
ISO8601 datetime The server date and time
error
string

The reason the API call failed, either of:

  • apiLimitExceeded: the API limit for the calling IP address has been exceeded
  • authenticationError: the request could not be authenticated
  • invalidArgument: the specified request parameter was invalid
  • requiredArgumentMissing: a required argument was missing
  • nonceBelowThreshold: <threshold> the provided nonce is below the <threshold>
  • nonceDuplicate: <duplicate> the provided nonce is a duplicate as it has been used in a previous request