Bulk Cancel

POST /auth/cancel/bulk

Cancel orders in bulk. This endpoint is recommended when you need to cancel more than 5 orders at once.

By using this endpoint you will only consume a single rate limit request and not 5. It will also be much faster than cancelling the orders individually.

Requires a signed payload in HMAC-SHA256 form to be appended to the x-signature header. The signed payload must be base64-encoded.

Javascript example:

  const formurlencoded = require('form-urlencoded').default;
  const crypto = require("crypto-js");
  const fetch = require("node-fetch");
  const API_KEY = "<YOUR_API_KEY>";
  const SECRET_KEY = "<YOUR_SECRET_KEY>";

  (async function() {
    const payload = {'ids': ['392392320eoweqwie3', '482392320eoweqwii5']};
    const payload_url_encoded = formurlencoded(payload);
    const HMAC = crypto.HmacSHA256(payload_url_encoded, SECRET_KEY).toString(crypto.enc.Base64);
    const submitted = await fetch('https://api.testnet.everstrike.io/auth/cancel/bulk', {method: 'POST', body: payload_url_encoded, headers: {'content-type': 'application/x-www-form-urlencoded', 'x-api-key': API_KEY, 'x-signature': HMAC}});
    const response = await submitted.json();
    console.log(response);
  })();
application/x-www-form-urlencoded

Body

  • ids array[string]

    Id's of the orders to cancel (the id is returned upon submitting the order). If left empty or undefined, all active orders will be cancelled. You can submit up to 100 unique id's per request.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • code integer

      Response code

    • msg string

      Diagnostic message

    • result array[object]

      Order information

      Hide result attributes Show result attributes object
      • id string

        Unique identifier of order

      • pair string

        Market of order

      • price number

        Current price of order

      • price_orig number

        Original price of order

      • qty_orig number

        Original quantity of order

      • qty_orig_usd number

        Original USD quantity of order

      • qty_remaining number

        Quantity not yet filled

      • qty_filled number

        Quantity that has been filled

      • side string

        BUY or SELL

      • status string

        ACTIVE, CANCELLED or COMPLETED

      • time number

        Time of last update, in milliseconds

      • time_in_force string

        Time in force. Can be GTC (Good Till Cancelled), FOK (Fill Or Kill) or IOC (Immediate Or Cancel).

      • type string

        Type of order. Can be LIMIT or MARKET.

      • oco string

        OCO ID of order

      • icebergs number

        Icebergs on order

      • trigger_price number

        Trigger price of order

      • trigger_event string

        Trigger event of order. Can be MARK_PRICE, INDEX_PRICE, LAST_PRICE or null.

      • close_on_trigger boolean
      • reduce_only boolean

        If true, the order can only decrease the size of your position.

      • post_only boolean

        If true, the order can only trade as maker.

      • hidden boolean

        If true, the order does not show in the order book.

  • 503 application/json

    Error

    Hide response attributes Show response attributes object
    • code integer
    • msg string
    • result object
POST /auth/cancel/bulk
curl \
 --request POST 'https://api.testnet.everstrike.io/auth/cancel/bulk' \
 --header "x-api-key: $API_KEY" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'ids=string'
Response examples (200)
{
  "code": 200,
  "msg": "null",
  "result": [
    {
      "id": "849cdea0395411e98f54b395ae9c7bb6",
      "pair": "USD_BTCCALL_PERP",
      "side": "SELL",
      "time": 1551137077642,
      "type": "LIMIT",
      "fills": [],
      "price": 100,
      "hidden": false,
      "status": "ACTIVE",
      "leverage": 1,
      "qty_orig": 0.002,
      "post_only": false,
      "customer_id": "5f9ca5f0-380e-11e9-bf51-91a076098e19",
      "reduce_only": false,
      "qty_orig_usd": 0.28101585963,
      "qty_remaining": 0.002,
      "time_in_force": "GTC"
    },
    {
      "id": "249cdea0395411e98f54b395ae9c7bc7",
      "pair": "USD_BTCCALL_PERP",
      "side": "SELL",
      "time": 1551137077642,
      "type": "LIMIT",
      "fills": [],
      "price": 102,
      "hidden": false,
      "status": "ACTIVE",
      "leverage": 1,
      "qty_orig": 0.003,
      "post_only": false,
      "customer_id": "5f9ca5f0-380e-11e9-bf51-91a076098e19",
      "reduce_only": false,
      "qty_orig_usd": 0.30101585963,
      "qty_remaining": 0.003,
      "time_in_force": "GTC"
    }
  ]
}
Response examples (503)
{
  "code": 503,
  "msg": "Invalid request",
  "result": {}
}