NAV Navbar
  • ABOUT Crosstower API
  • DEVELOPMENT GUIDE
  • RATE LIMITING
  • Change Log
  • BEST PRACTICES
  • REST API Reference
  • Market Data
  • Authentication
  • Authentication HS256
  • Spot Trading
  • Spot Trading History
  • Wallet Management
  • Sub-accounts
  • Socket API Reference
  • Socket Market Data
  • Socket Session Authentication
  • Socket Trading
  • Socket Spot Trading
  • Socket Wallet Management
  • Errors
  • ABOUT Crosstower API

    Crosstower REST & Streaming API version 3.0 provides programmatic access to Crosstower’s next generation trading engine.

    We strongly recommend that our new customers use API version 3.0 to get the best trading experience. We also recommend that our current traders switch to the newest version 3.0.

    API version 2.0 is still available. For detailed description refer to API v2.

    By using the Crosstower API you confirm that you have read and accepted the API License Agreement.

    DEVELOPMENT GUIDE

    API URLs

    REST https://api.crosstower.com/api/3
    Streaming Market Data wss://api.crosstower.com/api/3/ws/public
    Streaming Trading wss://api.crosstower.com/api/3/ws/trading
    Streaming Wallet wss://api.crosstower.com/api/3/ws/wallet

    DateTime Format

    All timestamps are returned in ISO 8601 format or UNIX timestamp in milliseconds (UTC).
    Example: "2021-06-03T10:20:49.315Z" or "1614815872000".

    Number Format

    All finance data, e.g., price, quantity, fee, etc., should be arbitrary precision numbers and have a string representation.
    Example: "10.2000058".

    Pagination

    Parameters:

    Parameter Description
    limit Number of results per call.
    offset Number of results offset.
    sort Sort direction.
    Accepted values: ASC (ascending order), DESC (descending order)
    by Filter type.
    Accepted values: id, timestamp
    from Interval initial value.
    If filter by timestamp is used, then parameter type is DateTime, otherwise — Number.
    till Interval end value.
    If filter by timestamp is used, then parameter type is DateTime, otherwise — Number.

    RATE LIMITING

    The following Rate Limits are applied:

    Significantly exceeding the Rate Limits can lead to suspension.

    Change Log

    30.07.2021

    28.07.2021

    BEST PRACTICES

    The Crosstower API development team strives to bring the best trading experience to API users. This manual contains a set of best practices for using the API as efficiently as possible.

    HTTP Persistent Connection

    The underlying TCP connection is kept active for multiple requests/responses. Subsequent requests will result in reduced latency as the TCP handshaking process is no longer required.

    If you use the HTTP 1.0 client, please ensure it supports the Keep-Alive directive and submit the "Connection: Keep-Alive" header with your request.

    Keep-Alive is a part of the HTTP/1.1 or HTTP/2 protocol and enabled by default on compliant clients. However, you will have to ensure your implementation does not set other values as the connection header.

    Retrieving and Updating Account State

    Use the Streaming API for real-time updates of your orders, trades, and any transaction changes.

    REST API Reference

    HTTP Status Codes

    Error Response

    {
        "error": {
            "code": 20001,
            "message": "Insufficient funds",
            "description": "Check that the funds are sufficient, taken into account the commissions"
        }
    }
    

    All error responses have error code and human readable message fields. Some errors contain an additional description field.

    Market Data

    Currencies

    Get Currencies

    curl "https://api.crosstower.com/api/3/public/currency"
    

    Response:

    {
        "BTC": {
            "full_name":"Bitcoin",
            "payin_enabled":true,
            "payout_enabled":true,
            "transfer_enabled":true,
            "precision_transfer":"0.00000001",
            "networks": [
              {
                "network":"btc",
                "protocol":"",
                "default":true,
                "payin_enabled":true,
                "payout_enabled":true,
                "precision_payout":"0.00000001",
                "payout_fee":"0.000900000000",
                "payout_is_payment_id":false,
                "payin_payment_id":false,
                "payin_confirmations":1,
                "low_processing_time":"21.709",
                "high_processing_time":"3639.385",
                "avg_processing_time":"421.6391704545454"
              }
            ]
          },
          "USDT": {
            "full_name": "Tether",
            "payin_enabled": true,
            "payout_enabled": true,
            "transfer_enabled": true,
            "precision_transfer": "0.01",
            "networks": [
              {
                "network": "BTC",
                "protocol": "OMNI",
                "default": true,
                "payin_enabled": true,
                "payout_enabled": true,
                "precision_payout": "0.01",
                "payout_fee": "45.000000000000",
                "payout_is_payment_id": false,
                "payin_payment_id": false,
                "payin_confirmations": 2,
                "low_processing_time": "3.291",
                "high_processing_time": "1495.602",
                "avg_processing_time": "85.98873076923078"
              }
            ]
        }
    }
    

    GET /api/3/public/currency

    Returns the actual list of available currencies, tokens, etc.

    You can optionally use a comma-separated list of currencies. If it is not provided, null or empty, the request returns all currencies.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    currencies String Optional. Comma-separated list of currency codes.

    Response:

    Name Type Description
    full_name String Currency full name (e.g., "Bitcoin").
    payin_enabled Boolean Determines whether it is allowed to generate addresses for a deposit.
    payout_enabled Boolean Determines whether withdrawal is allowed.
    transfer_enabled Boolean Determines whether transfer between trading account and wallet account is allowed (may be disabled on maintenance).
    precision_transfer Number Currency precision for transfer (accepted number of digits after the decimal point).
    networks Array of Network A list of the networks used for processing currency-related transactions.

    Network model consists of:

    Name Type Description
    network String Name of the network.
    protocol String Optional. Token underlying standard. Specified for tokens, for example, "ERC20".
    default Boolean Determines whether a network is used by default for processing currency-related transactions.
    payin_enabled Boolean Determines whether it is allowed to generate addresses for a deposit.
    payout_enabled Boolean Determines whether withdrawal is allowed.
    precision_payout Number Currency precision for payout (accepted number of digits after the decimal point).
    payout_fee Number Optional. Default withdrawal fee.
    payout_is_payment_id Boolean Determines whether providing additional information for withdrawal is allowed.
    payin_payment_id Boolean Determines whether it is required to provide additional information other than the address for deposit.
    payin_confirmations Number Count of blocks confirmations, which are needed for deposit.
    address_regex String Optional. Regular expression to address string.
    payment_id_regex String Optional. Regular expression to payment ID string.
    low_processing_time Number Optional. The lowest processing time in seconds for payout operation.
    high_processing_time Number Optional. The highest processing time in seconds for payout operation.
    avg_processing_time Number Optional. The average processing time in seconds for payout operation.

    Get Currency

    curl "https://api.crosstower.com/api/3/public/currency/BTC"
    

    Response:

    {
        "full_name":"Bitcoin",
        "payin_enabled":true,
        "payout_enabled":true,
        "transfer_enabled":true,
        "precision_transfer":"0.00000001",
        "networks": [
          {
            "network":"btc",
            "protocol":"",
            "default":true,
            "payin_enabled":true,
            "payout_enabled":true,
            "precision_payout":"0.00000001",
            "payout_fee":"0.000900000000",
            "payout_is_payment_id":false,
            "payin_payment_id":false,
            "payin_confirmations":1,
            "low_processing_time":"21.709",
            "high_processing_time":"3639.385",
            "avg_processing_time":"421.6391704545454"
          }
        ]
    }
    

    GET /api/3/public/currency/{currency}

    Returns the data for a certain currency.

    Requires no API key Access Rights.

    Response:

    Name Type Description
    full_name String Currency full name (e.g., "Bitcoin").
    payin_enabled Boolean Determines whether it is allowed to generate addresses for a deposit.
    payout_enabled Boolean Determines whether withdrawal is allowed.
    transfer_enabled Boolean Determines whether transfer between trading account and wallet account is allowed (may be disabled on maintenance).
    precision_transfer Number Currency precision for transfer (accepted number of digits after the decimal point).
    networks Array of Network A list of the networks used for processing currency-related transactions.

    Symbols

    Get Symbols

    curl "https://api.crosstower.com/api/3/public/symbol"
    

    Response:

    {
        "ETHBTC": {
            "type": "spot",
            "base_currency": "ETH",
            "quote_currency": "BTC",
            "quantity_increment": "0.001",
            "tick_size": "0.000001",
            "take_rate": "0.001",
            "make_rate": "-0.0001",
            "fee_currency": "BTC"
        }
    }
    

    GET /api/3/public/symbol

    Returns the actual list of currency symbols (currency pairs) traded on exchange. The first listed currency of a symbol is called the base currency, and the second currency is called the quote currency. The currency pair indicates how much of the quote currency is needed to purchase one unit of the base currency. Read more

    You can optionally use a comma-separated list of symbols. If it is not provided, null or empty, the request returns all symbols.

    Requires no API key Access Rights.

    All parameters are optional.

    Parameters:

    Name Type Description
    symbols String Comma-separated list of symbol codes.

    Response:

    Name Type Description
    type String Symbol type.
    Possible values: spot
    base_currency String Name (code) of base currency, (e.g., "ETH").
    quote_currency String Name (code) of quote currency.
    quantity_increment Number Symbol quantity should be divided by this value with no remainder.
    tick_size Number Symbol price should be divided by this value with no remainder.
    take_rate Number Default fee rate.
    make_rate Number Default fee rate for market making trades.
    fee_currency String Currency in which fees are determined.

    Get Symbol

    curl "https://api.crosstower.com/api/3/public/symbol/ETHBTC"
    

    Response:

    {
        "type": "spot",
        "base_currency": "ETH",
        "quote_currency": "BTC",
        "quantity_increment": "0.0001",
        "tick_size": "0.000001",
        "take_rate": "0.002",
        "make_rate": "0.001",
        "fee_currency": "BTC"
    }
    

    GET /api/3/public/symbol/{symbol}

    Returns the data for a certain symbol.

    Requires no API key Access Rights.

    Response:

    Name Type Description
    type String Symbol type.
    Possible values: spot
    base_currency String Name (code) of base currency, (e.g., "ETH").
    quote_currency String Name (code) of quote currency.
    quantity_increment Number Symbol quantity should be divided by this value with no remainder.
    tick_size Number Symbol price should be divided by this value with no remainder.
    take_rate Number Default fee rate.
    make_rate Number Default fee rate for market making trades.
    fee_currency String Currency in which fees are determined.

    Tickers

    Get Tickers

    curl "https://api.crosstower.com/api/3/public/ticker"
    

    Response:

    {
        "ETHBTC": {
            "ask": "0.050043",
            "bid": "0.050042",
            "last": "0.050042",
            "low": "0.047052",
            "high": "0.051679",
            "open": "0.047800",
            "volume": "36456.720",
            "volume_quote": "1782.625000",
            "timestamp": "2021-06-12T14:57:19.999Z"
        }
    }
    

    GET /api/3/public/ticker

    Returns ticker information.

    You can optionally use a comma-separated list of symbols. If it is not provided, null or empty, the request returns tickers for all symbols.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    symbols String Optional. Comma-separated list of symbol codes.

    Response:

    Name Type Description
    ask Number or null Best ask price. Can return null if no data.
    bid Number or null Best bid price. Can return null if no data.
    last Number or null Last trade price. Can return null if no data.
    low Number The lowest trade price within 24 hours.
    high Number The highest trade price within 24 hours.
    open Number or null Last trade price 24 hours ago. Can return null if no data.
    volume Number Total trading amount within 24 hours in base currency.
    volume_quote Number Total trading amount within 24 hours in quote currency.
    timestamp DateTime Last update or refresh ticker timestamp.

    Get Ticker by Symbol

    curl "https://api.crosstower.com/api/3/public/ticker/ETHBTC"
    

    Response:

    {
        "ask": "0.020572",
        "bid": "0.020566",
        "last": "0.020574",
        "low": "0.020388",
        "high": "0.021084",
        "open": "0.020913",
        "volume": "138444.3666",
        "volume_quote": "2853.6874972480",
        "timestamp": "2021-06-02T17:52:36.731Z"
    }
    

    GET /api/3/public/ticker/{symbol}

    Returns the ticker for a certain symbol.

    Requires no API key Access Rights.

    Response:

    Name Type Description
    ask Number or null Best ask price. Can return null if no data.
    bid Number or null Best bid price. Can return null if no data.
    last Number or null Last trade price. Can return null if no data.
    low Number The lowest trade price within 24 hours.
    high Number The highest trade price within 24 hours.
    open Number or null Last trade price 24 hours ago. Can return null if no data.
    volume Number Total trading amount within 24 hours in base currency.
    volume_quote Number Total trading amount within 24 hours in quote currency.
    timestamp DateTime Last update or refresh ticker timestamp.

    Prices

    Get Prices

    curl "https://api.crosstower.com/api/3/public/price/rate"
    

    Response:

    {
        "ETH":{
            "currency": "BTC", 
            "price": "0.021084",
            "timestamp": "2021-06-02T17:52:36.731Z"
        }
    }
    

    GET /api/3/public/price/rate

    Returns currencies quotation prices.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    from DateTime or Number Optional. Interval initial value.
    If sorting by timestamp is used, then DateTime, otherwise — Number.
    to DateTime or Number Optional. Interval end value.
    If sorting by timestamp is used, then DateTime, otherwise — Number.

    Response:

    Name Type Description
    currency String Quote currency code.
    price Number Quotation price.
    timestamp DateTime Last update or refresh price timestamp.

    Get Prices History

    curl "https://api.crosstower.com/api/3/public/price/history"
    

    Response:

    {
        "ETH":{
            "currency": "BTC", 
            "history":{
                "timestamp": "2021-07-01T20:00:00.000Z",
                "open": "0.063420",
                "close": "0.063767",
                "min": "0.063403",
                "max": "0.063782"
            }
        }
    }
    

    GET /api/3/public/price/history

    Returns quotation prices history.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    from Number Optional. Interval initial value.
    to Number Optional. Interval end value.
    until DateTime Optional. Interval end value.
    since DateTime Optional. Interval initial value.
    limit Number Default value: 1
    Accepted values: 1 – 1000
    period String Accepted values: M1 (one minute), M3, M5, M15, M30, H1 (one hour), H4, D1 (one day), D7, 1M (one month)
    Default value: M30 (30 minutes)
    sort String Sort direction.
    Accepted values: ASC, DESC
    Default value: DESC

    Response:

    Name Type Description
    currency String Quote currency code.
    history History Quotation price history entry.

    History model consists of:

    Name Type Description
    timestamp DateTime Last update or refresh price timestamp.
    open Number Open price.
    close Number Closing price.
    min Number The lowest price for the period.
    max Number The highest price for the period.

    Get Ticker Last Prices

    curl "https://api.crosstower.com/api/3/public/price/ticker"
    

    Response:

    {
        "ETHBTC": {
            "price": "0.050042",
            "timestamp": "2021-06-12T14:57:19.999Z"
        }
    }
    

    GET /api/3/public/price/ticker

    Returns tickers' last prices for all symbols.

    You can optionally use a comma-separated list of symbols. If it is not provided, null or empty, the request returns tickers' last prices for all symbols.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    symbols String Optional. Comma-separated list of symbol codes.

    Response:

    Name Type Description
    price Number Ticker last price.
    timestamp DateTime Last update or refresh ticker timestamp.

    Get Ticker Last Price by Symbol

    curl "https://api.crosstower.com/api/3/public/price/ticker/ETHBTC"
    

    Response:

    {
        "price": "0.021084",
        "timestamp": "2021-06-02T17:52:36.731Z"
    }
    

    GET /api/3/public/price/ticker/{symbol}

    Returns the ticker last price for a certain symbol.

    Requires no API key Access Rights.

    Response:

    Name Type Description
    price Number Ticker last price.
    timestamp DateTime Last update or refresh ticker timestamp.

    Trades

    Get Trades

    curl "https://api.crosstower.com/api/3/public/trades"
    

    Response:

    {
        "BTCUSDT":[
            {
                "id":782135488,
                "price":"9793.94",
                "qty":"0.21469",
                "side":"sell",
                "timestamp":"2021-06-24T12:54:41.972Z"
            }
        ],
        "ETHBTC":[
            {
                "id":782135414,
                "price":"0.027668",
                "qty":"0.069",
                "side":"buy",
                "timestamp":"2021-06-24T12:54:32.843Z"
            }
        ]
    }
    

    GET /api/3/public/trades

    Returns trades information for all or multiple symbols.

    You can optionally use a comma-separated list of symbols. If it is not provided, null or empty, the request returns trades for all symbols.

    Requires no API key Access Rights.

    All parameters are optional.

    Parameters:

    Name Type Description
    symbols String Optional. Comma-separated list of symbol codes.
    by String Filter type.
    Accepted values: id, timestamp
    Default value: timestamp
    sort String Sort direction.
    Accepted values: ASC, DESC
    Default value: DESC
    from DateTime or Number Optional. Interval initial value.
    If sorting by timestamp is used, then DateTime, otherwise — Number.
    till DateTime or Number Optional. Interval end value.
    If sorting by timestamp is used, then DateTime, otherwise — Number.
    limit Number Default value: 10
    Accepted values: 1 – 1000

    Response:

    Name Type Description
    id Number Trade identifier.
    price Number Trade price.
    qty Number Trade quantity.
    side String Trade side.
    Accepted values: sell, buy
    timestamp DateTime Trade timestamp.

    Get Trades by Symbol

    curl "https://api.crosstower.com/api/3/public/trades/ETHBTC?sort=DESC"
    

    Response:

    [
        {
            "id": 9533117,
            "price": "0.046001",
            "qty": "0.220",
            "side": "sell",
            "timestamp": "2021-06-14T12:18:40.426Z"
        },
        {
            "id": 9533116,
            "price": "0.046002",
            "qty": "0.022",
            "side": "buy",
            "timestamp": "2021-06-14T11:56:37.027Z"
        }
    ]
    

    GET /api/3/public/trades/{symbol}

    Returns trades information for a certain symbol.

    Requires no API key Access Rights.

    All parameters are optional.

    Parameters:

    Name Type Description
    by String Filter type.
    Accepted values: id, timestamp
    Default value: timestamp
    sort String Sort direction.
    Accepted values: ASC, DESC
    Default value: DESC
    from DateTime or Number Optional. Interval initial value.
    If sorting by timestamp is used, then DateTime, otherwise — Number.
    till DateTime or Number Optional. Interval end value.
    If sorting by timestamp is used, then DateTime, otherwise — Number.
    limit Number Default value: 100
    Accepted values: 1 – 1000
    offset Number Default value: 0
    Accepted values: 0 – 100000

    Response:

    Name Type Description
    id Number Trade identifier.
    price Number Trade price.
    qty Number Trade quantity.
    side String Trade side.
    Possible values: sell, buy
    timestamp DateTime Trade timestamp.

    Order Books

    Get Order Books

    curl "https://api.crosstower.com/api/3/public/orderbook"
    

    Response:

    {
        "BTCUSDT": {
            "timestamp": "2021-06-11T11:18:03.857366871Z",
            "ask": [
              [
                "9777.51",                      // Price
                "4.50579"                       // Amount
              ],
              [
                "9777.52", 
                "5.79832"
              ]
            ],
            "bid": [
              [
                "9777.5", 
                "0.00002"
              ],
              [
                "9776.26", 
                "0.0001"
              ]
            ]
          },
          "ETHBTC": {
            "timestamp": "2021-06-11T11:18:03.790858502Z",
            "ask": [
              [
                "0.022626", 
                "0.0057"
              ],
              [
                "0.022628", 
                "1.4259"
              ]
            ],
            "bid": [
              [
                "0.022624", 
                "0.5748"
              ],
              [
                "0.022623", 
                "26.5"
              ]
            ]
        }
    }
    

    GET /api/3/public/orderbook

    An Order Book is a list of buy and sell orders for a specific symbol, structured by price level.

    You can optionally use a comma-separated list of symbols. If it is not provided, null or empty, the request returns an Order Book for all symbols.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    depth Number Optional. Order Book depth.
    Default value: 100
    Set to 0 to view the full Order Book.
    symbols String Optional. Comma-separated list of symbol codes.

    Response:

    Name Type Description
    timestamp DateTime Order timestamp.
    ask Array Ask side array of levels.
    bid Array Bid side array of levels.

    Get Order Book by Symbol

    curl "https://api.crosstower.com/api/3/public/orderbook/ETHBTC?volume=0.5"
    

    Response:

    {
        "timestamp": "2021-06-11T11:30:38.597950917Z",
        "ask": [
          [
            "9779.68",                          // Price
            "2.497"                             // Quantity
          ]
        ],
        "bid": [
          [
            "9779.67", 
            "0.03719"
          ],
          [
            "9779.29", 
            "0.171"
          ],
          [
            "9779.27", 
            "0.171"
          ],
          [
            "9779.21", 
            "0.171"
          ]
        ]
    }
    

    GET /api/3/public/orderbook/{symbol}

    The request returns an Order Book for a certain symbol.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    depth Number Optional. Order Book depth.
    Default value: 100
    Set to 0 to view the full Order Book.
    volume Number Optional. Desired volume for market depth search.

    Please note that if the volume is specified, the depth will be ignored, ask average price and bid average price are returned in response.

    Response:

    Name Type Description
    timestamp DateTime Order timestamp.
    ask Array Ask side array of levels.
    bid Array Bid side array of levels.

    Candles

    Get Candles

    curl "https://api.crosstower.com/api/3/public/candles"
    

    Response:

    {
        "BTCUSDT":[
          {
            "timestamp": "2021-07-01T20:00:00.000Z",
            "open": "33079.93",
            "close": "33236.53",
            "min": "33079.93",
            "max": "33295.73",
            "volume": "146.86223",
            "volume_quote": "4877838.3025063"
          }
       ],
       "ETHBTC":[
          {
            "timestamp": "2021-07-01T20:00:00.000Z",
            "open": "0.063420",
            "close": "0.063767",
            "min": "0.063403",
            "max": "0.063782",
            "volume": "866.6776",
            "volume_quote": "55.2132903904"
          }
        ]
    }
    

    GET /api/3/public/candles

    Candles are used for the representation of a specific symbol as an OHLC chart.

    You can optionally use a comma-separated list of symbols. If it is not provided, null or empty, the request returns candles for all symbols.

    Requires no API key Access Rights.

    All parameters are optional.

    Parameters:

    Name Type Description
    symbols String Comma-separated list of symbol codes.
    sort String Sort direction.
    Accepted values: ASC, DESC
    Default value: DESC
    period String Accepted values: M1 (one minute), M3, M5, M15, M30, H1 (one hour), H4, D1 (one day), D7, 1M (one month)
    Default value: M30 (30 minutes)
    from DateTime Interval initial value.
    till DateTime Interval end value.
    limit Number Default value: 10
    Accepted values: 1 – 1000

    Response:

    Name Type Description
    timestamp DateTime Candle timestamp.
    open Number Open price.
    close Number Closing price.
    min Number The lowest price for the period.
    max Number The highest price for the period.
    volume Number Volume in base currency.
    volume_quote Number Volume in quote currency.

    Get Candles by Symbol

    curl "https://api.crosstower.com/api/3/public/candles/ETHBTC"
    

    Response:

    [
        {
            "timestamp": "2021-06-20T20:00:00.000Z",
            "open": "0.050459",
            "close": "0.050087",
            "min": "0.050000",
            "max": "0.050511",
            "volume": "1326.628",
            "volume_quote": "66.555987736"
        },
        {
            "timestamp": "2021-06-20T20:30:00.000Z",
            "open": "0.050108",
            "close": "0.050139",
            "min": "0.050068",
            "max": "0.050223",
            "volume": "87.515",
            "volume_quote": "4.386062831"
        }
    ]
    

    GET /api/3/public/candles/{symbol}

    Returns candles for a certain symbol.

    Requires no API key Access Rights.

    All parameters are optional.

    Parameters:

    Name Type Description
    sort String Sort direction.
    Accepted values: ASC, DESC
    Default value: DESC
    period String Accepted values: M1 (one minute), M3, M5, M15, M30, H1 (one hour), H4, D1 (one day), D7, 1M (one month)
    Default value: M30 (30 minutes)
    from DateTime Interval initial value.
    till DateTime Interval end value.
    limit Number Default value: 100
    Accepted values: 1 – 1000
    offset Number Default value: 0
    Accepted values: 0 – 100000

    Response:

    Name Type Description
    timestamp DateTime Candle timestamp.
    open Number Open price.
    close Number Closing price.
    min Number The lowest price for the period.
    max Number The highest price for the period.
    volume Number Volume in base currency.
    volume_quote Number Volume in quote currency.

    Authentication

    curl -u "apiKey:secretKey" https://api.crosstower.com/api/3/spot/balance
    
    import requests
    session = requests.session()
    session.auth = ("apiKey", "secretKey")
    
    
    const fetch = require('node-fetch');
    
    const credentials = Buffer.from('apiKey' + ':' + 'secretKey').toString('base64');
    
    fetch('https://api.crosstower.com/api/3/spot/balance', {
        method: 'GET',
        headers: {
            'Authorization': 'Basic ' + credentials
        }
    });
    
    

    Public market data are available without authentication. Authentication is required for other requests.

    You should create API keys on the API Settings page. You can create multiple API keys with different access rights for your applications.

    Use Basic Authentication to access the REST API.

    Authentication HS256

    from base64 import b64encode
    from hashlib import sha256
    from hmac import HMAC
    from time import time
    from urllib.parse import urlsplit
    from requests import Session
    from requests.auth import AuthBase
    
    class HS256(AuthBase):
    
        def __init__(self, api_key: str, secret_key: str, window: int = None):
            self.api_key = api_key
            self.secret_key = secret_key
            self.window = window
    
        def __call__(self, r):
            url = urlsplit(r.url)
            message = [r.method, url.path]
            if url.query:
                message.append('?')
                message.append(url.query)
            if r.body:
                message.append(r.body)
    
            timestamp = str(int(time() * 1000))
            window = str(self.window) if self.window else None
            message.append(timestamp)
            if window:
                message.append(window)
    
            signature = HMAC(key=self.secret_key.encode(),
                             msg=''.join(message).encode(),
                             digestmod=sha256).hexdigest()
            data = [self.api_key, signature, timestamp]
            if window:
                data.append(window)
    
            base64_encoded = b64encode(':'.join(data).encode()).decode()
            r.headers['Authorization'] = f'HS256 {base64_encoded}'
            return r
    
    auth = HS256(api_key='apiKey', secret_key='secretKey')
    with Session() as s:
        response = s.get('https://api.crosstower.com/api/3/spot/balance', auth=auth)
        print(response.json())
    

    The alternative authentication method is the HMAC signature.

    To send a request, you should establish a persistent session using the credentials signed as follows:

    1. Create an HMAC signature with secret_key as the secret key, SHA256 as the hash algorithm, and payload as the message, structured like:
      <method> + <URL path> + ["?" + <query>] + [<body>]
    2. Add the authorization header to a request. It should have the following structure:
      "HS256 " + Base64(<HMAC signature> + ":" + api_key + ":" + timestamp + ":" + [window])

    Spot Trading

    Order Model

    {
        "id": 828680665,
        "client_order_id": "f4307c6e507e49019907c917b6d7a084",
        "symbol": "ETHBTC",
        "side": "sell",
        "status": "partiallyFilled",
        "type": "limit",
        "time_in_force": "GTC",
        "quantity": "13.942",
        "price": "0.011384",
        "quantity_cumulative": "5.240",
        "created_at": "2021-06-16T14:18:47.321Z",
        "updated_at": "2021-06-19T15:23:54.876Z",
        "post_only": false
    }
    

    Order model consists of:

    Name Type Description
    id Number Order unique identifier as assigned by exchange.
    client_order_id String Order unique identifier as assigned by trader. Uniqueness must be guaranteed within a single trading day, including all active orders.
    symbol String Symbol code.
    side String Trade side.
    Possible values: sell, buy
    status String Order state.
    Possible values: new, suspended, partiallyFilled, filled, canceled, expired
    type String Order type.
    Possible values: limit, market, stopLimit, stopMarket
    time_in_force String Time in Force is a special instruction used when placing an order to indicate how long it will remain active before it is executed or expired.
    GTC — "Good-Till-Cancelled" order won't be closed until it is filled.
    IOC — "Immediate-Or-Cancel" order must be executed immediately. Any part of an IOC order that cannot be filled immediately will be cancelled.
    FOK — "Fill-Or-Kill" order must be executed immediately and completely or not executed at all.
    Day — keeps the order active until the end of the trading day (UTC).
    GTD — "Good-Till-Date" order may remain active until the end of the day specified in expire_time.
    quantity Number Order quantity.
    quantity_cumulative Number Executed order quantity.
    price Number Optional. Order price.
    stop_price Number Optional. The price level that triggers order activation. Specified if type is stopLimit or stopMarket.
    expire_time DateTime Optional. Date of order expiration. Specified if time_in_force is GTD.
    post_only Boolean A post-only order is an order that does not remove liquidity. If your post-only order causes a match with a pre-existing order as a taker, then the order will be cancelled.
    created_at DateTime Date of order's creation.
    updated_at DateTime Date of order's last update.
    trades Array of Trade Optional. List of trades.

    Trade model consists of:

    Name Type Description
    trade_id Number Trade identifier.
    trade_quantity Number Quantity of trade.
    trade_price Number Trade price.
    trade_fee Number Fee paid for trade.
    original_client_order_id String Optional. Identifier of replaced order.
    report_type String Report type. Possible values: trade

    Get Spot Trading Balance

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/balance"
    
    import requests
    session = requests.session()
    session.auth = ("apiKey", "secretKey")
    b = session.get('https://api.crosstower.com/api/3/spot/balance').json()
    print(b)
    

    Response:

    [
        {
            "currency": "ETH",
            "available": "10.000000000",
            "reserved": "0.56"
        },
        {
            "currency": "BTC",
            "available": "0.010205869",
            "reserved": "0"
        }
    ]
    

    GET /api/3/spot/balance

    Returns the user's trading balance.

    Requires the "Orderbook, History, Trading balance" API key Access Right.

    Response:

    Name Type Description
    currency String Currency code.
    available Number Amount available for trading or transfer to wallet.
    reserved Number Total amount reserved for active orders and incomplete transfers to wallet.

    Get All Active Spot Orders

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/order"
    
    import requests
    session = requests.session()
    session.auth = ("apiKey", "secretKey")
    b = session.get('https://api.crosstower.com/api/3/spot/order').json()
    print(b)
    

    Response:

    [
        {
            "id": 840450210,
            "client_order_id": "c1837634ef81472a9cd13c81e7b91401",
            "symbol": "ETHBTC",
            "side": "buy",
            "status": "partiallyFilled",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "0.020",
            "price": "0.046001",
            "quantity_cumulative": "0.005",
            "post_only": false,
            "created_at": "2021-06-12T17:17:57.437Z",
            "updated_at": "2021-06-12T17:18:08.610Z"
        }
    ]
    

    GET /api/3/spot/order

    Returns a list of all active spot orders.

    Requires the "Place/cancel orders" API key Access Right.

    Parameters:

    Name Type Description
    symbol String Optional. Parameter to filter active spot orders by symbol.

    Response: array of spot orders

    Get Active Spot Order

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/order/c1837634ef81472a9cd13c81e7b91401"
    
    import requests
    session = requests.session()
    session.auth = ("apiKey", "secretKey")
    b = session.get('https://api.crosstower.com/api/3/spot/order/c1837634ef81472a9cd13c81e7b91401').json()
    print(b)
    

    Response:

    {
        "id": 840450210,
        "client_order_id": "c1837634ef81472a9cd13c81e7b91401",
        "symbol": "ETHBTC",
        "side": "buy",
        "status": "partiallyFilled",
        "type": "limit",
        "time_in_force": "GTC",
        "quantity": "0.020",
        "price": "0.046001",
        "quantity_cumulative": "0.005",
        "post_only": false,
        "created_at": "2021-06-12T17:17:57.437Z",
        "updated_at": "2021-06-12T17:18:08.610Z"
    }
    

    GET /api/3/spot/order/{client_order_id}

    Returns an active spot order by client_order_id.

    Requires the "Place/cancel orders" API key Access Right.

    Response: spot order

    Create New Spot Order

    curl -X POST -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/order/d8574207d9e3b16a4a5511753eeef175" \
        -d 'symbol=ETHBTC&side=sell&quantity=0.063&price=0.046016'
    
        import requests
        session = requests.session()
        session.auth = ("apiKey", "secretKey")
        orderData = {'symbol':'ETHBTC', 'side': 'sell', 'quantity': '0.063', 'price': '0.046016' }
        r = session.post('https://api.crosstower.com/api/3/spot/order/', data = orderData)
    
        print(r.json())
    
    

    Response:

    {
        "id": 0,
        "client_order_id": "d8574207d9e3b16a4a5511753eeef175",
        "symbol": "ETHBTC",
        "side": "sell",
        "status": "new",
        "type": "limit",
        "time_in_force": "GTC",
        "quantity": "0.063",
        "price": "0.046016",
        "quantity_cumulative": "0.000",
        "post_only": false,
        "created_at": "2021-06-15T17:01:05.092Z",
        "updated_at": "2021-06-15T17:01:05.092Z"
    }
    

    Error response example:

    {
        "error": {
            "code": 20001,
            "message": "Insufficient funds",
            "description": "Check that the funds are sufficient, given commissions"
        }
    }
    

    POST /api/3/spot/order

    Creates a new spot order.

    Requires the "Place/cancel orders" API key Access Right.

    Parameters:

    Name Type Description
    client_order_id String Optional. If omitted, an order will be created, and it will be generated by the Server. Uniqueness must be guaranteed within a single trading day, including all active orders.
    If specified and corresponds to an existing order, a request will be rejected.
    symbol String Symbol code.
    side String Trade side.
    Accepted values: sell, buy
    type String Optional. Order type.
    Accepted values: limit, market, stopLimit, stopMarket
    Default value: limit
    time_in_force String Optional. Time in Force is instruction.
    Accepted values: GTC, IOC, FOK, Day, GTD
    Default value: GTC
    quantity Number Order quantity.
    price Number Order price. Required if type is limit or stopLimit.
    stop_price Number The price level that triggers order activation. Required if type is stopLimit or stopMarket.
    expire_time DateTime Date of order expiration. Required if time_in_force is GTD.
    strict_validate Boolean Price and quantity will be checked for incrementation within the symbol’s tick size and quantity step. See the symbol's tick_size and quantity_increment.
    post_only Boolean Optional. If your post-only order causes a match with a pre-existing order as a taker, then the order will be cancelled.
    take_rate Number Optional. Liquidity taker fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup.
    make_rate Number Optional. Liquidity provider fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup.

    Response: spot order

    Price accuracy and quantity

    Symbol config contains the tick_size parameter which means that price should be divided by tick_size with no remainder.
    quantity should be divided by quantity_increment with no remainder.
    By default, if strict_validate is not enabled, the Server rounds half down the price and quantity for tick_size and quantity_increment.

    Example of ETHBTC: if tick_size is 0.000001, then price 0.046016 is valid, and '0.0460165' is invalid.

    Fees

    Charged fee is determined by the symbol's fee_currency. Maker-taker fees offer a transaction rebate make_rate to those who provide liquidity (a maker), while charging customers who take that liquidity take_rate (a taker).

    To create buy orders, you must have sufficient balance including fees.
    Available balance > price × quantity × (0.1 + take_rate)

    Order result status

    For orders with time_in_force = IOC or FOK, the REST API returns final order status: filled or expired.

    If an order can be instantly executed, then the REST API returns a status of filled or partiallyFilled in the order's info.

    Replace Spot Order

    curl -X PATCH -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/order/d8574207d9e3b16a4a5511753eeef174" \
        -d 'quantity=0.063&price=0.046016&new_client_order_id=d8574207d9e3b16a4a5511753eeef175'
    
        import requests
        session = requests.session()
        session.auth = ("apiKey", "secretKey")
        orderData = {'symbol':'ETHBTC', 'side': 'sell', 'quantity': '0.063', 'price': '0.046016' , 'new_client_order_id': 'd8574207d9e3b16a4a5511753eeef175'}
        r = session.patch('https://api.crosstower.com/api/3/spot/order/d8574207d9e3b16a4a5511753eeef174', data = orderData)
        print(r.json())
    
    

    Response:

    {
        "id": 0,
        "client_order_id": "d8574207d9e3b16a4a5511753eeef175",
        "symbol": "ETHBTC",
        "side": "sell",
        "status": "new",
        "type": "limit",
        "time_in_force": "GTC",
        "quantity": "0.063",
        "price": "0.046016",
        "quantity_cumulative": "0.000",
        "post_only": false,
        "created_at": "2021-06-15T17:01:05.092Z",
        "updated_at": "2021-06-15T17:01:05.092Z"
    }
    

    Error response example:

    {
        "error": {
            "code": 20001,
            "message": "Insufficient funds",
            "description": "Check that the funds are sufficient, given commissions"
        }
    }
    

    PATCH /api/3/spot/order/{client_order_id}

    Replaces a spot order

    Parameters:

    Name Type Description
    new_client_order_id String client_order_id for a new order.
    quantity Number Order quantity.
    price Number Order price. Required if type is limit or stopLimit.
    strict_validate Boolean Price and quantity will be checked for incrementation within the symbol’s tick size and quantity step. See the symbol's tick_size and quantity_increment.

    Response: spot order

    Cancel All Spot Orders

    DELETE /api/3/spot/order

    Cancels all active spot orders.

    Requires the "Place/cancel orders" API key Access Right.

    Parameters:

    Name Type Description
    symbol String Optional. Parameter to filter active spot orders by symbol.

    Response: array of spot orders

    Cancel Spot Order

    curl -X DELETE -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/order/d8574207d9e3b16a4a5511753eeef175"
    

    Response:

    {
        "id": 0,
        "client_order_id": "d8574207d9e3b16a4a5511753eeef175",
        "symbol": "ETHBTC",
        "side": "sell",
        "status": "canceled",
        "type": "limit",
        "time_in_force": "GTC",
        "quantity": "0.063",
        "price": "0.046016",
        "quantity_cumulative": "0.000",
        "post_only": false,
        "created_at": "2021-06-15T17:01:05.092Z",
        "updated_at": "2021-06-15T17:01:05.092Z"
    }
    

    Example of Order not found error response:

    {
        "error": {
            "code": 20002,
            "message": "Order not found",
            "description": ""
        }
    }
    

    DELETE /api/3/spot/order/{client_order_id}

    Cancels a spot order.

    Requires the "Place/cancel orders" API key Access Right.

    Response: spot order

    Get All Trading Commissions

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/fee"
    

    Response:

    [
        {
            "symbol": "BTCUSDT",
            "take_rate": "0.001",
            "make_rate": "-0.0001"
        },
        {
            "symbol": "ETHBTC",
            "take_rate": "0.001",
            "make_rate": "-0.0001"
        }
    ]
    

    GET /api/3/spot/fee

    Returns personal trading commission rates for all symbols.

    Requires the "Place/cancel orders" API key Access Right.

    Get Trading Commission

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/fee/ETHBTC"
    

    Response:

    {
        "symbol": "ETHBTC",
        "take_rate": "0.001",
        "make_rate": "-0.0001"
    }
    

    GET /api/3/spot/fee/{symbol}

    Returns personal trading commission rate by symbol.

    Requires the "Place/cancel orders" API key Access Right.

    Spot Trading History

    Spot Orders History

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/history/order?symbol=ETHBTC"
    
    [
        {
            "id": 828680665,
            "client_order_id": "f4307c6e507e49019907c917b6d7a084",
            "symbol": "ETHBTC",
            "side": "sell",
            "status": "partiallyFilled",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "13.942",
            "price": "0.011384",
            "price_average": "0.055487",
            "quantity_cumulative": "5.240",
            "created_at": "2021-06-16T14:18:47.321Z",
            "updated_at": "2021-06-19T15:23:54.876Z"
        },
        {
            "id": 828680667,
            "client_order_id": "f4307c6e507e49019907c917b6d7a084",
            "symbol": "ETHBTC",
            "side": "sell",
            "status": "partiallyFilled",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "13.942",
            "price": "0.011384",
            "price_average": "0.045000",
            "quantity_cumulative": "5.240",
            "created_at": "2021-06-16T14:18:50.321Z",
            "updated_at": "2021-06-19T15:23:56.876Z"
        }
    ]
    

    GET /api/3/spot/history/order

    Returns all spot orders with trades for the last 24 hours.

    Requires the "Orderbook, History, Trading balance" API key Access Right.

    All parameters are optional.

    Parameters:

    Name Type Description
    client_order_id String If specified, other parameters will be ignored, including limit and offset.
    symbol String Symbol codes.
    sort String Sort direction.
    Accepted values: DESC, ASC
    Default value: DESC
    by String Filter type.
    Accepted values: timestamp, id
    Default value: id
    from DateTime Interval initial value.
    till DateTime Interval end value.
    limit Number Default value: 100
    Max value: 1000
    offset Number Default value: 0
    Max value: 100000

    Response:

    Name Type Description
    id Number Order unique identifier as assigned by exchange.
    client_order_id String Order unique identifier as assigned by trader. Uniqueness must be guaranteed within a single trading day, including all active orders.
    symbol String Symbol code.
    side String Trade side.
    Possible values: sell, buy
    status String Order state.
    Possible values: new, suspended, partiallyFilled, filled, canceled, expired
    type String Order type.
    Possible values: limit, market, stopLimit, stopMarket
    time_in_force String Time in Force is a special instruction used when placing an order to indicate how long it will remain active before it is executed or expired.
    GTC — "Good-Till-Cancelled" order won't be closed until it is filled.
    IOC — "Immediate-Or-Cancel" order must be executed immediately. Any part of an IOC order that cannot be filled immediately will be cancelled.
    FOK — "Fill-Or-Kill" order must be executed immediately and completely or not executed at all.
    Day — keeps the order active until the end of the trading day (UTC).
    GTD — "Good-Till-Date" order may remain active until the end of the day specified in expire_time.
    quantity Number Order quantity.
    quantity_cumulative Number Executed order quantity.
    price Number Order price.
    price_average Number Average price of executed order quantity.
    expire_time DateTime Date of order expiration. Specified if time_in_force is GTD.
    stop_price Number The price level that triggers order activation. Specified if type is stopLimit or stopMarket.
    created_at DateTime Date of order's creation.
    updated_at DateTime Date of order's last update.

    Spot Trades History

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/spot/history/trade?symbol=ETHBTC"
    
    [
        {
            "id": 9535486,
            "order_id": 816088377,
            "client_order_id": "f8dbaab336d44d5ba3ff578098a68454",
            "symbol": "ETHBTC",
            "side": "sell",
            "quantity": "0.061",
            "price": "0.045487",
            "fee": "0.000002775",
            "timestamp": "2021-06-17T12:32:57.848Z",
            "taker": true
        },
        {
            "id": 9535437,
            "order_id": 816088021,
            "client_order_id": "27b9bfc068b44194b1f453c7af511ed6",
            "symbol": "ETHBTC",
            "side": "buy",
            "quantity": "0.038",
            "price": "0.046000",
            "fee": "-0.000000174",
            "timestamp": "2021-06-17T12:30:57.848Z",
            "taker": true
        }
    ]
    

    GET /api/3/spot/history/trade

    Returns the user's spot trading history.

    Requires the "Orderbook, History, Trading balance" API key Access Right.

    All parameters are optional.

    Parameters:

    Name Type Description
    order_id String Order unique identifier as assigned by exchange.
    symbol String Symbol codes.
    sort String Sort direction.
    Accepted values: DESC, ASC
    Default value: DESC
    by String Filter type.
    Accepted values: timestamp, id
    Default value: id
    from DateTime or Number Interval initial value.
    If sorting by timestamp is used, then DateTime, otherwise — Number.
    till DateTime or Number Interval end value.
    If sorting by timestamp is used, then DateTime, otherwise — Number.
    limit Number Default value: 100
    Max value: 1000
    offset Number Default value: 0
    Max value: 100000

    Response:

    Name Type Description
    id Number Trade unique identifier as assigned by exchange.
    order_id Number Order unique identifier as assigned by exchange.
    client_order_id String Order unique identifier as assigned by trader.
    symbol String Symbol code.
    side String Trade side.
    Possible values: sell, buy
    quantity Number Trade quantity.
    price Number Trade price.
    fee Number Trade commission.
    Can be negative ("rebate" — reward paid to a trader). See fee currency in the symbol config.
    timestamp DateTime Trade timestamp.
    taker Boolean Liquidity indicator.

    Wallet Management

    Wallet Balance

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/balance"
    
    [
        {
            "currency":"BTC",
            "available":"0.00005821",
            "reserved":"0.00001"
        },
        {
            "currency":"USDT",
            "available":"0.01",
            "reserved":"0"
        }
    ]
    

    GET /api/3/wallet/balance

    Returns the user's wallet balances except zero balances.

    Requires the "Payment information" API key Access Right.

    Response:

    Name Type Description
    currency String Currency code.
    available Number Amount available for withdrawal or transfer to trading account.
    reserved Number Amount reserved for incomplete transactions.

    Deposit Crypto Address

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/crypto/address?currency=BTC"
    
    [
        {
            "currency":"BTC", 
            "address":"3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv",
            "payment_id":"", 
            "public_key":""
        }
    ]
    

    GET /api/3/wallet/crypto/address

    Get current address.

    Requires the "Payment information" API key Access Right.

    Parameters:

    Name Type Description
    currency String Optional. Currency code.

    POST /api/3/wallet/crypto/address

    Creates a new address.

    Requires the "Payment information" API key Access Right.

    Name Type Description
    currency String Currency code.

    Response:

    Name Type Description
    currency String Currency code.
    address String Address for deposit.
    payment_id String Optional. If this parameter is set, it is required for deposit.
    public_key String Optional. If this parameter is set, it is required for deposit.

    Last 10 Deposit Crypto Addresses

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/crypto/address/recent-deposit?currency=BTC"
    
    [
        {
            "currency":"BTC", 
            "address":"3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv",
            "payment_id":"", 
            "public_key":""
        }
    ]
    

    GET /api/3/wallet/crypto/address/recent-deposit

    Returns the last 10 unique addresses used for deposits (by currency).

    Requires the "Payment information" API key Access Right.

    Name Type Description
    currency String Currency code.

    Response:

    Name Type Description
    currency String Currency code.
    address String Address for deposit.
    payment_id String Optional. If this parameter is set, it is required for deposit.
    public_key String Optional. If this parameter is set, it is required for deposit.

    Last 10 Withdrawal Crypto Addresses

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/crypto/address/recent-withdraw?currency=BTC"
    
    [
        {
            "currency":"BTC", 
            "address":"3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv",
            "payment_id":"", 
            "public_key":""
        }
    ]
    

    GET /api/3/wallet/crypto/address/recent-withdraw

    Returns the last 10 unique addresses used for withdrawals (by currency).

    Requires the "Payment information" API key Access Right.

    Name Type Description
    currency String Currency code.

    Response:

    Name Type Description
    currency String Currency code.
    address String Address for deposit.
    payment_id String Optional. If this parameter is set, it is required for deposit.
    public_key String Optional. If this parameter is set, it is required for deposit.

    Withdraw Crypto

    curl -X POST -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/crypto/withdraw" \
        -d 'currency=BTC&amount=0.001&address=3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv&auto_commit=false'
    
    {
        "id": "d2ce578f-647d-4fa0-b1aa-4a27e5ee597b"
    }
    

    POST /api/3/wallet/crypto/withdraw

    Requires the "Withdraw cryptocurrencies" API key Access Right.

    Parameters:

    Name Type Description
    currency String Currency code.
    amount Number The amount that will be sent to the specified address.
    address String Address identifier.
    payment_id String Optional parameter.
    include_fee Boolean Default value: false
    If true is set, then total spent value will include fees.
    auto_commit Boolean Default value: true
    If false is set, then you should commit or rollback a transaction in an hour. Used in two phase commit schema.
    use_offchain String Whether the withdrawal may be committed offchain.
    Accepted values: never, optionally, required
    public_comment String Optional parameter. Maximum length is 255.

    Response:

    Name Type Description
    id String Transaction unique identifier.

    Convert Between Currencies

    curl -X POST -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/convert" \
        -d 'from_currency=USDT20&to_currency=USDT&amount=0.001'
    
    {
        "result": [
            "d2ce578f-647d-4fa0-b1aa-4a27e5ee597b",
            "d2ce57hf-6g7d-4ka0-b8aa-4a27e5ee5i7b"
        ]
    }
    

    POST /api/3/wallet/convert

    Requires the "Payment information" API key Access Right.

    Parameters:

    Name Type Description
    from_currency String Currency code.
    to_currency String Currency code.
    amount Number The amount that will be sent to the specified address.

    Response:

    Name Type Description
    result Array Transaction unique identifiers as assigned by exchange.

    Withdraw Crypto Commit or Rollback

    curl -X PUT -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/crypto/withdraw/d2ce578f-647d-4fa0-b1aa-4a27e5ee597b"
    
    {
        "result": true
    }
    

    PUT /api/3/wallet/crypto/withdraw/{id}

    Commit a withdrawal.

    DELETE /api/3/wallet/crypto/withdraw/{id}

    Rollback a withdrawal.

    Requires the "Withdraw cryptocurrencies" API key Access Right.

    Both methods are idempotent.

    Response:

    Name Type Description
    result Boolean true if the request is completed.

    Check If Crypto Address Belongs to Current Account

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/crypto/address/check-mine/1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"
    
    {
        "result": true
    }
    

    GET /api/3/wallet/crypto/address/check-mine

    Requires the "Payment information" API key Access Right.

    Parameters:

    Name Type Description
    address String Address.

    Response:

    Name Type Description
    result Boolean true if the address belongs to the current account.

    Transfer Between Wallet and Exchange

    curl -X POST -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/transfer" \
        -d "currency=eth&amount=0.01&source=wallet&destination=spot"
    
    {
        "id": "d2ce578f-647d-4fa0-b1aa-4a27e5ee597b"
    }
    

    POST /api/3/wallet/transfer

    Requires the "Payment information" API key Access Right.

    Parameters:

    Name Type Description
    currency String Currency code.
    amount Number The amount that will be transferred between accounts.
    source String Transfer source account type.
    Accepted values: wallet, spot. Must not be the same as destination.
    destination String Transfer destination accounts type.
    Accepted values: wallet, spot. Must not be the same as source.

    Response:

    Name Type Description
    id String Transaction unique identifier as assigned by exchange.

    Transfer Money to Another User

    curl -X POST -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/internal/withdraw" \
        -d "by=email&[email protected]&currency=BTC&amount=0.001"
    
    {
        "result": "fd3088da-31a6-428a-b9b6-c482673ff0f2"
    }
    

    POST /api/3/wallet/internal/withdraw

    Requires the "Withdraw cryptocurrencies" API key Access Right.

    Parameters:

    Name Type Description
    currency String Currency code.
    amount Number The amount that will be transferred.
    by String Accepted values: email, username
    identifier String Identifier value. Either email or username.

    Response:

    Name Type Description
    result String Transaction unique identifier as assigned by exchange.

    Get Transactions History

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/transactions?currencies=ETH,BTC&order=DESC"
    
    [
      {
        "id": 50844835,
        "created_at": "2021-06-22T21:03:04.111Z",
        "updated_at": "2021-06-22T21:04:41.487Z",
        "status": "SUCCESS",
        "type": "WITHDRAW",
        "subtype": "BLOCKCHAIN",
        "native": {
            "tx_id": "27fa7f14-ca49-42fd-834a-4ce630d069d2",
            "index": 1071885589,
            "currency": "ETH",
            "amount": "0.01042",
            "fee": "0.00958",
            "hash": "0xfb0ba568213d11230cd34d62fddd1cc1fe11fdc173l4f2007b0e47a06ad73d20",
            "address": "0xd959463c3fcb222124bb7bb642d6a6573a6c5aba",
            "confirmations": 20
        }
      },
      {
        "id": 36896428,
        "created_at": "2020-11-12T10:27:26.135Z",
        "updated_at": "2020-11-12T10:42:29.065Z",
        "status": "SUCCESS",
        "type": "DEPOSIT",
        "subtype": "BLOCKCHAIN",
        "native": {
            "tx_id": "a271ad64-5f34-4115-a63e-1cb5bbe4f67e",
            "index": 429625504,
            "currency": "BTC",
            "amount": "0.04836614",
            "hash": "4d7ae7c9d6fe84405ae167b3f0beacx8c68eb5a9d5189bckeb65d5e306427oe6",
            "address": "3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv",
            "confirmations": 2
        }
      }
    ]
    

    GET /api/3/wallet/transactions

    Returns all transactions or a number of transactions by identifiers.

    Requires the "Payment information" API key Access Right.

    All parameters are optional.

    Parameters:

    Name Type Description
    from DateTime Interval initial value (inclusive).
    till DateTime Interval end value (inclusive).
    types String Comma-separated transaction types. The list of supported types may be expanded in future versions.
    Accepted values: DEPOSIT, WITHDRAW, TRANSFER, SWAP
    subtypes String Comma-separated transaction subtypes. Some subtypes are reserved for future use and do not purport to provide any functionality on the platform. The list of supported subtypes may be expanded in future versions.
    Accepted values: UNCLASSIFIED, BLOCKCHAIN, AIRDROP, AFFILIATE, STAKING, BUY_CRYPTO, OFFCHAIN, FIAT, SUB_ACCOUNT, WALLET_TO_SPOT, SPOT_TO_WALLET, WALLET_TO_DERIVATIVES, DERIVATIVES_TO_WALLET, CHAIN_SWITCH_FROM, CHAIN_SWITCH_TO, INSTANT_EXCHANGE
    statuses String Comma-separated transaction statuses.
    Accepted values: CREATED, PENDING, FAILED, SUCCESS, ROLLED_BACK
    currencies String Comma-separated currency codes.
    id_from Number Index interval initial value.
    Accepted values: 0 or greater
    id_till Number Index interval end value.
    Accepted values: 0 or greater
    tx_ids String Comma-separated transaction identificators.
    order_by String Defines sorting type.
    Accepted values: created_at, id
    Default value: created_at
    sort String Sort direction.
    Accepted values: DESC, ASC
    Default value: DESC
    limit Number Default value: 100
    Max value: 1000
    offset Number Default value: 0
    Max value: 100000

    GET /api/3/wallet/transactions/{id}

    Returns transaction by identifier.

    Requires the "Payment information" API key Access Right.

    Response:

    Name Type Description
    id Number Transaction unique identifier as assigned by exchange.
    status String Transaction status.
    Possible values: CREATED, PENDING, FAILED, SUCCESS, ROLLED_BACK
    type String Transaction type. The list of supported types may be expanded in future versions.
    Possible values: DEPOSIT, WITHDRAW, TRANSFER, SWAP
    subtype String Transaction subtype. Some subtypes are reserved for future use and do not purport to provide any functionality on the platform. The list of supported subtypes may be expanded in future versions.
    Possible values: UNCLASSIFIED, BLOCKCHAIN, AIRDROP, AFFILIATE, STAKING, BUY_CRYPTO, OFFCHAIN, FIAT, SUB_ACCOUNT, WALLET_TO_SPOT, SPOT_TO_WALLET, WALLET_TO_DERIVATIVES, DERIVATIVES_TO_WALLET, CHAIN_SWITCH_FROM, CHAIN_SWITCH_TO, INSTANT_EXCHANGE
    created_at DateTime Date of transaction creation.
    updated_at DateTime Date of transaction last update.
    native Native Optional. Transaction native attributes as assigned by the platform.
    meta Meta Optional. Additional attributes assigned to certain types of transactions.

    Native model consists of:

    Name Type Description
    id String Transaction unique identifier as assigned by exchange.
    index Number Internal index value that represents when the entry was updated.
    currency String Currency code.
    amount Number Amount of traded currency.
    fee Number Payment commission value.
    address String Address identifier.
    payment_id String Optional parameter.
    hash String Transaction hash.
    offchain_id String Transaction identifier of external system.
    confirmations Number Current count of confirmations for transaction in network.
    public_comment String Optional parameter.
    error_code String Payout error reason.
    Possible values: INVALID_ADDRESS, INVALID_PAYMENT_ID, BAD_PRECISION
    senders Array of String Senders for this payin transaction. Shown only for payins.

    Meta model consists of:

    Name Type Description
    fiat_to_crypto JSON Attributes of a fiat deposit (for sub_type = FIAT):
    id Number Transaction identifier as assigned by provider.
    provider_name String Provider name.
    order_type String Transaction type.
    source_currency String Source currency code.
    target_currency String Destination currency code.
    wallet_address String Wallet address assigned by provider
    tx_hash String Transaction hash.
    target_amount String Amount in the target currency.
    source_amount String Amount in the source currency.
    status String Transaction status.
    Possible values: ACTIVE, INACTIVE
    created_at DateTime Transaction creation date.
    updated_at DateTime Date of transaction last update.
    deleted_at DateTime Date of transactions deletion.
    payment_method_type String Payment system alias.

    Check If Offchain is Available

    curl -X POST -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/crypto/check-offchain-available?currency=ETH&address=0xfaEF4bE10dDF50B68c220c9ab19381e20B8EEB2B"
    
    {
        "result": true
    }
    

    POST /api/3/wallet/crypto/check-offchain-available

    Requires the "Payment information" API key Access Right.

    Parameters:

    Name Type Description
    currency String Currency code.
    address String Address identifier.
    payment_id String Optional parameter.

    Response:

    Name Type Description
    result String true if an offchain transaction is available to the specified address.

    Estimate Withdrawal Fee

    curl -X POST -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/wallet/crypto/fee/estimate?currency=BTC&amount=0.01"
    
    {
        "fee": "0.000625"
    }
    

    GET /api/3/wallet/crypto/fee/estimate

    Requires the "Payment information" API key Access Right.

    Parameters:

    Name Type Description
    currency String Currency code.
    amount Number The amount that will be withdrawn.

    Response:

    Name Type Description
    fee String Estimated withdrawal fee.

    Sub-accounts

    Get Sub-accounts List

    curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account"
    

    Response:

    {
        "result": [
            {"sub_account_id": "179B5D", "email": "[email protected]", "status": "active"},
            {"sub_account_id": "179B5E", "email": "[email protected]", "status": "active"},
            {"sub_account_id": "179B5F", "email": "[email protected]", "status": "disable"},
            {"sub_account_id": "179B60", "email": "[email protected]", "status": "disable"},
            {"sub_account_id": "179B61", "email": "[email protected]", "status": "disable"},
            {"sub_account_id": "179B62", "email": "[email protected]", "status": "new"},
            {"sub_account_id": "179B63", "email": "[email protected]", "status": "new"}
        ]
    }
    

    Error response example:

    Failed authorization:

    {
        "error": {
            "code": 1002,
            "message": "Authorization is required or has been failed"
        }
    }
    

    Empty sub-account's list:

    {
        "result": []
    }
    

    GET /api/3/sub-account

    Returns list of sub-accounts per a super account.

    Requires no API key Access Rights.

    Response:

    Name Type Description
    sub_account_id String Unique identifier of a sub-account. Hex number.
    email String Email address of a sub-account.
    status String User status of a sub-account. Possible values: new, active, disable

    Freeze Sub-account

    curl -X POST -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account/freeze" \
        -d "sub_account_ids=179B5D,179B5E"
    

    Response:

    {
        "result": true
    }
    

    Error response example:

    Sub-accounts are already frozen or disabled:

    {
        "error": {
            "code": 21004,
            "message": "Sub account is already frozen or disabled"
        }
    }
    

    POST /api/3/sub-account/freeze

    Freezes sub-accounts listed. It implies that the Sub-accounts frozen wouldn't be able to:

    For any sub-account listed, all orders will be canceled and all funds will be transferred form the Trading balance.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    sub_account_ids Array Sub-accounts' identifiers separated by commas (,). Those could be obtained by the GET /api/3/sub-account request.

    Response:

    Name Type Description
    result Boolean Value indicating whether sub-accounts were successfully frozen.

    Activate Sub-account

    curl -X POST -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account/activate" \
        -d 'sub_account_ids=179B5D,179B5E'
    

    Response:

    {
        "result": true
    }
    

    Error response example:

    Sub-accounts are disabled, and their functionality can't be restored through activation:

    {
        "result": false
    }
    

    Failed authorization:

    {
        "error": {
            "code": 1002,
            "message": "Authorization is required or has been failed"
        }
    }
    

    Wrong input data format:

    {
        "error": {
            "code": 10001,
            "message": "Validation error"
        }
    }
    

    Sub-accounts listed don't exist:

    {
        "error": {
            "code": 21001,
            "message": "Cannot find sub account"
        }
    }
    
    

    POST /api/3/sub-account/activate

    Activates sub-accounts listed. It would make sub-accounts active after being frozen.

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    sub_account_ids Array Sub-accounts' identifiers separated by commas (,). Those could be obtained by the GET /api/3/sub-account request.

    Response:

    Name Type Description
    result Boolean Value indicating whether sub-accounts were successfully activated.

    Transfer Funds

    curl -X POST -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account/transfer" \
        -d "sub_account_id=179B5D&amount=1&currency=BTC&type=to_sub_account"
    

    Response:

    {
        "result": "ae37e806-0191-45fc-8c49-18137274772c"
    }
    

    Error response example:

    Insufficient permissions:

    {
        "error": {
            "code": 1003,
            "message": "Action is forbidden for this API key"
        }
    }
    

    Sub-account is frozen or disabled:

    {
        "error": {
            "code": 21004,
            "message": "Sub account is already frozen or disabled"
      }
    }
    

    Insufficient funds:

    {
        "error": {
            "code": 20001,
            "message": "Insufficient funds",
            "description": "Check that the funds are sufficient, given commissions"
        }
    }
    

    POST /api/3/sub-account/transfer

    Transfers funds from the master account to sub-account or from sub-account to the master account.

    Requires the "Withdraw cryptocurrencies" API key Access Right.

    Parameters:

    Name Type Description
    sub_account_id Number Identifier of a sub-account to deposit/withdraw funds.
    amount Number Amount of funds to be transferred.
    currency String Name (code) of base currency (e.g., "BTC").
    type String Type of transaction. Accepted values: to_sub_account, from_sub_account

    Response:

    Name Type Description
    result String Identifier of the transaction resulting.

    Get ACL Settings

    curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account/acl?sub_account_ids=179B5D,179B5E"
    

    Response:

    {
        "result": [
          {
            "sub_account_id": "179B5E",
            "deposit_address_generation_enabled": true,
            "withdraw_enabled": true,
            "description": "",
            "created_at": "2021-07-30T14:50:08.621Z",
            "updated_at": "2021-07-30T14:50:08.621Z"
          }
        ]
    }
    

    Error response example:

    Insufficient permissions:

    {
        "error": {
            "code": 1003,
            "message": "Action is forbidden for this API key"
        }
    }
    

    Sub-account is frozen or disabled:

    {
        "error": {
            "code": 21004,
            "message": "Sub account is already frozen or disabled"
        }
    }
    

    GET /api/3/sub-account/acl

    Returns a list of withdrawal settings for sub-accounts listed.

    Requires the "Payment information" API key Access Right.

    Parameters:

    Name Type Description
    sub_account_ids Array Optional. Sub-accounts' identifiers separated by commas (,). Those could be obtained by the GET /api/3/sub-account request.

    Response:

    Name Type Description
    sub_account_id String Unique identifier of a sub-account.
    deposit_address_generation_enabled Boolean Value indicating the desired state of deposits.
    withdraw_enabled Boolean Value indicating the desired state of withdrawals.
    description String Textual description. Normally left empty.
    created_at DateTime ACL creation time.
    updated_at DateTime ACL update time.

    Change ACL Settings

    curl -X POST -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account/acl?sub_account_ids=179B5E&deposit_address_generation_enabled=true&withdraw_enabled=true"
    

    Response:

    {
        "result": [
          {
            "sub_account_id": "179B5E",
            "deposit_address_generation_enabled": true,
            "withdraw_enabled": true,
            "description": "",
            "created_at": "2021-07-30T14:50:08.621Z",
            "updated_at": "2021-07-30T14:50:08.621Z"
          }
        ]
    }
    

    Error response example:

    Sub-account is frozen or disabled:

    {
        "error": {
            "code": 21004,
            "message": "Sub account is already frozen or disabled"
        }
    }
    

    Insufficient permissions:

    {
        "error": {
            "code": 1003,
            "message": "Action is forbidden for this API key"
        }
    }
    

    POST /api/3/sub-account/acl

    Disables or enables withdrawals for a sub-account.

    Requires the "Payment information" API key Access Right.

    Parameters:

    Name Type Description
    sub_account_ids Array Sub-accounts' identifiers separated by commas (,). Those could be obtained by the GET /api/3/sub-account request.
    deposit_address_generation_enabled Boolean Value indicating the desired state of deposits.
    withdraw_enabled Boolean Value indicating the desired state of withdrawals.
    description String Textual description. Normally left empty.
    created_at DateTime ACL creation time.
    updated_at DateTime ACL update time.

    Response:

    Name Type Description
    sub_account_id String Unique identifier of a sub-account.
    deposit_address_generation_enabled Boolean Value indicating the desired state of deposits.
    withdraw_enabled Boolean Value indicating the desired state of withdrawals.
    description String Textual description. Normally left empty.
    created_at DateTime ACL creation time.
    updated_at DateTime ACL update time.

    Get Sub-account Balance

    curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account/balance/179B5E"
    

    Response:

    {
        "result": {
            "wallet": [
              {
                "currency": "1ST",
                "available": "0.0",
                "reserved": "0.0"
              }
            ],
            "spot": [
              {
                "currency": "1ST",
                "available": "0",
                "reserved": "0"
              }
            ]
        }
    }
    

    Error response example:

    Insufficient permissions:

    {
        "error": {
            "code": 1003,
            "message": "Action is forbidden for this API key"
        }
    }
    

    GET /api/3/sub-account/balance/{subAccID}

    Returns non-zero balance values by sub-account identifier specified. Report will include the wallet and Trading balances for each currency. It is functional with no regard to the state of a sub-account. All account types are optional and appears only in case of non-zero balance.

    Requires the "Payment information" API key Access Right.

    Get Sub-account Crypto Address

    curl -X GET -u "apiKey:secretKey" \
        "https://api.crosstower.com/api/3/sub-account/crypto/address/179B5E/BTC"
    

    Response:

    {
        "result": {
            "address": "3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv"
        }
    }
    

    GET /api/3/sub-account/crypto/address/{subAccID}/{currency}

    Returns sub-account crypto address for currency.

    Requires the "Payment information" API key Access Right.

    Response:

    Name Type Description
    address String Address for deposit.
    payment_id String Optional. If this parameter is set, it is required for deposit.
    public_key String Optional. If this parameter is set, it is required for deposit.

    Socket API Reference

    Request Object

    Request

    {
        "method": "spot_new_order",
        "params": {
            "client_order_id": "57d5525562c945448e3cbd559bd068c4",
            "symbol": "ETHBTC",
            "side": "sell",
            "price": "0.059837",
            "quantity": "0.015"
        },
        "id": 123
    }
    

    An RPC call is represented by sending a Request object to a Server.

    The Request object has the following members:

    Notification

    Notification

    {
        "ch": "trades",
        "update": {
            "BTCUSDT": [{
                "t": 1626861123552,
                "i": 1626861123552,
                "p": "30877.68",
                "q": "0.00006",
                "s": "sell"
            }]
        }
    }
    

    A Notification is a Request object without an id member. A Request object (a Notification) signifies the lack of the Client's interest in the corresponding Response object. Therefore, no Response objects need to be returned to the Client.

    The Notification object has the following members:

    Response Object

    When a RPC call is made, the Server MUST reply with a Response, except for Notifications cases.

    Response on success subscription is true. Example:

    Response

    {
        "result": true,
        "id": 123
    }
    

    Response error

    {
        "error": {
            "code": 2001,
            "message": "Symbol not found",
            "description": "Symbol not found"
        },
        "id": 123
    }
    

    The Response is represented as a single JSON Object, with the following members:

    Socket Market Data

    In order to access market data via WebSocket interface, connect to the endpoint:

    wscat -c wss://api.crosstower.com/api/3/ws/public
    

    Request

    {
        "method": "subscribe",
        "ch": "orderbook/top/1000ms",           // Channel
        "params": {
            "symbols": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    From that point on, you will be able to send request messages in JSON format with the following parameters:

    Name Type Description
    method String The name of the method to be invoked.
    Accepted values: subscribe, unsubscribe, subscriptions
    ch String Channel name.
    params JSON Parameter values to be used during the method invocation. The set of parameters may vary depending on the channel chosen.
    id String Optional. Request identifier as assigned by sender.

    Response

    {
        "result": {
            "ch": "orderbook/top/1000ms",       // Channel
            "subscriptions": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    Any valid and successfully processed request will result in a JSON-formatted response message containing the following fields:

    Name Type Description
    result Result Details about resulting subscription status.
    id String Optional. Request identifier as assigned by sender.

    Result model consists of:

    Name Type Description
    ch String Channel name.
    subscriptions Array of String List of active subscriptions.

    Subscriptions

    In case of a successful subscriptions, the server will send:

    In the second case, the first snapshot comes right after the response if the limit parameter is greater than 0. Snapshot gives a full account of the market within the defined scope, and an update contains only recent changes which are being sent immediately.

    Batch Notifications

    If a market data request includes a number subscriptions, your choice of channel will determine the distribution of updates over incoming notifications.

    In the basic scenario, a single notification will contain data on a particular symbol only. Subscription to "batch" channels (ones ending with /batch) allows notifying via combined updates per multiple symbols.

    Get Active Subscriptions

    Request

    {
        "method": "subscriptions",
        "ch": "trades",                         // Channel
        "params": {},
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "trades",                     // Channel
            "subscriptions": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    Method: subscriptions

    Returns the list of all active subscriptions on a channel.

    Subscribe to Trades

    Request

    {
        "method": "subscribe",
        "ch": "trades",                         // Channel
        "params": {
            "symbols": ["ETHBTC", "BTCUSDT"],
            "limit": 1
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "trades",                     // Channel
            "subscriptions": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    Notification snapshot

    {
        "ch": "trades",                         // Channel
        "snapshot": {
            "BTCUSDT": [{
                "t": 1626861109494,             // Timestamp in milliseconds
                "i": 1626861109494,             // Trade identifier 
                "p": "30881.96",                // Price
                "q": "12.66828",                // Quantity
                "s": "buy"                      // Side
            }]
        }
    }
    

    Notification update

    {
        "ch": "trades",
        "update": {
            "BTCUSDT": [{
                "t": 1626861123552,
                "i": 1626861123552,
                "p": "30877.68",
                "q": "0.00006",
                "s": "sell"
            }]
        }
    }
    

    Channel: trades

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes.
    limit Number Optional. Limit to returned entries.
    Accepted values: 0 – 1000
    Default value: 0 (no history returned)

    Subscribe to Candles

    Request

    {
        "method": "subscribe",
        "ch": "candles/M1",                     // Channel
        "params": {
            "symbols": ["BTCUSDT"],
            "limit": 10
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "candles/M1",
            "subscriptions": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    Notification snapshot

    {
        "ch": "candles/M1",                     // Channel
        "snapshot": {
            "BTCUSDT": [{
                "t": 1626860340000,             // Message timestamp
                "o": "30881.95",                // Open price
                "c": "30890.96",                // Last price
                "h": "30900.8",                 // High price
                "l": "30861.27",                // Low price
                "v": "1.27852",                 // Base asset volume
                "q": "39493.9021811"            // Quote asset volume
            }, {
                "t": 1626860400000,
                "o": "30888.33",
                "c": "30860.52",
                "h": "30889.53",
                "l": "30860.31",
                "v": "3.80019",
                "q": "117283.0686182"
            }, {
                "t": 1626860460000,
                "o": "30858.39",
                "c": "30863.56",
                "h": "30864.89",
                "l": "30853.83",
                "v": "53.04288",
                "q": "1636858.7119248"
            }]
        }
    }
    

    Notification update

    {
        "ch": "candles/M1",
        "update": {
            "ETHBTC": [{
                "t": 1626860880000,
                "o": "0.060711",
                "c": "0.060749",
                "h": "0.060749",
                "l": "0.060711",
                "v": "12.2800",
                "q": "0.7455339675"
          }]
        }
    }
    

    Channel: candles/{period}

    Supported periods: M1 (one minute), M3, M5, M15, M30, H1 (one hour), H4, D1 (one day), D7, 1M (one month)

    Requires no API key Access Rights.

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes.
    limit Number Optional. Limit to returned entries.
    Accepted values: 0 – 1000
    Default value: 0 (no history returned)

    Subscribe to Mini Ticker

    Request

    {
        "method": "subscribe",
        "ch": "ticker/price/1s",                // Channel
        "params": {
            "symbols": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "ticker/price/1s",            // Channel
            "subscriptions": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Data notification

    {
        "ch": "ticker/price/1s",
        "data": {
            "ETHBTC": {
                "t": 1614815872000,             // Timestamp in milliseconds
                "o": "0.030781",                // Open price
                "c": "0.060043",                // Last price
                "h": "0.031788",                // High price
                "l": "0.030733",                // Low price
                "v": "62.587",                  // Base asset volume
                "q": "1.951420577"              // Quote asset volume
            }
        }
    }
    
    {
        "ch": "ticker/price/1s",
        "data": {
            "BTCUSDT": {
                "t": 1614815872030,
                "o": "32636.79",
                "c": "32085.51",
                "h": "33379.92",
                "l": "30683.28",
                "v": "11.90667",
                "q": "384081.1955629"
            }
        }
    }
    

    Channel: ticker/price/{speed}

    Supported speed: 1s, 3s

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes. Value ["*"] means all symbols are selected.

    Subscribe to Mini Ticker in Batches

    Request

    {
        "method": "subscribe",
        "ch": "ticker/price/1s/batch",          // Channel
        "params": {
            "symbols": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "ticker/price/1s/batch",      // Channel
            "subscriptions": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Data notification

    {
        "ch": "ticker/price/1s/batch",
        "data": {
            "ETHBTC": {
                "t": 1614815872000,             // Timestamp in milliseconds
                "o": "0.030781",                // Open price
                "c": "0.060043",                // Last price
                "h": "0.031788",                // High price
                "l": "0.030733",                // Low price
                "v": "62.587",                  // Base asset volume
                "q": "1.951420577"              // Quote asset volume
            },
            "BTCUSDT": {
                "t": 1614815872030,
                "o": "32636.79",
                "c": "32085.51",
                "h": "33379.92",
                "l": "30683.28",
                "v": "11.90667",
                "q": "384081.1955629"
            }
        }
    }
    

    Channel: ticker/price/{speed}/batch

    Supported speed: 1s, 3s

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes. Value ["*"] means all symbols are selected.

    Subscribe to Ticker

    Request

    {
        "method": "subscribe",
        "ch": "ticker/1s",                      // Channel
        "params": {
            "symbols": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "ticker/1s",                  // Channel
            "subscriptions": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Data notification

    {
        "ch": "ticker/1s",
        "data": {
            "ETHBTC": {
                "t": 1614815872000,             // Timestamp in milliseconds
                "a": "0.031175",                // Best ask
                "A": "0.03329",                 // Best ask quantity
                "b": "0.031148",                // Best bid
                "B": "0.10565",                 // Best bid quantity
                "c": "0.031210",                // Last price
                "o": "0.030781",                // Open price
                "h": "0.031788",                // High price
                "l": "0.030733",                // Low price
                "v": "62.587",                  // Base asset volume
                "q": "1.951420577",             // Quote asset volume
                "p": "0.000429",                // Price change
                "P": "1.39",                    // Price change percent
                "L": 1182694927                 // Last trade identifier
          }
        }
    }
    
    {
        "ch": "ticker/1s",
        "data": {
          "BTCUSDT": {
                "t": 1614815872050,
                "a": "32289.55",
                "A": "0.41210",
                "b": "32286.67",
                "B": "1.70049",
                "c": "0.057069",
                "o": "0.030545",
                "h": "0.029653",
                "l": "0.031804",
                "v": "11.90667",
                "q": "384081.1955629",
                "p": "0.003131",
                "P": "2.77",
                "L": 1182694927
          }
        }
    }
    

    Channel: ticker/{speed}

    Supported speed: 1s, 3s

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes. Value ["*"] means all symbols are selected.

    Subscribe to Ticker in Batches

    Request

    {
        "method": "subscribe",
        "ch": "ticker/1s/batch",                // Channel
        "params": {
            "symbols": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "ticker/1s/batch",            // Channel
            "subscriptions": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Data notification

    {
        "ch": "ticker/1s/batch",
        "data": {
            "ETHBTC": {
                "t": 1614815872000,             // Timestamp in milliseconds
                "a": "0.031175",                // Best ask
                "A": "0.03329",                 // Best ask quantity
                "b": "0.031148",                // Best bid
                "B": "0.10565",                 // Best bid quantity
                "c": "0.031210",                // Last price
                "o": "0.030781",                // Open price
                "h": "0.031788",                // High price
                "l": "0.030733",                // Low price
                "v": "62.587",                  // Base asset volume
                "q": "1.951420577",             // Quote asset volume
                "p": "0.000429",                // Price change
                "P": "1.39",                    // Price change percent
                "L": 1182694927                 // Last trade identifier
          },
          "BTCUSDT": {
                "t": 1614815872050,
                "a": "32289.55",
                "A": "0.41210",
                "b": "32286.67",
                "B": "1.70049",
                "c": "0.057069",
                "o": "0.030545",
                "h": "0.029653",
                "l": "0.031804",
                "v": "11.90667",
                "q": "384081.1955629",
                "p": "0.003131",
                "P": "2.77",
                "L": 1182694927
          }
        }
    }
    

    Channel: ticker/{speed}/batch

    Supported speed: 1s, 3s

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes. Value ["*"] means all symbols are selected.

    Subscribe to Full Order Book

    Request

    {
        "method": "subscribe",
        "ch": "orderbook/full",                 // Channel
        "params": {
            "symbols": ["ETHBTC"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "orderbook/full",             // Channel
            "subscriptions": ["ETHBTC"]
        },
        "id": 123
    }
    

    Notification snapshot

    {
        "ch": "orderbook/full",                 // Channel
        "snapshot": {
            "ETHBTC": {
                "t": 1626866578796,             // Timestamp in milliseconds
                "s": 27617207,                  // Sequence number  
                "a": [                          // Asks
                    ["0.060506", "0"],
                    ["0.060549", "12.6431"],
                    ["0.060570", "0"],
                    ["0.060612", "0"]
                ],
                "b": [                          // Bids
                    ["0.060439", "4.4095"],
                    ["0.060414", "0"],
                    ["0.060407", "7.3349"],
                    ["0.060390", "0"]
                ]
            }
        }
    }
    

    Notification update

    {
        "ch": "orderbook/full",
        "update": {
            "ETHBTC": {
                "t": 1626866578902,
                "s": 27617208,
                "a": [
                    ["0.060508", "0"],
                    ["0.060509", "2.5486"]
                ],
                "b": [
                    ["0.060501", "3.9000"],
                    ["0.060500", "3.0459"]
                ]
            }
        }
    }
    

    Channel: orderbook/full

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes.

    Subscribe to Partial Order Book

    Request

    {
        "method": "subscribe",
        "ch": "orderbook/D5/100ms",             // Channel
        "params": {
            "symbols": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "orderbook/D5/100ms",         // Channel
            "subscriptions": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Data notification

    {
        "ch": "orderbook/D5/100ms",             // Channel
        "data": {
            "BTCUSDT": {
                "t": 1626958488996,             // Timestamp in milliseconds  
                "s": 29472321,                  // Sequence number
                "a": [                          // Asks
                    ["32091.84", "0.01016"],
                    ["32091.85", "0.41484"],
                    ["32095.82", "0.00705"],
                    ["32095.95", "0.52001"],
                    ["32097.04", "0.20518"]
                ],
                "b": [                          // Bids
                    ["32089.29", "0.00228"],
                    ["32088.70", "0.40315"],
                    ["32084.29", "0.00616"],
                    ["32084.27", "0.53169"],
                    ["32078.89", "0.01016"]
                ]
            },
            "ETHBTC": {
                "t": 1626958488990,
                "s": 28438797,
                "a": [
                    ["0.061873", "4.8257"],
                    ["0.061887", "1.9938"],
                    ["0.061912", "0.5427"],
                    ["0.061913", "0.1696"],
                    ["0.061914", "0.1575"]
                ],
                "b": [
                    ["0.061867", "0.9868"],
                    ["0.061858", "0.1598"],
                    ["0.061854", "1.8327"],
                    ["0.061850", "0.8125"],
                    ["0.061842", "0.1763"]
                ]
            }
        }
    }
    

    Channel: orderbook/{depth}/{speed}

    Supported depth: D5, D10, D20

    Supported speed: 100ms, 500ms, 1000ms

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes. Value ["*"] means all symbols are selected.

    Subscribe to Partial Order Book in Batches

    Request

    {
        "method": "subscribe",
        "ch": "orderbook/D5/1000ms/batch",      // Channel
        "params": {
            "symbols": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "orderbook/D5/1000ms/batch",  // Channel
            "subscriptions": ["ETHBTC","BTCUSDT"]
        },
        "id": 123
    }
    

    Data notification

    {
        "ch": "orderbook/D5/1000ms/batch",      // Channel
        "data": {
            "BTCUSDT": {
                "t": 1626958488996,             // Timestamp in milliseconds  
                "s": 29472321,                  // Sequence number
                "a": [                          // Asks
                    ["32091.84", "0.01016"],
                    ["32091.85", "0.41484"],
                    ["32095.82", "0.00705"],
                    ["32095.95", "0.52001"],
                    ["32097.04", "0.20518"]
                ],
                "b": [                          // Bids
                    ["32089.29", "0.00228"],
                    ["32088.70", "0.40315"],
                    ["32084.29", "0.00616"],
                    ["32084.27", "0.53169"],
                    ["32078.89", "0.01016"]
                ]
            },
            "ETHBTC": {
                "t": 1626958488990,
                "s": 28438797,
                "a": [
                    ["0.061873", "4.8257"],
                    ["0.061887", "1.9938"],
                    ["0.061912", "0.5427"],
                    ["0.061913", "0.1696"],
                    ["0.061914", "0.1575"]
                ],
                "b": [
                    ["0.061867", "0.9868"],
                    ["0.061858", "0.1598"],
                    ["0.061854", "1.8327"],
                    ["0.061850", "0.8125"],
                    ["0.061842", "0.1763"]
                ]
            }
        }
    }
    

    Channel: orderbook/{depth}/{speed}/batch

    Supported depth: D5, D10, D20

    Supported speed: 100ms, 500ms, 1000ms

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes. Value ["*"] means all symbols are selected.

    Subscribe to Top of Book

    Request

    {
        "method": "subscribe",
        "ch": "orderbook/top/1000ms",           // Channel
        "params": {
            "symbols": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "orderbook/top/1000ms",       // Channel
            "subscriptions": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    Data notifications

    {
        "ch": "orderbook/top/1000ms",
        "data": {
            "ETHBTC": {
                "t": 1626954648761,             // Timestamp in milliseconds
                "a": "0.062135",                // Best ask
                "A": "4.1591",                  // Best ask quantity
                "b": "0.062124",                // Best bid
                "B": "0.9877"                   // Best bid quantity
            }
        }
    }
    
    {
        "ch": "orderbook/top/1000ms",
        "data": {
            "BTCUSDT": {
                "t": 1626954648863,
                "a": "31936.09",
                "A": "1.30000",
                "b": "31933.40",
                "B": "0.00058"
            }
        }
    }
    

    Channel: orderbook/top/{speed}

    Supported speed: 100ms, 500ms, 1000ms

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes. Value ["*"] means all symbols are selected.

    Subscribe to Top of Book in Batches

    Request

    {
        "method": "subscribe",
        "ch": "orderbook/top/100ms/batch",      // Channel
        "params": {
            "symbols": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    Response

    {
        "result": {
            "ch": "orderbook/top/100ms/batch",  // Channel
            "subscriptions": ["ETHBTC", "BTCUSDT"]
        },
        "id": 123
    }
    

    Data notification

    {
        "ch": "orderbook/top/100ms/batch",
        "data": {
            "ETHBTC": {
                "t": 1614815872000              // Timestamp in milliseconds
                "a": "0.031175",                // Best ask
                "A": "0.4033",                  // Best ask quantity
                "b": "0.031148",                // Best bid
                "B": "0.3649",                  // Best bid quantity
            },
            "BTCUSDT": {
                "t": 1614815872005
                "a": "0.031175",
                "A": "0.4033",
                "b": "0.031148",
                "B": "0.3649",
            }
        }
    }
    

    Channel: orderbook/top/{speed}/batch

    Supported speed: 100ms, 500ms, 1000ms

    Parameters:

    Name Type Description
    symbols Array of String List of symbol codes. Value ["*"] means all symbols are selected.

    Socket Session Authentication

    Example with Basic algorithm:

    
    wscat -c wss://api.crosstower.com/api/3/ws/trading
    
    {
        "method": "login",
        "params": {
            "type": "Basic",
            "api_key": "3ef4a9f8c8bf04bd8f09884b98403eae",
            "secret_key": "2deb570ab58fd553a4ed3ee249fd2d51"
        }
    }
    

    Example with HS256 algorithm:

    
    wscat -c wss://api.crosstower.com/api/3/ws/trading
    
    {
        "method": "login",
        "params": {
            "type": "HS256",
            "api_key": "3ef4a9f8c8bf04bd8f09884b98403eae",
            "timestamp": 1625265103,
            "signature": "b1c0ae399c2d341866a214f7d3ed755b821c1c36fc6f17083ef05fbb55b7f986"
        }
    }
    

    Signature generation example

    import hmac
    import hashlib
    import time
    
    timestamp = str(int(time.time()) * 1000)
    public = "3ef4a9f8c8bf04bd8f09884b98403eae"
    secret = "2deb570ab58fd553a4ed3ee249fd2d51"
    window = "10000"
    
    sign = hmac.new(secret, timestamp, hashlib.sha256)
    signWithWindow = hmac.new(secret, timestamp + window, hashlib.sha256)
    

    Request method: login

    Parameters:

    Name Type Description
    type String Encryption algorithm.
    Accepted values: Basic, HS256
    api_key String API public key.
    secret_key String API secret key, required on Basic algorithm.
    timestamp Number Timestamp, required on HS256 algorithm.
    window Number Optional. Maximum difference between timestamp and the moment of request processing in seconds. Specified only on the HS256 algorithm.
    Accepted range: 1 – 60
    Default value: 10
    signature String HMAC SHA256 sign with API secret key, required on HS256 algorithm.

    Socket Trading

    Trade via socket has some major differences compared to REST:

    Socket Spot Trading

    Subscribe to Reports

    Request

    wscat -c wss://api.crosstower.com/api/3/ws/trading
    
    {
        "method": "spot_subscribe",
        "params": {},
        "id": 123
    }
    

    Subscription result:

    {
        "jsonrpc": "2.0",
        "result":true, 
        "id": 1234
    }
    

    Notification Spot orders snapshot

    {
        "jsonrpc": "2.0",
        "method": "spot_orders",
        "params": [
          {
            "id": 584244931496,
            "client_order_id": "b5acd79c0a854b01b558665bcf379456",
            "symbol": "BTCUSDT",
            "side": "buy",
            "status": "new",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "0.01000",
            "quantity_cumulative": "0",
            "price": "0.01",
            "post_only": false,
            "created_at": "2021-07-02T22:52:32.864Z",
            "updated_at": "2021-07-02T22:52:32.864Z",
            "report_type": "status"
          },
          {
            "id": 584246978340,
            "client_order_id": "eeb7d144eca545cd93d83078bc60b7f4",
            "symbol": "BTCUSDT",
            "side": "buy",
            "status": "new",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "0.01000",
            "quantity_cumulative": "0",
            "price": "0.02",
            "post_only": false,
            "created_at": "2021-07-02T22:56:43.588Z",
            "updated_at": "2021-07-02T22:56:43.588Z",
            "report_type": "status"
          }
        ]
    }
    

    Notification Spot order update

    {
        "jsonrpc": "2.0",
        "method": "spot_order",
        "params": {
            "id": 584244931496,
            "client_order_id": "b5acd79c0a854b01b558665bcf379456",
            "symbol": "BTCUSDT",
            "side": "buy",
            "status": "new",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "0.01000",
            "quantity_cumulative": "0",
            "price": "0.01",
            "post_only": false,
            "created_at": "2021-07-02T22:52:32.864Z",
            "updated_at": "2021-07-02T22:52:32.864Z",
            "report_type": "new"
        }
    }
    

    Method: spot_subscribe, spot_unsubscribe

    Income methods: spot_order, spot_orders

    Subscribes to execution reports of user's orders

    Response:

    Name Type Description
    id Number Order unique identifier as assigned by exchange.
    client_order_id String Order unique identifier as assigned by trader.
    symbol String Symbol code.
    side String Trade side.
    Accepted values: sell, buy
    status String Order state.
    Possible values: new, suspended, partiallyFilled, filled, canceled, expired
    type String Order type.
    Possible values: limit, market, stopLimit, stopMarket
    time_in_force String Time in Force is a special instruction used when placing an order to indicate how long it will remain active before it is executed or expired.
    GTC — "Good-Till-Cancelled" order won't be closed until it is filled.
    IOC — "Immediate-Or-Cancel" order must be executed immediately. Any part of an IOC order that cannot be filled immediately will be cancelled.
    FOK — "Fill-Or-Kill" order must be executed immediately and completely or not executed at all.
    Day — keeps the order active until the end of the trading day (UTC).
    GTD — "Good-Till-Date" order may remain active until the end of the day specified in expire_time.
    quantity Number Order quantity.
    price Number Order price.
    cum_quantity Number Cumulative executed quantity.
    post_only Boolean A post-only order is an order that does not remove liquidity. If your post-only order causes a match with a pre-existing order as a taker, then the order will be cancelled.
    created_at DateTime Report creation date.
    updated_at DateTime Date of the report's last update.
    stop_price Number Required for stop-limit and stop-market orders.
    expire_time DateTime Date of order expiration for time_in_force = GTD.
    trades Array of Trade Optional. List of trades.

    Trade model consists of:

    Name Type Description
    trade_id Number Trade identifier. Required for report_type = trade.
    trade_quantity Number Quantity of trade. Required for report_type = trade.
    trade_price Number Trade price. Required for report_type = trade.
    trade_fee Number Fee paid for trade. Required for report_type = trade.
    original_client_order_id String Identifier of replaced order.
    report_type String Report type.
    Possible values: trade

    Get Active Spot Orders

    Notification report

    {
        "jsonrpc": "2.0",
        "result": [
          {
            "id": 583502239480,
            "client_order_id": "9be4d950d3c04485854ec5d7f260b1e8",
            "symbol": "BTCUSDT",
            "side": "buy",
            "status": "new",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "0.01000",
            "quantity_cumulative": "0",
            "price": "0.01",
            "post_only": false,
            "created_at": "2021-07-01T23:04:04.048Z",
            "updated_at": "2021-07-01T23:04:04.048Z",
            "report_type": "status"
          }
        ],
        "id": 123
    }
    

    Method: spot_get_orders

    Returns active orders.

    Place New Spot Order

    Request:

    {
        "method": "spot_new_order",
        "params": {
            "client_order_id": "57d5525562c945448e3cbd559bd068c4",
            "symbol": "ETHBTC",
            "side": "sell",
            "type": "limit",
            "quantity": "0.015",
            "price": "0.059837"
        },
        "id": 123
    }
    

    Success response:

    {
        "jsonrpc": "2.0",
        "result": {
            "id": 583565960004,
            "client_order_id": "57d5525562c945448e3cbd559bd06211",
            "symbol": "BTCUSDT",
            "side": "buy",
            "status": "new",
            "type": "market",
            "time_in_force": "GTC",
            "quantity": "0.00001",
            "quantity_cumulative": "0",
            "post_only": false,
            "created_at": "2021-07-02T00:58:05.307Z",
            "updated_at": "2021-07-02T00:58:05.307Z",
            "report_type": "new"
        },
        "id": 123
    }
    

    Example error response:

    {
        "error": {
            "code": 20001,
            "message": "Insufficient funds",
            "description": "Check that the funds are sufficient, given commissions"
        },
        "id": 123
    }
    

    Method: spot_new_order

    Creates a new spot order.

    Parameters:

    Name Type Description
    client_order_id String Optional. Order unique identifier as assigned by trader. Uniqueness must be guaranteed within a single trading day, including all active orders.
    symbol String Symbol code.
    side String Trade side.
    Accepted values: sell, buy
    type String Optional. Order type.
    Accepted values: limit, market, stopLimit, stopMarket
    Default value: limit
    time_in_force String Optional. Order type.
    Accepted values: GTC, IOC, FOK, Day, GTD
    Default value: GTC
    quantity Number Order quantity.
    price Number Order price. Required for limit types.
    stop_price Number Required for stop-limit and stop-market orders.
    expire_time DateTime Required for time_in_force = GTD.
    strict_validate Boolean Price and quantity will be checked for incrementation within the symbol's tick size and quantity step. See the symbol's tick_size and quantity_increment.
    post_only Boolean A post-only order is an order that does not remove liquidity. If your post-only order causes a match with a pre-existing order as a taker, then the order will be cancelled.
    take_rate Number Optional. Liquidity taker fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup.
    make_rate Number Optional. Liquidity provider fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup.

    Cancel Spot Order

    Request:

    {
        "method": "spot_cancel_order",
        "params": {
            "client_order_id": "57d5525562c945448e3cbd559bd068c4"
        },
        "id": 123
    }
    

    Response:

    {
        "jsonrpc": "2.0",
        "result": {
            "id": 583569472521,
            "client_order_id": "8a97337322774d8ea56448290fbc87b3",
            "symbol": "BTCUSDT",
            "side": "buy",
            "status": "canceled",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "0.00001",
            "quantity_cumulative": "0",
            "price": "0.01",
            "post_only": false,
            "created_at": "2021-07-02T01:03:56.625Z",
            "updated_at": "2021-07-02T01:05:41.84Z",
            "report_type": "canceled"
        },
        "id": 123
    }
    

    Method: spot_cancel_order

    Cancels an existing order.

    Cancel/Replace Spot Order

    Request:

    {
        "method": "spot_replace_order",
        "params": {
            "client_order_id": "d6b645556af740b1bd1683400fd9cbce",
            "new_client_order_id": "d6b645556af740b1bd1683400fd9cbcf",
            "quantity": "0.00001",
            "price": "0.02"
        },
        "id": 123
    }
    

    Response:

    {
        "jsonrpc": "2.0",
        "result": {
            "id": 583572753114,
            "client_order_id": "d6b645556af740b1bd1683400fd9cbcf",
            "symbol": "BTCUSDT",
            "side": "buy",
            "status": "new",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "0.00001",
            "quantity_cumulative": "0",
            "price": "0.02",
            "post_only": false,
            "created_at": "2021-07-02T01:10:06.976Z",
            "updated_at": "2021-07-02T01:11:18.238Z",
            "original_client_order_id": "d6b645556af740b1bd1683400fd9cbce",
            "report_type": "replaced"
        }
    }
    

    The Cancel/Replace request is used to change the parameters of an existing order and to change the quantity or price attribute of an open order.

    Do not use this request to cancel the quantity remaining in an outstanding order. Use the Cancel request message for this purpose.

    It is stipulated that a newly entered order cancels a prior order that has been entered but not yet executed.

    Method: spot_replace_order

    Parameters:

    Name Type Description
    client_order_id String Required. Identifier of the order being replaced.
    new_client_order_id String Required. client_order_id for a new order. Uniqueness must be guaranteed within a single trading day, including all active orders.
    quantity Number New order quantity.
    price Number New order price.
    strict_validate Boolean Price and quantity will be checked for the incrementation within tick size and quantity step. See symbol's tick_size and quantity_increment.

    Cancel Spot Orders

    Request:

    {
        "method": "spot_cancel_orders",
        "params": {},
        "id": 123
    }
    

    Response:

    {
        "jsonrpc": "2.0",
        "result": [
          {
            "id": 583572753114,
            "client_order_id": "d6b645556af740b1bd1683400fd9cbcf",
            "symbol": "BTCUSDT",
            "side": "buy",
            "status": "new",
            "type": "limit",
            "time_in_force": "GTC",
            "quantity": "0.00001",
            "quantity_cumulative": "0",
            "price": "0.02",
            "post_only": false,
            "created_at": "2021-07-02T01:10:06.976Z",
            "updated_at": "2021-07-02T01:11:18.238Z",
            "report_type": "canceled"
          }
        ]
    }
    

    Method: spot_cancel_orders

    Cancels all user's active orders and returns the ones which could not be cancelled.

    Get Spot Trading Balances

    Request:

    {
        "method": "spot_balances",
        "params": {},
        "id": 123
    }
    

    Response:

    {
        "jsonrpc":"2.0",
        "result": [
          {
            "currency": "BCN",
            "available": "100.000000000000",
            "reserved": "0"
          },
          {
            "currency": "BTC",
            "available": "0.013634021",
            "reserved": "0"
          },
          {
            "currency": "ETH",
            "available": "0",
            "reserved": "0"
          }
        ],
        "id": 123
    }
    

    Method: spot_balances

    Returns all non-zero trading balances.

    Get Spot Fees

    Request:

    {
        "method": "spot_fees",
        "params": {},
        "id": 123
    }
    

    Response:

    {
        "jsonrpc":"2.0",
        "result": [
        {
            "symbol": "BTCUSDT",
            "take_rate": "0.001",
            "make_rate": "-0.0001"
        },
        {
            "symbol": "ETHBTC",
            "take_rate": "0.001",
            "make_rate": "-0.0001"
        }
        ],
        "id": 123
    }
    

    Method: spot_fees

    Returns fees for all available symbols.

    Get Spot Fee

    Request:

    {
        "jsonrpc":"2.0",
        "method": "spot_fee",
        "params": {
            "symbol": "BTCUSDT"
        },
        "id": 123
    }
    

    Response:

    {
        "jsonrpc":"2.0",
        "result":
        {
            "symbol": "BTCUSDT",
            "take_rate": "0.001",
            "make_rate": "-0.0001"
        },
        "id": 123
    }
    

    Method: spot_fee

    Returns fees for the symbol specified.

    Socket Wallet Management

    Description

    WebSocket Account API uses the same authorization approach as described in the Socket Session Authentication section.

    API provides the following tools to manage a general account:

    Subscribe to Transactions

    Method: subscribe_transactions and the corresponding unsubscription method: unsubscribe_transactions

    Income method: transaction_update

    A full transaction model description can be found in the "Get Transactions History" section.

    A subscription to the transactions has to be used rather than the transaction polling.

    A transaction notification occurs each time the transaction has been changed, such as creating a transaction, updating the pending state (e.g., the hash assigned) or completing a transaction. This is the easiest way to track deposits or develop real-time asset monitoring.

    Subscription request:

    {
        "method": "subscribe_transactions", 
        "params": {},
        "id": 7652
    }
    

    Subscription result:

    {
        "result":true,
        "id": 7652
    }
    

    Notification. Updated Transaction:

    {
      "method": "transaction_update",
      "params": {
        {
          "id": 50844835,
          "created_at": "2021-06-22T21:03:04.111Z",
          "updated_at": "2021-06-22T21:04:41.487Z",
          "status": "SUCCESS",
          "type": "WITHDRAW",
          "subtype": "BLOCKCHAIN",
          "native": {
            "tx_id": "27fa7f14-ca49-42fd-834a-4ce630d069d2",
            "index": 1071885589,
            "currency": "ETH",
            "amount": "0.01042",
            "fee": "0.00958",
            "hash": "0xfb0ba568213d11230cd34d62fddd1cc1fe11fdc173l4f2007b0e47a06ad73d20",
            "address": "0xd959463c3fcb222124bb7bb642d6a6573a6c5aba",
            "confirmations": 20
         }
      }
    }
    

    Subscribe to Wallet Balance

    Method: subscribe_balance and the corresponding unsubscription method: unsubscribe_balance

    Income method: balance

    This subscription aims to provide an easy way to be informed of the current balance state. If the state has been changed or potentially changed, the balance event will come with the actual state. Please be aware that only non-zero values are present.

    Event "balances" arrives after each successful subscription.

    Subscription request:

    {
        "method": "subscribe_balance", 
        "params": {}, 
        "id": 7653
    }
    

    Subscription result:

    {
        "jsonrpc": "2.0",
        "result":true,
        "id": 7653
    }
    

    Notification. Updated Transaction:

    {
        "jsonrpc": "2.0",
        "method": "balances",
        "params": [
            {
                "currency": "BTC",
                "available": "0.00005821",
                "reserved": "0"
            },
            {
                "currency": "DOGE",
                "available": "11",
                "reserved": "0"
            }
        ]
    }
    

    Request Balance

    Request:

    {
        "method": "get_balance",
        "params": {},
        "id": 5543
    }
    

    Response:

    {
        "jsonrpc": "2.0",
        "result": [
            {
                "currency": "BTC",
                "available": "0.00005821",
                "reserved": "0"
            },
            {
                "currency": "DOGE",
                "available": "11",
                "reserved": "0"
            }
        ],
        "id": 5543
    }
    

    Method: get_balance

    Please note that the method returns non-zero balances only.

    Get Transactions

    Request:

    {
        "method": "get_transactions",
        "params": {
            "limit": 10,
            "offset": 0,
            "order": "desc",
            "from": "2020-01-31T00:00:00.000Z",
            "till": "2021-07-31T22:33:00.555Z",
            "statuses": "SUCCESS",
            "currencies": "ETH,BTC"
            },
        "id": 7655
    }
    

    Response:

    {
      "result": [
        {
          "id": 50844835,
          "created_at": "2021-06-22T21:03:04.111Z",
          "updated_at": "2021-06-22T21:04:41.487Z",
          "status": "SUCCESS",
          "type": "WITHDRAW",
          "subtype": "BLOCKCHAIN",
          "native": {
            "tx_id": "27fa7f14-ca49-42fd-834a-4ce630d069d2",
            "index": 1071885589,
            "currency": "ETH",
            "amount": "0.01042",
            "fee": "0.00958",
            "hash": "0xfb0ba568213d11230cd34d62fddd1cc1fe11fdc173l4f2007b0e47a06ad73d20",
            "address": "0xd959463c3fcb222124bb7bb642d6a6573a6c5aba",
            "confirmations": 20
          }
        },
        {
          "id": 36896428,
          "created_at": "2020-11-12T10:27:26.135Z",
          "updated_at": "2020-11-12T10:42:29.065Z",
          "status": "SUCCESS",
          "type": "DEPOSIT",
          "subtype": "BLOCKCHAIN",
          "native": {
            "tx_id": "a271ad64-5f34-4115-a63e-1cb5bbe4f67e",
            "index": 429625504,
            "currency": "BTC",
            "amount": "0.04836614",
            "hash": "4d7ae7c9d6fe84405ae167b3f0beacx8c68eb5a9d5189bckeb65d5e306427oe6",
            "address": "3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv",
            "confirmations": 2
          }
        }
      ],
      "id": 7655
    }
    

    Method: get_transactions

    All parameters are optional.

    Parameters:

    Name Type Description
    from DateTime Interval initial value (inclusive).
    till DateTime Interval end value (inclusive).
    types String Comma-separated transaction types. The list of supported types may be expanded in future versions.
    Accepted values: DEPOSIT, WITHDRAW, TRANSFER, SWAP
    subtypes String Comma-separated transaction subtypes. Some subtypes are reserved for future use and do not purport to provide any functionality on the platform. The list of supported subtypes may be expanded in future versions.
    Accepted values: UNCLASSIFIED, BLOCKCHAIN, AIRDROP, AFFILIATE, STAKING, BUY_CRYPTO, OFFCHAIN, FIAT, SUB_ACCOUNT, WALLET_TO_SPOT, SPOT_TO_WALLET, WALLET_TO_DERIVATIVES, DERIVATIVES_TO_WALLET, CHAIN_SWITCH_FROM, CHAIN_SWITCH_TO, INSTANT_EXCHANGE
    statuses String Comma-separated transaction statuses.
    Accepted values: CREATED, PENDING, FAILED, SUCCESS, ROLLED_BACK
    currencies String Comma-separated currency codes.
    id_from Number Index interval initial value.
    Accepted values: 0 or greater
    id_till Number Index interval end value.
    Accepted values: 0 or greater
    tx_ids String Comma-separated transaction identificators.
    order_by String Defines order type.
    Accepted values: created_at, id
    Default value: created_at
    sort String Sort direction.
    Accepted values: DESC, ASC
    Default value: DESC
    limit Number Default value: 100
    Max value: 1000
    offset Number Default value: 0
    Max value: 100000

    Errors

    The Crosstower API uses the following error codes:

    Error code HTTP Status Code Message Note
    429 429 Too many requests Action is being rate limited for the account.
    500 500 Internal Server Error
    503 503 Service Unavailable Try it again later.
    504 504 Gateway Timeout Check the result of your request later.
    600 400 Action not allowed
    800 404 Resource Not Found
    1002 401 Authorization required or has been failed Check that authorization data were provided.
    1003 403 Action forbidden for this API key Check permissions for API key, whitelists, or any security feature that might block this request.
    1004 401 Unsupported authorization method Use Basic authentication.
    1005 401 Authorization is invalid
    2001 400 Symbol not found
    2002 400 Currency not found
    2010 400 Quantity not a valid number
    2011 400 Quantity too low
    2012 400 Bad quantity
    2020 400 Price not a valid number
    2022 400 Bad price
    10001 400 Validation error Input is not valid, see more in message field.
    10021 400 User disabled
    10022 400 Bad fee markup
    20001 400 Insufficient funds Insufficient funds for creating an order or any account operations. Check that the funds are sufficient, given commissions.
    20002 400 Order not found Attempt to get an active order that does not exist or is filled, canceled, expired. Attempt to cancel a non-existing order. Attempt to cancel an already filled or expired order.
    20003 400 Limit exceeded
    20004 400 Transaction not found Requested transaction was not found.
    20005 400 Payout not found
    20006 400 Payout already committed
    20007 400 Payout already rolled back
    20008 400 Duplicate clientOrderId
    20009 400 Price and quantity not changed
    20010 400 Exchange temporary closed Exchange market is temporary closed on the symbol.
    20011 400 Payout address is invalid
    20012 400 Payout payment address is invalid
    20014 400 Payout offchain unavailable Address does not belong to exchange, belongs to the same user, or is unavailable for currency.
    20016 400 Payout fee level invalid
    20043 400 Duplicate request
    20044 400 Trading operation not allowed
    20045 400 Fat finger limit exceeded
    20080 400 Internal order execution deadline exceeded Order was not placed.