NAV Navigation
Shell

BlockTrade API v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Welcome to the Blocktrade API documentation

Below you'll find everything you need to know on how to connect to the Blocktrade API. The API provides all the necessary endpoints you need to conduct your data gathering or automated trading, including trade and order book data, creating orders, tracking portfolios and streaming websockets.

An account is needed to interact with the private part of the API. Register at Blocktrade.com to get the necessary API key and secret.

Getting Started

To try out the examples on Linux or MacOS, copy them to the console and run them. On Windows, curl has to be installed before doing that, you can get it here.

If you have questions or would like to make a feature request or a bug report, don't hesitate contacting us at [email protected].

Base URLs:

Terms of service

Authentication

Public API

import json
import pprint
from http import client

trading_pair_id = 1

# call the API `GET trades` endpoint
conn = client.HTTPSConnection("trade.blocktrade.com")
conn.request("GET", "/api/v1/trades/%d" % trading_pair_id, headers={
    'Content-Type': 'application/json',
})
response = conn.getresponse()
response_raw = response.read()
try:
    response_json = json.loads(response_raw)
    pprint.pprint(response_json)
except:
    print(response_raw)

No account or credentials are needed to use the public API. All endpoints have a curl example on the right. Copy the example your console, adjust the parameters, and run it to see the response.

Immediately to the right is also an example of how to do a request to the public API using Python 3.

Trading Assets

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/trading_assets \
  -H 'Accept: application/json'

GET /trading_assets

Get all available trading assets

Example responses

200 Response

[
  {
    "id": 2,
    "full_name": "Euro",
    "iso_code": "EUR",
    "icon_path": "/media/eur.svg",
    "icon_path_png": "/media/eur.png",
    "color": "#3A61AD",
    "sign": "€",
    "currency_type": "FIAT",
    "minimal_withdrawal_amount": "0.01",
    "minimal_order_value": "0.1",
    "maximum_order_value": 620000,
    "decimal_precision": 2,
    "lot_size": "0.1",
    "deposit_methods": "WALLET_ADDRESS",
    "is_restricted_for_user": true,
    "tags": "NEW",
    "is_favourite": true
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [TradingAsset] false none none
» id integer false none none
» full_name string false none none
» iso_code string false none none
» icon_path string false none none
» icon_path_png string false none none
» color string false none none
» sign string|null false none none
» currency_type string false none Currency type
» minimal_withdrawal_amount string false none none
» minimal_order_value string false none none
» maximum_order_value string false none none
» decimal_precision integer false none none
» lot_size string false none none
» deposit_methods [string] false none none
» is_restricted_for_user boolean false none none
» tags [string] false none none
» is_favourite boolean false none none

Enumerated Values

Property Value
currency_type FIAT
currency_type CRYPTOCURRENCY
deposit_methods WALLET_ADDRESS
deposit_methods CLEAR_JUNCTION_SEPA
tags NEW
tags FEATURED
tags OTHER_CUSTOM_TAGS

Trading Pairs

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/trading_pairs \
  -H 'Accept: application/json'

GET /trading_pairs

Get all available trading pairs

Example responses

200 Response

[
  {
    "id": 1,
    "base_asset_id": 3,
    "quote_asset_id": 2,
    "decimal_precision": 2,
    "lot_size": "0.01",
    "tick_size": "0.00001",
    "restricted_directions_for_user": [
      "BUY"
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [TradingPair] false none none
» id integer false none none
» base_asset_id integer false none none
» quote_asset_id integer false none none
» decimal_precision integer false none none
» lot_size string false none Lot size of the base trading asset
» tick_size string false none none
» restricted_directions_for_user [string] false none none

Order Book

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/order_book/{trading_pair_id} \
  -H 'Accept: application/json'

GET /order_book/{trading_pair_id}

Get order book based on trading pair ID

Parameters

Name In Type Required Description
trading_pair_id path integer true ID of trading_pair

Example responses

200 Response

{
  "asks": [
    {
      "amount": "2.20535071",
      "price": "6140.11",
      "value": "13541.09"
    }
  ],
  "bids": [
    {
      "amount": "2.20535071",
      "price": "6140.11",
      "value": "13541.09"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrderBook
404 Not Found Order book not found Error

Ticker

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/ticker/{trading_pair_id} \
  -H 'Accept: application/json'

GET /ticker/{trading_pair_id}

Get ticker based on trading pair ID

Parameters

Name In Type Required Description
trading_pair_id path integer true ID of trading_pair

Example responses

200 Response

{
  "last_price": "6039.3",
  "bid_price": "6050.17",
  "ask_price": "6056.77",
  "volume": "42000.0024",
  "low": "5999.74",
  "high": "6200.76"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Ticker
404 Not Found Trading pair Last price not found

Trades

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/trades/{trading_pair_id} \
  -H 'Accept: application/json'

GET /trades/{trading_pair_id}

Get trades for given trading pair ID

Parameters

Name In Type Required Description
trading_pair_id path integer true ID of trading_pair
offset query integer false Offset of trades to start from, default 0
limit query integer false Number of trades per page, default 10, maximum 1000

Example responses

200 Response

{
  "data": [
    {
      "id": 12834779,
      "order_id": 16329236,
      "matched_order_id": 16284185,
      "trading_pair_id": 1,
      "symbol": "BTC/USD",
      "direction": "SELL",
      "amount": "0.1734811",
      "price": "6048.22",
      "date": 1533543752844
    }
  ],
  "count": 1293512,
  "offset": 0,
  "limit": 10
}

Responses

Status Meaning Description Schema
200 OK Successful operation AllTrades
403 Forbidden Operation forbidden Error
404 Not Found Trading pair not found Error

Private API

import hashlib
import hmac
from http import client
import time
import pprint
import json

# enter your API key and secret
API_KEY = 'YOUR_API_KEY'
API_SECRET = 'YOUR_API_SECRET'

# nonce must be increased and unique on each subsequent request
NONCE = int(time.time())

def gen_signature(api_key, api_secret, nonce, request_body=''):
    """Generates the signature for the given request. `request_body` should contain any POST data."""
    message = '{}.{}'.format(api_key, nonce).encode()
    if request_body:
        message += '.{}'.format(request_body).encode()
    return hmac.new(api_secret.encode(), msg=message, digestmod=hashlib.sha256).hexdigest().upper()

data = dict(
            portfolio_id=1,
            direction='BUY',
            type='LIMIT',
            trading_pair_id=1,
            amount='0.1',
            price='0.1',
        )

data_str = json.dumps(data)

# generate the signature for the request
signature = gen_signature(API_KEY, API_SECRET, NONCE, data_str)

headers = {
    'X-Api-Key': API_KEY,
    'X-Nonce': NONCE,
    'X-Signature': signature,
    'Content-Type': 'application/json',
}

# call the API `POST orders` endpoint
conn = client.HTTPSConnection("trade.blocktrade.com")
conn.request("POST", "/api/v1/orders", body=data_str, headers=headers)
response = conn.getresponse()
response_raw = response.read()
try:
    response_json = json.loads(response_raw)
    pprint.pprint(response_json)
except:
    print(response_raw)

To use the endpoints in the private part of the Blocktrade API, you first have do get your API key and secret. These can be generated by logging in, going to Settings, then API Keys. A good practice is to generate a separate API key/secret pair for each application.

In addition to Content-Type: application/json, three additional headers related to authentication should be present when using the private API:

Header Description
X-Api-Key The API key generated under your account's Settings -> API Keys
X-Nonce Nonce is a number that should be increased with each request in order to avoid the replay attack. Often, the epoch integer value is used.
X-Signature To cryptographically sign the request, calculate a HMAC signature, using SHA-256. See below for details.

The signature is calculated first creating a string YOUR_API_KEY.YOUR_NONCE.YOUR_JSON_REQUEST_BODY and encoding it with UTF-8. This is then HMAC encoded with your API secret, using the SHA256 hashing algorithm. All characters are then changed to uppercase. See the code on the right for a complete example in Python 3.

User Trades

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/user_trades \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /user_trades

Get the trades belonging to the authenticated user including the trade fees.

Get the trades belonging to the authenticated user including the trade fees. Since we are using a higher time precision internally, duplicates should be expected when requesting trades that happened from the time of the last previously received trade i.e. setting start_time to be the date of the latest previously received trade.

Parameters

Name In Type Required Description
start_time query integer false UTC timestamp in milliseconds, returned trades will have happened after this time. There will be no lower bound on the time for the results if this parameter is omitted.
end_time query integer false UTC timestamp in milliseconds, returned trades will have happened before this time. There will be no upper bound on the time for the returned results if this parameter is omitted.
trading_pair_ids query string false Comma separated list of trading pair ids for which trades should be shown. Defaults to all trading pairs.
trade_sides query string false Comma separated list of trade sides (BUY/SELL) to be shown. Default returns both.
limit query integer false The number of trades to return.
offset query integer false Offset of trades to start from.

Example responses

200 Response

{
  "data": [
    {
      "id": 19873,
      "order_id": 23498,
      "trading_pair_id": 1,
      "symbol": "BTC/USD",
      "direction": "SELL",
      "amount": "0.1734811",
      "price": "6048.22",
      "date": 1533543752844,
      "fee_value": "0.000003",
      "trade_value": "1049.25",
      "maker": true
    }
  ],
  "count": 1234
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserTrades
401 Unauthorized Unauthorized Error

User Orders

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/orders \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /orders

Get all user's orders

Parameters

Name In Type Required Description
offset query integer false Offset of orders to start from, default 0, maximum offset = 100000 - limit
limit query integer false Number of orders per page, default 10, maximum 1000
status query string false List of statuses separated by ',' sign, which orders will be filtered by
type query string false List of order types separated by ',' sign, which orders will be filtered by
trading_pair_id query string false List of trading pair ids separated by ',' sign, which orders will be filtered by

Example responses

200 Response

{
  "data": [
    {
      "id": 14804210,
      "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
      "portfolio_id": 1,
      "trading_pair_id": 1,
      "direction": "BUY",
      "type": "LIMIT",
      "amount": "0.2",
      "remaining_amount": "0.1",
      "price": "6048.22",
      "time_in_force": "GTC",
      "stop_price": null,
      "date": 1533456985351,
      "status": "PARTIALLY_FILLED",
      "trades": [
        {
          "id": 1234,
          "value": "0.1",
          "price": "6048.22",
          "time": 1533543752844
        }
      ]
    }
  ],
  "count": 2,
  "offset": 0,
  "limit": 10
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserOrders
400 Bad Request Operation with invalid arguments Error
401 Unauthorized Unauthenticated Error

Place New Order

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/orders \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /orders

Place new order

Note: The order price must be an integer factor of the tick size. In other words, the price cannot be more granular than its tick size.

Here are the current tick sizes:

Trading pair Tick size
ETH/BTC 0.00001
BCH/BTC 0.00001
XRP/BTC 0.00000001
LTC/BTC 0.00001
BCH/ETH 0.001
XRP/ETH 0.00000001
LTC/ETH 0.00001
BTT/ETH 0.00000001
KAYA/ETH 0.00000001

Body parameter

{
  "portfolio_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "trading_pair_id": 1,
  "amount": "0.1",
  "price": 1000,
  "time_in_force": "GTC",
  "stop_price": null
}

Parameters

Name In Type Required Description
body body NewOrderRequest true Data needed for placing order

Example responses

200 Response

{
  "id": 16342774,
  "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3"
}

Responses

Status Meaning Description Schema
200 OK Successful operation NewlyPlacedOrder
400 Bad Request Operation with invalid arguments Error
401 Unauthorized Unauthenticated Error
403 Forbidden API key with not enough access rights Error
404 Not Found Trading pair not found Error
409 Conflict Operation's arguments caused conflict Error

Cancel All Active Orders

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/orders/cancel_active \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /orders/cancel_active

Cancells all active orders

Example responses

401 Response

{
  "message": "Error message"
}

Responses

Status Meaning Description Schema
202 Accepted Bulk cancellation request accepted None
401 Unauthorized Unauthenticated Error
403 Forbidden API key with not enough access rights Error
409 Conflict Operation's arguments caused conflict Error

Cancel All Active Orders By Trading Pair

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/orders/cancel \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /orders/cancel

Cancells all active orders by trading pair

Body parameter

{
  "trading_pair_id": 0
}

Parameters

Name In Type Required Description
body body TradingPairId true Data needed to remove orders by trading pair

Example responses

401 Response

{
  "message": "Error message"
}

Responses

Status Meaning Description Schema
202 Accepted Bulk cancellation request accepted None
401 Unauthorized Unauthenticated Error
403 Forbidden API key with not enough access rights Error
409 Conflict Operation's arguments caused conflict Error

Order Details

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/orders/{id} \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /orders/{id}

Get order details

Parameters

Name In Type Required Description
id path integer true ID of order

Example responses

200 Response

{
  "id": 14804210,
  "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
  "portfolio_id": 1,
  "trading_pair_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "amount": "0.2",
  "remaining_amount": "0.1",
  "price": "6048.22",
  "time_in_force": "GTC",
  "stop_price": null,
  "date": 1533456985351,
  "status": "PARTIALLY_FILLED",
  "trades": [
    {
      "id": 1234,
      "value": "0.1",
      "price": "6048.22",
      "time": 1533543752844
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserOrder
401 Unauthorized Unauthenticated Error
404 Not Found Order not found Error

Cancel Order

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/orders/{id}/cancel \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /orders/{id}/cancel

Cancel order

Parameters

Name In Type Required Description
id path integer true ID of order

Example responses

401 Response

{
  "message": "Error message"
}

Responses

Status Meaning Description Schema
202 Accepted Cancellation request accepted None
401 Unauthorized Unauthenticated Error
403 Forbidden API key with not enough access rights Error
404 Not Found Order/Trading pair not found Error
409 Conflict Operation's arguments caused conflict Error
422 Unprocessable Entity Order can not be cancelled Error

Place New Customer Order

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/customer_orders \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /customer_orders

Place new customer order

Note: The order price must be an integer factor of the tick size. In other words, the price cannot be more granular than its tick size. Here are the current tick sizes:

Trading pair Tick size
ETH/BTC 0.00001
BCH/BTC 0.00001
XRP/BTC 0.00000001
LTC/BTC 0.00001
BCH/ETH 0.001
XRP/ETH 0.00000001
LTC/ETH 0.00001
BTT/ETH 0.00000001
KAYA/ETH 0.00000001

Body parameter

{
  "customer_order_id": 1,
  "portfolio_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "trading_pair_id": 1,
  "amount": "0.1",
  "price": 1000,
  "time_in_force": "GTC",
  "stop_price": null
}

Parameters

Name In Type Required Description
body body NewCustomerOrderRequest true Data needed for placing customer order

Example responses

200 Response

{
  "id": 16342774,
  "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3"
}

Responses

Status Meaning Description Schema
200 OK Successful operation NewlyPlacedOrder
400 Bad Request Operation with invalid arguments Error
401 Unauthorized Unauthenticated Error
403 Forbidden API key with not enough access rights Error
404 Not Found Trading pair not found Error
409 Conflict Operation's arguments caused conflict Error

Customer Order Details

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/customer_orders/{id} \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /customer_orders/{id}

Get customer order details

Parameters

Name In Type Required Description
id path string true ID of customer order

Example responses

200 Response

{
  "id": 14804210,
  "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
  "portfolio_id": 1,
  "trading_pair_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "amount": "0.2",
  "remaining_amount": "0.1",
  "price": "6048.22",
  "time_in_force": "GTC",
  "stop_price": null,
  "date": 1533456985351,
  "status": "PARTIALLY_FILLED",
  "trades": [
    {
      "id": 1234,
      "value": "0.1",
      "price": "6048.22",
      "time": 1533543752844
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserOrder
401 Unauthorized Unauthenticated Error
404 Not Found Order not found Error

Cancel Customer Order

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/customer_orders/{id}/cancel \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /customer_orders/{id}/cancel

Cancel customer order

Parameters

Name In Type Required Description
customer_order_id path string true ID of customer order

Example responses

401 Response

{
  "message": "Error message"
}

Responses

Status Meaning Description Schema
202 Accepted Cancellation request accepted None
401 Unauthorized Unauthenticated Error
403 Forbidden API key with not enough access rights Error
404 Not Found Order not found Error
409 Conflict Operation's arguments caused conflict Error
422 Unprocessable Entity Order can not be cancelled Error

User Portfolios

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/portfolios \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /portfolios

Get all available user's portfolios

Example responses

200 Response

[
  {
    "id": 916,
    "assets": [
      {
        "trading_asset_id": 2,
        "available_amount": "24990.00",
        "reserved_amount": "24990.00",
        "locked_amount": "24990.00",
        "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline
401 Unauthorized Unauthenticated Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Portfolio] false none none
» id integer false none none
» assets [PortfolioAsset] false none none
»» trading_asset_id integer false none none
»» available_amount string false none none
»» reserved_amount string false none none
»» locked_amount string false none none
»» wallet_address string|null false none none

Withdraw

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/portfolios/{id}/withdraw \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /portfolios/{id}/withdraw

Withdraw crypto currency based on portfolio ID, trading asset, destination_address, message and amount.

Note: In the case of withdrawing to XRP, KAYA or XLM destination address, the proper format of the destination address is like listed in the table below:

Trading asset Format of destination address
XRP the_address?dt=the_destination_tag_number
KAYA the_address?msg=the_message
XLM the_address?memoId=the_memo_id_number

Body parameter

{
  "amount": 24990,
  "trading_asset_id": 2,
  "message": "The withdrawal message",
  "destination_address": "175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"
}

Parameters

Name In Type Required Description
id path integer true ID of portfolio
body body object true Data needed for withdraw
» amount body string true Amount of withdraw, number as string
» trading_asset_id body integer true Trading asset of withdraw
» message body string false Message of withdraw
» destination_address body string true Destination address where to withdraw

Example responses

200 Response

[
  {
    "id": 916,
    "assets": [
      {
        "trading_asset_id": 2,
        "available_amount": "24990.00",
        "reserved_amount": "24990.00",
        "locked_amount": "24990.00",
        "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline
400 Bad Request Operation with invalid arguments Error
401 Unauthorized Unauthenticated Error
403 Forbidden API key with not enough access rights Error
404 Not Found Portfolio User not found
409 Conflict Operation's arguments caused conflict Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Portfolio] false none none
» id integer false none none
» assets [PortfolioAsset] false none none
»» trading_asset_id integer false none none
»» available_amount string false none none
»» reserved_amount string false none none
»» locked_amount string false none none
»» wallet_address string|null false none none

Get All Fiat Withdrawals

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/portfolios/{id}/fiat_withdrawals \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /portfolios/{id}/fiat_withdrawals

List all FIAT withdrawals based on portfolio ID

Parameters

Name In Type Required Description
id path integer true User's portfolio ID

Example responses

200 Response

[
  {
    "id": 0,
    "customer_id": 0,
    "status": "PENDING",
    "type": "SEPA",
    "bank_account": {
      "id": "string",
      "iban": "string",
      "bic": "string",
      "display_name": "string",
      "status": "NEW"
    },
    "iso_code": "EUR",
    "amount": "string",
    "fee": "string",
    "created_at": 0,
    "modified_at": 0
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation FiatWithdrawals
401 Unauthorized Unauthenticated Error
404 Not Found Portfolio not found Error
503 Service Unavailable Service Unavailable Error

Add Fiat Withdrawal

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/portfolios/{id}/fiat_withdrawals \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /portfolios/{id}/fiat_withdrawals

Add FIAT withdrawal portfolio ID, trading asset, bank account id

Body parameter

{
  "bank_account_id": "string",
  "trading_asset_id": 0,
  "amount": "string",
  "type": "SEPA"
}

Parameters

Name In Type Required Description
id path integer true User's portfolio ID
body body object true Data needed for FIAT withdraw
» bank_account_id body string true ID of bank account (that exists and has status VERIFIED)
» trading_asset_id body integer true Trading asset of withdraw
» amount body string true Amount of withdraw, number as string
» type body string false none

Enumerated Values

Parameter Value
» type SEPA

Example responses

200 Response

[
  {
    "id": 916,
    "assets": [
      {
        "trading_asset_id": 2,
        "available_amount": "24990.00",
        "reserved_amount": "24990.00",
        "locked_amount": "24990.00",
        "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline
400 Bad Request Operation with invalid arguments Error
401 Unauthorized Unauthenticated Error
403 Forbidden API key with not enough access rights Error
404 Not Found Bank account or portfolio not found Error
503 Service Unavailable Service Unavailable Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Portfolio] false none none
» id integer false none none
» assets [PortfolioAsset] false none none
»» trading_asset_id integer false none none
»» available_amount string false none none
»» reserved_amount string false none none
»» locked_amount string false none none
»» wallet_address string|null false none none

Get Fiat Withdrawal Details

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/portfolios/{id}/fiat_withdrawals/{withdrawal_id} \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /portfolios/{id}/fiat_withdrawals/{withdrawal_id}

Get details of one FIAT withdrawal based on portfolio ID and withdrawal ID

Parameters

Name In Type Required Description
id path integer true User's portfolio ID
withdrawal_id path integer true FIAT withdrawal ID

Example responses

200 Response

{
  "id": 0,
  "customer_id": 0,
  "status": "PENDING",
  "type": "SEPA",
  "bank_account": {
    "id": "string",
    "iban": "string",
    "bic": "string",
    "display_name": "string",
    "status": "NEW"
  },
  "iso_code": "EUR",
  "amount": "string",
  "fee": "string",
  "created_at": 0,
  "modified_at": 0
}

Responses

Status Meaning Description Schema
200 OK Successful operation FiatWithdrawalDetails
401 Unauthorized Unauthenticated Error
404 Not Found Portfolio or withdrawal not found Error
503 Service Unavailable Service Unavailable Error

User

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/user \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /user

Get the user data

Example responses

200 Response

{
  "user_id": 952,
  "email": "[email protected]",
  "primary_currency": {
    "id": 2,
    "name": "EUR"
  },
  "kyc_status": "OK",
  "websocket_auth_token": "1111111111111111111111111111111111111111",
  "is_2fa_enabled": true,
  "first_name": "FirstName",
  "last_name": "LastName",
  "gender": "Mal",
  "date_of_birth": 648345600000,
  "place_of_birth": "SomeCity",
  "address": "SomeAddress",
  "postal_code": 1234,
  "city": "SomeCity",
  "state": "SomeState",
  "country": "SomeCountry",
  "phone_number": "+1 123 456",
  "aml_required": true,
  "account_type": "INDIVIDUAL",
  "legal_type": "None",
  "instant_exchange_enabled": false,
  "ui_theme": "LIGHT"
}

Responses

Status Meaning Description Schema
200 OK Successful operation User
401 Unauthorized Unauthenticated Error

Get User Bank Accounts

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/user/bank_accounts \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /user/bank_accounts

Get all user's bank accounts

Example responses

200 Response

{
  "bank_accounts": [
    {
      "id": "string",
      "iban": "string",
      "bic": "string",
      "display_name": "string",
      "status": "NEW"
    }
  ],
  "ref_number": "string",
  "send_to_data": {
    "account_holder": "string",
    "payment_provider": "string",
    "iban": "string",
    "bic": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserBankAccounts
401 Unauthorized Unauthenticated Error
503 Service Unavailable Service Unavailable Error

Fees

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/fees \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /fees

Get the fee data

Example responses

200 Response

{
  "TRADING": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_CREDIT_CARD": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_OUTSIDE_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT_OUTSIDE_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "MINER_FEE": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "BROKER_EXCHANGE_TRADING": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation FeeType
403 Forbidden Operation forbidden Error

Settings

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/settings \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /settings

Get the settings

Example responses

200 Response

{
  "rounding_policy": {
    "BUY_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
    "SELL_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
    "PORTFOLIO_TOTAL_VALUE": "ROUNDING_DOWN",
    "SERVICE_VALUE": "ROUNDING_DOWN",
    "MINER_FEE": "ROUNDING_DOWN",
    "TRADING": "ROUNDING_DOWN",
    "TRANSFER_IN_CREDIT_CARD": "ROUNDING_DOWN",
    "TRANSFER_IN_SEPA": "ROUNDING_DOWN",
    "TRANSFER_IN_OUTSIDE_SEPA": "ROUNDING_DOWN",
    "TRANSFER_OUT": "ROUNDING_DOWN",
    "TRANSFER_OUT_SEPA": "ROUNDING_DOWN",
    "TRANSFER_OUT_OUTSIDE_SEPA": "ROUNDING_DOWN",
    "BROKER_EXCHANGE_TRADING": "ROUNDING_DOWN"
  },
  "features": {
    "ask_for_account_type": true,
    "disable_deposit_and_withdraw": true,
    "disable_kyc_verification": true,
    "disable_fill_or_kill": true,
    "disable_stop_order": true,
    "referrer_campaign": true,
    "show_beta_icons": true,
    "subscriptions": true,
    "instant_exchange_is_enabled": true
  },
  "external": {
    "analytics": {
      "GoogleAnalytics": {
        "tracking_id": "string",
        "gtag_id": "string"
      },
      "Smartlook": {
        "site_key": "string",
        "region": "string"
      },
      "Hotjar": {
        "hjid": 0,
        "hjsv": 0
      },
      "Facebook": {
        "pixel_id": "string"
      }
    },
    "checkout": null,
    "freshchat": {
      "token": "string"
    },
    "hcaptcha": {
      "site_key": "string"
    },
    "recaptcha": {
      "site_key": "string"
    },
    "recaptcha_ios": {
      "site_key": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation Settings
403 Forbidden Operation forbidden Error

Websockets

  # Install the websocket-client library with:
  # > pip install websocket-client

  from websocket import WebSocketApp

  def on_message(ws, message):
      print(message)

  def on_error(ws, error):
      print(error)

  def on_open(ws):
      ws.send("""{ "subscribe_order_book": { "trading_pair_id": 1 } }""")

  app = WebSocketApp("wss://trade.blocktrade.com/ws/v1/notification",
                    on_message=on_message,
                    on_error=on_error)
  app.on_open = on_open
  app.run_forever(ping_interval=30)

URLs

There is one common endpoint for all websockets connections with the same hostname as REST API:

/ws/v1/notification

Channels and data subscriptions

Newly connected clients will not receive any data until they subscribe for a specific channel. Channels is an abstraction over certain kind of data. Channels can be parametrized by clients to narrow down results. A common use case is to observe only few trading pairs to get data for drawing charts.

Once client subscribes, service sends current state or initial date, depending on a channel. For example, portfolio channel sends current portfolio state immediately.

Data is sent until client disconnects or sends unsubscribe message.

After unsubscribing from a channel, the service will send an unsubscribe confirmation, which will contain the channel name and subscription parameters if they are not empty in the payload.

Note: A session that has been inactive for more than 60 seconds will be forcibly closed by the server. To avoid this, you should use the appropriate options when connecting to the server, such as ping_interval if you are using the websocket-client package. If you use other lib please look for support of ping defined in RFC 6455 for WebSockets Protocal

Authentication mechanism

Authentication is needed only for three channels: Portfolio, User Activity and User Orders. There are two ways of authenticating:

# The subscription request when authenticating with auth_token:
{
    "subscribe_user_orders": {
        "auth_token": "YOUR_AUTH_TOKEN"
    }
}
  1. Authenticate with auth_token which you send as subscribe request field. auth_token is available the at the /user REST endpoint. See an example of subscribe_user_orders on the right.
# Authenticating with headers when initiating the connection:
signature = gen_signature(API_KEY, API_SECRET, NONCE)
headers = {
    'X-Api-Key': API_KEY,
    'X-Nonce': NONCE,
    'X-Signature': signature,
}
app = WebSocketApp(..., header=headers)
  1. Authenticate directly with using X-Api-Key/X-Nonce/X-Signature by setting the headers when initiating the Websocket connection. In this case, you do not set the auth_token field (subscribe_user_orders would have no fields set). See the code on the right.

See the Private API section for the definition of gen_signature.

Exchange Rates (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28Exchange%20Rates%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28Exchange%20Rates%29

Exchange Rates websocket data

Subscribe message format

{
    "subscribe_exchange_rates": {}
}

Unsubscribe message format

{
    "unsubscribe_exchange_rates": {}
}

Example responses

default Response

[
  {
    "quote_trading_asset_id": 2,
    "base_trading_asset_id": 3,
    "created_at": 1585219721,
    "rate": "6555.45"
  }
]

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketExchangeRates
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelWithoutParams

Line Chart (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28Line%20Chart%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28Line%20Chart%29

Line chart data

Line chart data

Data by trading pair, suitable for line charts.

Subscribe message format

{
  "subscribe_line": {
      "trading_pair_id": 1,
      "resolution": 86400,
      "start_time": 1533081600000,
      "end_time": 1849046400000,
      "source": "INTERNAL",
  }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API
resolution resolution of a single data point (86400 means that client will get data points by day)
start_time (optional) timestamp of first data point (historical). If omitted we assume now - 40 * resolution
end_time (optional) timestamp of last data point. If omitted assume now. If start_time is omitted, this is ignored
source One of "INTERNAL", "EXTERNAL". Where "INTERNAL" means that the data sent will be from the blocktrade exchange, while "EXTERNAL" means that it will be from an external data provider.

Unsubscribe message format

{
    "unsubscribe_line": {
        "trading_pair_id": 1,
        "resolution": 86400,
        "source": "INTERNAL",
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API
resolution resolution of a single data point (86400 means that client will get data points by day)
source One of "INTERNAL", "EXTERNAL". Where "INTERNAL" means that the data sent will be from the blocktrade exchange, while "EXTERNAL" means that it will be from an external data provider.

Example responses

default Response

{
  "message_type": "line",
  "payload": {
    "trading_pair_id": 1,
    "resolution": 86400,
    "source": "INTERNAL",
    "dailyChange": "155.85",
    "dailyHigh": "6167.15",
    "dailyLow": "6011.3",
    "dailyVolume": "418693670.8",
    "data": [
      {
        "date": 1533513600000,
        "value": "6045.34"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketLineChart
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChartChannel

OHLCV (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28OHLCV%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28OHLCV%29

Open, high, low, close, volume data

{
    "subscribe_ohlcv": {
        "trading_pair_id": 1,
        "resolution": 86400,
        "start_time": 1533081600000,
        "end_time": 1849046400000,
        "source": "INTERNAL",
    }
}

Subscribe message format

Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API
resolution resolution of a single data point (86400 means that client will get data points by day)
start_time (optional) timestamp of first data point (historical). If omitted we assume now - 40 * resolution
end_time (optional) timestamp of last data point. If omitted assume now. If start_time is omitted, this is ignored
source One of "INTERNAL", "EXTERNAL". Where "INTERNAL" means that the data sent will be from the blocktrade exchange, while "EXTERNAL" means that it will be from an external data provider.

Unsubscribe message format

{
    "unsubscribe_ohlcv": {
        "trading_pair_id": 1,
        "resolution": 86400,
        "source": "INTERNAL",
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API
resolution resolution of a single data point (86400 means that client will get data points by day)
source One of "INTERNAL", "EXTERNAL". Where "INTERNAL" means that the data sent will be from the blocktrade exchange, while "EXTERNAL" means that it will be from an external data provider.

Example responses

default Response

{
  "message_type": "ohlcv",
  "payload": {
    "trading_pair_id": 1,
    "source": "INTERNAL",
    "resolution": 86400,
    "oldest_available_data_point": 1532476800000,
    "data": [
      {
        "date": 1533513600000,
        "close": "6042.32",
        "volume": "408815169.35",
        "open": "6073.9",
        "high": "6167.15",
        "low": "6011.3"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketOHLCV
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChartChannel

Order Book (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28Order%20Book%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28Order%20Book%29

Order book websocket data. The first message received after subscribe is the full order book. The following messages are updates only. Both types of messages have the same JSON structure.

Order book

Current bids and asks, aggregated.

Subscribe message format

{
    "subscribe_order_book": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Unsubscribe message format

{
    "unsubscribe_order_book": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Example responses

default Response

{
  "message_type": "order_book",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "bids": [
          {
            "price": "6043.23",
            "amount": "2.5510545",
            "value": "15417.19"
          }
        ],
        "asks": [
          {
            "price": "6044.1",
            "amount": "4.81763208",
            "value": "29118.25"
          }
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketOrderBook
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelTradingId

Portfolio (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28Portfolio%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28Portfolio%29

Portfolio websocket data

Subscribe message format

{
    "subscribe_portfolio": {
        "auth_token": "1111111111111111111111111111111111111111"
    }
}
Name Description
auth_token the authentication token, obtained using REST API

Unsubscribe message format

{
    "unsubscribe_portfolio": {}
}

Example responses

default Response

{
  "message_type": "portfolio",
  "payload": {
    "data": [
      {
        "id": 916,
        "assets": [
          {
            "trading_asset_id": 2,
            "available_amount": "24990.00",
            "reserved_amount": "24990.00",
            "locked_amount": "24990.00",
            "wallet_address": "11111111-1111-1111-1111-111111111111"
          }
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketPortfolio
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelWithoutParams

Ticker (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28Ticker%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28Ticker%29

Ticker websocket data

Subscribe message format

{
    "subscribe_ticker": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Unsubscribe message format

{
    "unsubscribe_ticker": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Example responses

default Response

{
  "message_type": "ticker",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "ask_price": "6045.72",
        "bid_price": "6044.69",
        "last_price": "6045.72",
        "volume": "42000.0024",
        "high": "18245.44",
        "low": "10.69"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketTicker
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelTradingId

Trades (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28Trades%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28Trades%29

Trades websocket data

Subscribe message format

{
    "subscribe_trades": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Unsubscribe message format

{
    "unsubscribe_trades": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Example responses

default Response

{
  "message_type": "trades",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "id": 123,
        "price": "6045.37",
        "amount": "0.48216109",
        "time": 1533553731493
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketTrades
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelTradingId

User Activity (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28User%20Activity%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28User%20Activity%29

User Activity websocket data

Subscribe message format

{
    "subscribe_user_activity": {
        "auth_token": "1111111111111111111111111111111111111111"
    }
}
Name Description
auth_token the authentication token, obtained using REST API

Unsubscribe message format

{
    "unsubscribe_user_activity": {}
}

Example responses

default Response

{
  "message_type": "user_activity",
  "payload": {
    "data": [
      {
        "type": "SEND",
        "data": {
          "timestamp": 1635938412032,
          "trading_asset_id": 3,
          "amount": "1.00000000",
          "total": "1.00505000",
          "fee": "0.00505000",
          "transaction_details": "2NE6R1ASZVv9qc6SEyzhqxdQBuvkt4bGsS8",
          "tx_hash": null,
          "account_owner": null
        },
        "id": 3100
      }
    ],
    "count": 1
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebSocketUserActivity
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelWithoutParams

User Broker Orders (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28User%20Broker%20Orders%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28User%20Broker%20Orders%29

User Broker Orders websocket data

Subscribe message format

{
    "subscribe_user_broker_orders": {
        "auth_token": "1111111111111111111111111111111111111111"
    }
}
Name Description
auth_token the authentication token, obtained using REST API

Unsubscribe message format

{
    "unsubscribe_user_broker_orders": {}
}

Example responses

default Response

{
  "message_type": "user_broker_orders",
  "payload": {
    "data": [
      {
        "id": 16575930,
        "customer_offer_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
        "portfolio_id": 1,
        "base_asset_id": 3,
        "quote_asset_id": 2,
        "direction": "BUY",
        "base_asset_amount": "0.5",
        "quote_asset_amount": "10000.00",
        "price": "20000.00",
        "created_at": 1533555163180,
        "status": "NEW"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketUserBrokerOrders
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelWithoutParams

User Orders (Websockets)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28User%20Orders%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28User%20Orders%29

User Orders websocket data

Subscribe message format

{
    "subscribe_user_orders": {
        "auth_token": "1111111111111111111111111111111111111111"
    }
}
Name Description
auth_token the authentication token, obtained using REST API

Unsubscribe message format

{
    "unsubscribe_user_orders": {}
}

Example responses

default Response

{
  "message_type": "user_orders",
  "payload": {
    "data": [
      {
        "id": 16575930,
        "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
        "portfolio_id": 1,
        "trading_pair_id": 1,
        "direction": "BUY",
        "type": "LIMIT",
        "amount": "0.1",
        "remaining_amount": "0.05",
        "price": "100",
        "time_in_force": "GTC",
        "stop_price": null,
        "date": 1533555163180,
        "status": "PARTIALLY_FILLED",
        "trades": [
          {
            "id": 1234,
            "amount": "0.05",
            "price": "100",
            "time": 1533555164180
          }
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketUserOrders
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelWithoutParams

User Trades (Websocket)

Code samples

# You can also use wget
curl -X WS https://trade.blocktrade.com/api/v1/ws/v1/notification%20%28User%20Trades%29 \
  -H 'Accept: application/json'

WS /ws/v1/notification%20%28User%20Trades%29

Websocket data containing trades belonging to the authenticated user.

Subscribe message format

{
    "subscribe_user_trades": {
        "start_time": 1591193080381
    }
}
Name Description
start_time A timestamp in milliseconds. The initial data on the websocket will contain all of the user's trades that happened since then. If not specified, all trades will be present. If you stop listening on the channel and resume from the time of the last trade, you should expect duplicates, due to the fact that we are using nanosecond precision for trade timestamps internally.

Unsubscribe message format

{
    "unsubscribe_user_trades": {}
}

> Example responses

> default Response

```json
[
  {
    "id": 19873,
    "order_id": 23498,
    "trading_pair_id": 1,
    "symbol": "BTC/USD",
    "direction": "SELL",
    "amount": "0.1734811",
    "price": "6048.22",
    "date": 1533543752844,
    "fee_value": "0.000003",
    "trade_value": "1049.25",
    "maker": true
  }
]

Responses

Status Meaning Description Schema
default Default Successfull operation WebsocketUserTrades
unsubscribed Unknown Confirmation of unsubscribing WebsocketUnsubscribedChannelWithoutParams

assets_market_data

getAssetsMarketData

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/assets_market_data \
  -H 'Accept: application/json'

GET /assets_market_data

Get all available trading assets market data

Example responses

200 Response

[
  {
    "id": 0,
    "price": "string",
    "market_cap": "string",
    "decimal_precision": 0,
    "quote_asset_id": 0,
    "hourly_change": "string",
    "daily_change": "string",
    "weekly_change": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [MarketData] false none none
» id integer false none Id of trading asset
» price string false none price in euro for trading asset
» market_cap string false none market cap in euro for trading asset
» decimal_precision integer false none Decimal precision of trading asset to base currency
» quote_asset_id integer false none Id of user base_currency
» hourly_change string false none Percentage of change between current price and price from one hour ago
» daily_change string false none Percentage of change between current price and price from one day ago
» weekly_change string false none Percentage of change between current price and price from one week ago

Redacted Emails

Get Redacted Emails

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/user/redacted-email?type=user_id&values=string \
  -H 'Accept: application/json'

GET /user/redacted-email

Get list of redacted emails by user_id or by referral token

Parameters

Name In Type Required Description
type query string true The type of values in the values list (user_ids or referral tokens).
values query string true List of comma separated user_ids or referral_tokens for which to fetch the redacted emails.

Enumerated Values

Parameter Value
type user_id
type referral_identifier

Example responses

200 Response

[
  "string"
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

campaign registration

Get Campaign Registrations

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/campaigns/registration?campaign_id=0 \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /campaigns/registration

Get data for campaigns the user is registered to

Parameters

Name In Type Required Description
campaign_id query integer true Id of campaign for which to query registrations

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK Successful operation string
403 Forbidden Operation forbidden Error
404 Not Found Not found (means the user is not registered to the campaign with this id) Error

campaigns

Register User For Campaign

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/campaigns/registration \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /campaigns/registration

Register user for campaign

Body parameter

{
  "campaign_id": 0
}

Parameters

Name In Type Required Description
body body object true Data needed to register user to campaign
» campaign_id body integer true none

Example responses

201 Response

"string"

Responses

Status Meaning Description Schema
201 Created Successful operation string
400 Bad Request Bad Request Error
404 Not Found No active campaign with this id Error
503 Service Unavailable Campaigns service unavailble Error

Get Campaigns

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/campaigns \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /campaigns

Get campaigns for user

Example responses

200 Response

{
  "available_campaigns": {
    "id": 0,
    "type": "string",
    "description": "string",
    "conditions": [
      {
        "id": 0,
        "description": "string",
        "settings": "string",
        "condition_type": "string",
        "progress_per_group": {
          "group_id": null,
          "progress_for_group": null,
          "time_when_satisfied": "string"
        }
      }
    ],
    "rewards": [
      {
        "id": 0,
        "description": "string",
        "settings": "string",
        "type": "string"
      }
    ]
  },
  "registered_for_campaigns": [
    {
      "id": 0,
      "type": "string",
      "description": "string",
      "conditions": [
        {
          "id": 0,
          "description": "string",
          "settings": "string",
          "condition_type": "string",
          "progress_per_group": {
            "group_id": null,
            "progress_for_group": null,
            "time_when_satisfied": "string"
          }
        }
      ],
      "rewards": [
        {
          "id": 0,
          "description": "string",
          "settings": "string",
          "type": "string"
        }
      ],
      "obtained_rewards": [
        {
          "campaign_id": 0,
          "group_id": 0,
          "reward_id": 0,
          "created_at": "string"
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» available_campaigns object true none none
»» id integer false none none
»» type string false none none
»» description string false none none
»» conditions [Condition] false none none
»»» id integer true none none
»»» description string true none none
»»» settings string true none none
»»» condition_type string true none none
»»» progress_per_group object true none none
»»»» group_id int true none none
»»»» progress_for_group float true none none
»»»» time_when_satisfied string true none none
»»» rewards [Reward] false none none
»»»» id integer true none none
»»»» description string true none none
»»»» settings string true none none
»»»» type string true none none
»»» registered_for_campaigns [object] true none none
»»»» id integer true none none
»»»» type string true none none
»»»» description string true none none
»»»» conditions [Condition] true none none
»»»» rewards [Reward] true none none
»»»» obtained_rewards [object] true none none
»»»»» campaign_id integer true none none
»»»»» group_id integer true none none
»»»»» reward_id integer true none none
»»»»» created_at string true none none

Schemas

AccountType

"INDIVIDUAL"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous INDIVIDUAL
anonymous COMPANY

FeeType

{
  "TRADING": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_CREDIT_CARD": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_OUTSIDE_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT_OUTSIDE_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "MINER_FEE": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "BROKER_EXCHANGE_TRADING": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  }
}

Properties

Name Type Required Restrictions Description
TRADING Fee false none none
TRANSFER_IN_CREDIT_CARD Fee false none none
TRANSFER_IN_SEPA Fee false none none
TRANSFER_IN_OUTSIDE_SEPA Fee false none none
TRANSFER_OUT_SEPA Fee false none none
TRANSFER_OUT_OUTSIDE_SEPA Fee false none none
MINER_FEE Fee false none none
TRANSFER_OUT Fee false none none
BROKER_EXCHANGE_TRADING Fee false none none

Fee

{
  "<trading_asset_id> or `default`": {
    "min_fee": "0",
    "percent_value": "0"
  }
}

Properties

Name Type Required Restrictions Description
<trading_asset_id> or default object false none trading_asset_id or default
» min_fee string|null false none none
» percent_value string|null false none none

UiTheme

"LIGHT"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous LIGHT
anonymous DARK

User

{
  "user_id": 952,
  "email": "[email protected]",
  "primary_currency": {
    "id": 2,
    "name": "EUR"
  },
  "kyc_status": "OK",
  "websocket_auth_token": "1111111111111111111111111111111111111111",
  "is_2fa_enabled": true,
  "first_name": "FirstName",
  "last_name": "LastName",
  "gender": "Mal",
  "date_of_birth": 648345600000,
  "place_of_birth": "SomeCity",
  "address": "SomeAddress",
  "postal_code": 1234,
  "city": "SomeCity",
  "state": "SomeState",
  "country": "SomeCountry",
  "phone_number": "+1 123 456",
  "aml_required": true,
  "account_type": "INDIVIDUAL",
  "legal_type": "None",
  "instant_exchange_enabled": false,
  "ui_theme": "LIGHT"
}

Properties

Name Type Required Restrictions Description
user_id integer false none none
email string false none none
primary_currency TradingAssetAsPrimary false none none
kyc_status string false none none
websocket_auth_token string false none none
is_2fa_enabled boolean false none none
first_name string|null false none none
last_name string|null false none none
gender string|null false none none
date_of_birth integer|null false none UTC timestamp of the date of birth in the midnight of this day, in milliseconds
place_of_birth string|null false none none
address string|null false none none
postal_code string|null false none none
city string|null false none none
state string|null false none none
country string|null false none none
phone_number string|null false none none
aml_required boolean false none none
account_type AccountType|null false none none
legal_type string|null false none none
instant_exchange_enabled boolean false none none
ui_theme UiTheme false none none

Enumerated Values

Property Value
kyc_status NOT_VERIFIED
kyc_status PENDING
kyc_status RESUBMIT
kyc_status OK
kyc_status REJECTED

FiatWithdrawals

[
  {
    "id": 0,
    "customer_id": 0,
    "status": "PENDING",
    "type": "SEPA",
    "bank_account": {
      "id": "string",
      "iban": "string",
      "bic": "string",
      "display_name": "string",
      "status": "NEW"
    },
    "iso_code": "EUR",
    "amount": "string",
    "fee": "string",
    "created_at": 0,
    "modified_at": 0
  }
]

Properties

Name Type Required Restrictions Description
anonymous [FiatWithdrawalDetails] false none none

FiatWithdrawalDetails

{
  "id": 0,
  "customer_id": 0,
  "status": "PENDING",
  "type": "SEPA",
  "bank_account": {
    "id": "string",
    "iban": "string",
    "bic": "string",
    "display_name": "string",
    "status": "NEW"
  },
  "iso_code": "EUR",
  "amount": "string",
  "fee": "string",
  "created_at": 0,
  "modified_at": 0
}

Properties

Name Type Required Restrictions Description
id integer false none ID of fiat withdrawal
customer_id integer false none none
status string false none none
type string false none none
bank_account BankAccountData false none none
iso_code string false none none
amount string false none Amount of withdrawal, number as string
fee string false none Withdrawal fee, number as string
created_at integer false none UTC timestamp, in milliseconds
modified_at integer false none UTC timestamp, in milliseconds

Enumerated Values

Property Value
status PENDING
status FAILED
status EXPORTED
status COMPLETED
status DECLINED
status CHECKED
type SEPA
iso_code EUR

BankAccountData

{
  "id": "string",
  "iban": "string",
  "bic": "string",
  "display_name": "string",
  "status": "NEW"
}

Properties

Name Type Required Restrictions Description
id string false none Unique ID of bank account in system (UUID format)
iban string false none Bank account's IBAN (International Bank Account Number)
bic string false none Bank account's BIC (Bank Identification Number)
display_name string false none Bank account's display name
status string false none none

Enumerated Values

Property Value
status NEW
status UNKNOWN
status VERIFIED
status DECLINED

TradingAssetAsPrimary

{
  "id": 2,
  "name": "EUR"
}

Properties

Name Type Required Restrictions Description
id integer false none none
name string false none none

TradingAsset

{
  "id": 2,
  "full_name": "Euro",
  "iso_code": "EUR",
  "icon_path": "/media/eur.svg",
  "icon_path_png": "/media/eur.png",
  "color": "#3A61AD",
  "sign": "€",
  "currency_type": "FIAT",
  "minimal_withdrawal_amount": "0.01",
  "minimal_order_value": "0.1",
  "maximum_order_value": 620000,
  "decimal_precision": 2,
  "lot_size": "0.1",
  "deposit_methods": "WALLET_ADDRESS",
  "is_restricted_for_user": true,
  "tags": "NEW",
  "is_favourite": true
}

Properties

Name Type Required Restrictions Description
id integer false none none
full_name string false none none
iso_code string false none none
icon_path string false none none
icon_path_png string false none none
color string false none none
sign string|null false none none
currency_type string false none Currency type
minimal_withdrawal_amount string false none none
minimal_order_value string false none none
maximum_order_value string false none none
decimal_precision integer false none none
lot_size string false none none
deposit_methods [string] false none none
is_restricted_for_user boolean false none none
tags [string] false none none
is_favourite boolean false none none

Enumerated Values

Property Value
currency_type FIAT
currency_type CRYPTOCURRENCY
deposit_methods WALLET_ADDRESS
deposit_methods CLEAR_JUNCTION_SEPA
tags NEW
tags FEATURED
tags OTHER_CUSTOM_TAGS

MarketData

{
  "id": 0,
  "price": "string",
  "market_cap": "string",
  "decimal_precision": 0,
  "quote_asset_id": 0,
  "hourly_change": "string",
  "daily_change": "string",
  "weekly_change": "string"
}

Properties

Name Type Required Restrictions Description
id integer false none Id of trading asset
price string false none price in euro for trading asset
market_cap string false none market cap in euro for trading asset
decimal_precision integer false none Decimal precision of trading asset to base currency
quote_asset_id integer false none Id of user base_currency
hourly_change string false none Percentage of change between current price and price from one hour ago
daily_change string false none Percentage of change between current price and price from one day ago
weekly_change string false none Percentage of change between current price and price from one week ago

TradingPair

{
  "id": 1,
  "base_asset_id": 3,
  "quote_asset_id": 2,
  "decimal_precision": 2,
  "lot_size": "0.01",
  "tick_size": "0.00001",
  "restricted_directions_for_user": [
    "BUY"
  ]
}

Properties

Name Type Required Restrictions Description
id integer false none none
base_asset_id integer false none none
quote_asset_id integer false none none
decimal_precision integer false none none
lot_size string false none Lot size of the base trading asset
tick_size string false none none
restricted_directions_for_user [string] false none none

Portfolio

{
  "id": 916,
  "assets": [
    {
      "trading_asset_id": 2,
      "available_amount": "24990.00",
      "reserved_amount": "24990.00",
      "locked_amount": "24990.00",
      "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
    }
  ]
}

Properties

Name Type Required Restrictions Description
id integer false none none
assets [PortfolioAsset] false none none

PortfolioAsset

{
  "trading_asset_id": 2,
  "available_amount": "24990.00",
  "reserved_amount": "24990.00",
  "locked_amount": "24990.00",
  "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
}

Properties

Name Type Required Restrictions Description
trading_asset_id integer false none none
available_amount string false none none
reserved_amount string false none none
locked_amount string false none none
wallet_address string|null false none none

NewOrderRequest

{
  "portfolio_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "trading_pair_id": 1,
  "amount": "0.1",
  "price": 1000,
  "time_in_force": "GTC",
  "stop_price": null
}

Properties

Name Type Required Restrictions Description
portfolio_id integer true none ID of portfolio
direction string true none none
type string true none none
trading_pair_id integer true none Trading pair id
amount string true none Amount of asset, number as string
price string false none Price for one unit of asset, number as string
time_in_force string false none none
stop_price string false none Order stop price, number as string

Enumerated Values

Property Value
direction BUY
direction SELL
type LIMIT
type MARKET
time_in_force GTC

NewCustomerOrderRequest

{
  "customer_order_id": 1,
  "portfolio_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "trading_pair_id": 1,
  "amount": "0.1",
  "price": 1000,
  "time_in_force": "GTC",
  "stop_price": null
}

Properties

Name Type Required Restrictions Description
customer_order_id string true none ID of customer order
portfolio_id integer true none ID of portfolio
direction string true none none
type string true none none
trading_pair_id integer true none Trading pair id
amount string true none Amount of asset, number as string
price string false none Price for one unit of asset, number as string
time_in_force string false none none
stop_price string false none Order stop price, number as string

Enumerated Values

Property Value
direction BUY
direction SELL
type LIMIT
type MARKET
time_in_force GTC

NewlyPlacedOrder

{
  "id": 16342774,
  "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3"
}

Properties

Name Type Required Restrictions Description
id integer false none none
customer_order_id string false none none

UserOrders

{
  "data": [
    {
      "id": 14804210,
      "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
      "portfolio_id": 1,
      "trading_pair_id": 1,
      "direction": "BUY",
      "type": "LIMIT",
      "amount": "0.2",
      "remaining_amount": "0.1",
      "price": "6048.22",
      "time_in_force": "GTC",
      "stop_price": null,
      "date": 1533456985351,
      "status": "PARTIALLY_FILLED",
      "trades": [
        {
          "id": 1234,
          "value": "0.1",
          "price": "6048.22",
          "time": 1533543752844
        }
      ]
    }
  ],
  "count": 2,
  "offset": 0,
  "limit": 10
}

Properties

Name Type Required Restrictions Description
data [UserOrder] false none none
count integer false none Number of all orders
offset integer false none Offset of orders to start from
limit integer false none Number of orders per page

UserOrder

{
  "id": 14804210,
  "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
  "portfolio_id": 1,
  "trading_pair_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "amount": "0.2",
  "remaining_amount": "0.1",
  "price": "6048.22",
  "time_in_force": "GTC",
  "stop_price": null,
  "date": 1533456985351,
  "status": "PARTIALLY_FILLED",
  "trades": [
    {
      "id": 1234,
      "value": "0.1",
      "price": "6048.22",
      "time": 1533543752844
    }
  ]
}

Properties

Name Type Required Restrictions Description
id integer false none none
customer_order_id string false none none
portfolio_id integer false none none
trading_pair_id integer false none none
direction string false none none
type string false none none
amount string false none none
remaining_amount string false none none
price string false none Price for one unit of asset
time_in_force string false none none
stop_price string false none Order stop price, number as string
date integer false none UTC timestamp of the last change, in milliseconds
status string false none none
trades [OrderTrade] false none none

Enumerated Values

Property Value
direction BUY
direction SELL
type LIMIT
type MARKET
time_in_force GTC
status NEW
status PARTIALLY_FILLED
status FILLED
status CANCELLED

OrderTrade

{
  "id": 1234,
  "value": "0.1",
  "price": "6048.22",
  "time": 1533543752844
}

Properties

Name Type Required Restrictions Description
id integer false none none
value string false none Amount of traded assets, number as string
price string false none Price for one unit of asset
time integer false none UTC timestamp of trade, in milliseconds

UserBankAccounts

{
  "bank_accounts": [
    {
      "id": "string",
      "iban": "string",
      "bic": "string",
      "display_name": "string",
      "status": "NEW"
    }
  ],
  "ref_number": "string",
  "send_to_data": {
    "account_holder": "string",
    "payment_provider": "string",
    "iban": "string",
    "bic": "string"
  }
}

Properties

Name Type Required Restrictions Description
bank_accounts [BankAccountData] false none none
ref_number string false none Reference number that user should include in incoming FIAT transfer
send_to_data SendToData false none none

SendToData

{
  "account_holder": "string",
  "payment_provider": "string",
  "iban": "string",
  "bic": "string"
}

Properties

Name Type Required Restrictions Description
account_holder string false none Address data of ETR AG
payment_provider string false none Address data of payment provider
iban string false none IBAN number of Blocktrade bank account
bic string false none BIC code of payment provider

AllTrades

{
  "data": [
    {
      "id": 12834779,
      "order_id": 16329236,
      "matched_order_id": 16284185,
      "trading_pair_id": 1,
      "symbol": "BTC/USD",
      "direction": "SELL",
      "amount": "0.1734811",
      "price": "6048.22",
      "date": 1533543752844
    }
  ],
  "count": 1293512,
  "offset": 0,
  "limit": 10
}

Properties

Name Type Required Restrictions Description
data [Trade] false none none
count integer false none Number of all trades
offset integer false none Offset of trades to start from
limit integer false none Number of trades per page

Trade

{
  "id": 12834779,
  "order_id": 16329236,
  "matched_order_id": 16284185,
  "trading_pair_id": 1,
  "symbol": "BTC/USD",
  "direction": "SELL",
  "amount": "0.1734811",
  "price": "6048.22",
  "date": 1533543752844
}

Properties

Name Type Required Restrictions Description
id integer false none none
order_id integer false none none
matched_order_id integer false none none
trading_pair_id integer false none none
symbol string false none Base asset iso code / quote asset iso code
direction string false none none
amount string false none none
price string false none Price for one unit of asset
date integer false none UTC timestamp of the trade, in milliseconds

Enumerated Values

Property Value
direction BUY
direction SELL

UserTrades

{
  "data": [
    {
      "id": 19873,
      "order_id": 23498,
      "trading_pair_id": 1,
      "symbol": "BTC/USD",
      "direction": "SELL",
      "amount": "0.1734811",
      "price": "6048.22",
      "date": 1533543752844,
      "fee_value": "0.000003",
      "trade_value": "1049.25",
      "maker": true
    }
  ],
  "count": 1234
}

Properties

Name Type Required Restrictions Description
data [UserTrade] false none none
count integer false none Number of all trades

WebsocketUserTrades

[
  {
    "id": 19873,
    "order_id": 23498,
    "trading_pair_id": 1,
    "symbol": "BTC/USD",
    "direction": "SELL",
    "amount": "0.1734811",
    "price": "6048.22",
    "date": 1533543752844,
    "fee_value": "0.000003",
    "trade_value": "1049.25",
    "maker": true
  }
]

Properties

Name Type Required Restrictions Description
anonymous [UserTrade] false none none

UserTrade

{
  "id": 19873,
  "order_id": 23498,
  "trading_pair_id": 1,
  "symbol": "BTC/USD",
  "direction": "SELL",
  "amount": "0.1734811",
  "price": "6048.22",
  "date": 1533543752844,
  "fee_value": "0.000003",
  "trade_value": "1049.25",
  "maker": true
}

Properties

Name Type Required Restrictions Description
id integer false none none
order_id integer false none none
trading_pair_id integer false none none
symbol string false none Base asset iso code / quote asset iso code
direction string false none none
amount string false none none
price string false none Price for one unit of asset
date integer false none UTC timestamp of the trade, in milliseconds
fee_value string false none The fee related to the trade
trade_value string false none The final value of the trade in the quote asset without fees.
maker boolean false none True if the authenticated user is the maker of this trade, false if he is the taker.

Enumerated Values

Property Value
direction BUY
direction SELL

Ticker

{
  "last_price": "6039.3",
  "bid_price": "6050.17",
  "ask_price": "6056.77",
  "volume": "42000.0024",
  "low": "5999.74",
  "high": "6200.76"
}

Properties

Name Type Required Restrictions Description
last_price string|null false none Number as string
bid_price string|null false none Number as string
ask_price string|null false none Number as string
volume string false none 24h trailing volume; number as string
low string|null false none 24h trailing low; number as string
high string|null false none 24h trailing high; number as string

OrderBook

{
  "asks": [
    {
      "amount": "2.20535071",
      "price": "6140.11",
      "value": "13541.09"
    }
  ],
  "bids": [
    {
      "amount": "2.20535071",
      "price": "6140.11",
      "value": "13541.09"
    }
  ]
}

Properties

Name Type Required Restrictions Description
asks [Order] false none none
bids [Order] false none none

Order

{
  "amount": "2.20535071",
  "price": "6140.11",
  "value": "13541.09"
}

Properties

Name Type Required Restrictions Description
amount string false none Number as string
price string false none Number as string
value string false none Number as string

Error

{
  "message": "Error message"
}

Properties

Name Type Required Restrictions Description
message string false none none

RoundingPolicy

{
  "BUY_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
  "SELL_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
  "PORTFOLIO_TOTAL_VALUE": "ROUNDING_DOWN",
  "SERVICE_VALUE": "ROUNDING_DOWN",
  "MINER_FEE": "ROUNDING_DOWN",
  "TRADING": "ROUNDING_DOWN",
  "TRANSFER_IN_CREDIT_CARD": "ROUNDING_DOWN",
  "TRANSFER_IN_SEPA": "ROUNDING_DOWN",
  "TRANSFER_IN_OUTSIDE_SEPA": "ROUNDING_DOWN",
  "TRANSFER_OUT": "ROUNDING_DOWN",
  "TRANSFER_OUT_SEPA": "ROUNDING_DOWN",
  "TRANSFER_OUT_OUTSIDE_SEPA": "ROUNDING_DOWN",
  "BROKER_EXCHANGE_TRADING": "ROUNDING_DOWN"
}

Properties

Name Type Required Restrictions Description
BUY_ORDER_TOTAL_VALUE string false none none
SELL_ORDER_TOTAL_VALUE string false none none
PORTFOLIO_TOTAL_VALUE string false none none
SERVICE_VALUE string false none none
MINER_FEE string false none none
TRADING string false none none
TRANSFER_IN_CREDIT_CARD string false none none
TRANSFER_IN_SEPA string false none none
TRANSFER_IN_OUTSIDE_SEPA string false none none
TRANSFER_OUT string false none none
TRANSFER_OUT_SEPA string false none none
TRANSFER_OUT_OUTSIDE_SEPA string false none none
BROKER_EXCHANGE_TRADING string false none none

Enumerated Values

Property Value
BUY_ORDER_TOTAL_VALUE ROUNDING_DOWN
BUY_ORDER_TOTAL_VALUE ROUNDING_HALF_DOWN
BUY_ORDER_TOTAL_VALUE ROUNDING_HALF_UP
BUY_ORDER_TOTAL_VALUE ROUNDING_UP
SELL_ORDER_TOTAL_VALUE ROUNDING_DOWN
SELL_ORDER_TOTAL_VALUE ROUNDING_HALF_DOWN
SELL_ORDER_TOTAL_VALUE ROUNDING_HALF_UP
SELL_ORDER_TOTAL_VALUE ROUNDING_UP
PORTFOLIO_TOTAL_VALUE ROUNDING_DOWN
PORTFOLIO_TOTAL_VALUE ROUNDING_HALF_DOWN
PORTFOLIO_TOTAL_VALUE ROUNDING_HALF_UP
PORTFOLIO_TOTAL_VALUE ROUNDING_UP
SERVICE_VALUE ROUNDING_DOWN
SERVICE_VALUE ROUNDING_HALF_DOWN
SERVICE_VALUE ROUNDING_HALF_UP
SERVICE_VALUE ROUNDING_UP
MINER_FEE ROUNDING_DOWN
MINER_FEE ROUNDING_HALF_DOWN
MINER_FEE ROUNDING_HALF_UP
MINER_FEE ROUNDING_UP
TRADING ROUNDING_DOWN
TRADING ROUNDING_HALF_DOWN
TRADING ROUNDING_HALF_UP
TRADING ROUNDING_UP
TRANSFER_IN_CREDIT_CARD ROUNDING_DOWN
TRANSFER_IN_CREDIT_CARD ROUNDING_HALF_DOWN
TRANSFER_IN_CREDIT_CARD ROUNDING_HALF_UP
TRANSFER_IN_CREDIT_CARD ROUNDING_UP
TRANSFER_IN_SEPA ROUNDING_DOWN
TRANSFER_IN_SEPA ROUNDING_HALF_DOWN
TRANSFER_IN_SEPA ROUNDING_HALF_UP
TRANSFER_IN_SEPA ROUNDING_UP
TRANSFER_IN_OUTSIDE_SEPA ROUNDING_DOWN
TRANSFER_IN_OUTSIDE_SEPA ROUNDING_HALF_DOWN
TRANSFER_IN_OUTSIDE_SEPA ROUNDING_HALF_UP
TRANSFER_IN_OUTSIDE_SEPA ROUNDING_UP
TRANSFER_OUT ROUNDING_DOWN
TRANSFER_OUT ROUNDING_HALF_DOWN
TRANSFER_OUT ROUNDING_HALF_UP
TRANSFER_OUT ROUNDING_UP
TRANSFER_OUT_SEPA ROUNDING_DOWN
TRANSFER_OUT_SEPA ROUNDING_HALF_DOWN
TRANSFER_OUT_SEPA ROUNDING_HALF_UP
TRANSFER_OUT_SEPA ROUNDING_UP
TRANSFER_OUT_OUTSIDE_SEPA ROUNDING_DOWN
TRANSFER_OUT_OUTSIDE_SEPA ROUNDING_HALF_DOWN
TRANSFER_OUT_OUTSIDE_SEPA ROUNDING_HALF_UP
TRANSFER_OUT_OUTSIDE_SEPA ROUNDING_UP
BROKER_EXCHANGE_TRADING ROUNDING_DOWN
BROKER_EXCHANGE_TRADING ROUNDING_HALF_DOWN
BROKER_EXCHANGE_TRADING ROUNDING_HALF_UP
BROKER_EXCHANGE_TRADING ROUNDING_UP

Features

{
  "ask_for_account_type": true,
  "disable_deposit_and_withdraw": true,
  "disable_kyc_verification": true,
  "disable_fill_or_kill": true,
  "disable_stop_order": true,
  "referrer_campaign": true,
  "show_beta_icons": true,
  "subscriptions": true,
  "instant_exchange_is_enabled": true
}

Properties

Name Type Required Restrictions Description
ask_for_account_type boolean false none none
disable_deposit_and_withdraw boolean false none none
disable_kyc_verification boolean false none none
disable_fill_or_kill boolean false none none
disable_stop_order boolean false none none
referrer_campaign boolean false none none
show_beta_icons boolean false none none
subscriptions boolean false none none
instant_exchange_is_enabled boolean false none none

Settings

{
  "rounding_policy": {
    "BUY_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
    "SELL_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
    "PORTFOLIO_TOTAL_VALUE": "ROUNDING_DOWN",
    "SERVICE_VALUE": "ROUNDING_DOWN",
    "MINER_FEE": "ROUNDING_DOWN",
    "TRADING": "ROUNDING_DOWN",
    "TRANSFER_IN_CREDIT_CARD": "ROUNDING_DOWN",
    "TRANSFER_IN_SEPA": "ROUNDING_DOWN",
    "TRANSFER_IN_OUTSIDE_SEPA": "ROUNDING_DOWN",
    "TRANSFER_OUT": "ROUNDING_DOWN",
    "TRANSFER_OUT_SEPA": "ROUNDING_DOWN",
    "TRANSFER_OUT_OUTSIDE_SEPA": "ROUNDING_DOWN",
    "BROKER_EXCHANGE_TRADING": "ROUNDING_DOWN"
  },
  "features": {
    "ask_for_account_type": true,
    "disable_deposit_and_withdraw": true,
    "disable_kyc_verification": true,
    "disable_fill_or_kill": true,
    "disable_stop_order": true,
    "referrer_campaign": true,
    "show_beta_icons": true,
    "subscriptions": true,
    "instant_exchange_is_enabled": true
  },
  "external": {
    "analytics": {
      "GoogleAnalytics": {
        "tracking_id": "string",
        "gtag_id": "string"
      },
      "Smartlook": {
        "site_key": "string",
        "region": "string"
      },
      "Hotjar": {
        "hjid": 0,
        "hjsv": 0
      },
      "Facebook": {
        "pixel_id": "string"
      }
    },
    "checkout": null,
    "freshchat": {
      "token": "string"
    },
    "hcaptcha": {
      "site_key": "string"
    },
    "recaptcha": {
      "site_key": "string"
    },
    "recaptcha_ios": {
      "site_key": "string"
    }
  }
}

Properties

Name Type Required Restrictions Description
rounding_policy RoundingPolicy false none none
features Features false none none
external ExternalSettings false none none

ExternalSettings

{
  "analytics": {
    "GoogleAnalytics": {
      "tracking_id": "string",
      "gtag_id": "string"
    },
    "Smartlook": {
      "site_key": "string",
      "region": "string"
    },
    "Hotjar": {
      "hjid": 0,
      "hjsv": 0
    },
    "Facebook": {
      "pixel_id": "string"
    }
  },
  "checkout": null,
  "freshchat": {
    "token": "string"
  },
  "hcaptcha": {
    "site_key": "string"
  },
  "recaptcha": {
    "site_key": "string"
  },
  "recaptcha_ios": {
    "site_key": "string"
  }
}

Properties

Name Type Required Restrictions Description
analytics Analytics false none none
checkout Checkout false none none
freshchat object false none none
» token string false none none
hcaptcha Captcha false none none
recaptcha Captcha false none none
recaptcha_ios Captcha false none none

Analytics

{
  "GoogleAnalytics": {
    "tracking_id": "string",
    "gtag_id": "string"
  },
  "Smartlook": {
    "site_key": "string",
    "region": "string"
  },
  "Hotjar": {
    "hjid": 0,
    "hjsv": 0
  },
  "Facebook": {
    "pixel_id": "string"
  }
}

Properties

Name Type Required Restrictions Description
GoogleAnalytics object false none none
» tracking_id string false none none
» gtag_id string false none none
Smartlook object false none none
» site_key string false none none
» region string false none none
Hotjar object false none none
» hjid integer false none none
» hjsv integer false none none
Facebook object false none none
» pixel_id string false none none

Captcha

{
  "site_key": "string"
}

Properties

Name Type Required Restrictions Description
site_key string false none none

WebsocketOHLCV

{
  "message_type": "ohlcv",
  "payload": {
    "trading_pair_id": 1,
    "source": "INTERNAL",
    "resolution": 86400,
    "oldest_available_data_point": 1532476800000,
    "data": [
      {
        "date": 1533513600000,
        "close": "6042.32",
        "volume": "408815169.35",
        "open": "6073.9",
        "high": "6167.15",
        "low": "6011.3"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none ohlcv
payload object false none none
» trading_pair_id integer false none Id of trading pair
» source string false none none
» resolution integer false none resolution
» oldest_available_data_point integer false none Oldest available data point
» data [object] false none none
»» date integer false none UTC timestamp of the trade, in milliseconds
»» close string false none none
»» volume string false none none
»» open string false none none
»» high string false none none
»» low string false none none

Enumerated Values

Property Value
source INTERNAL
source EXTERNAL

WebsocketLineChart

{
  "message_type": "line",
  "payload": {
    "trading_pair_id": 1,
    "resolution": 86400,
    "source": "INTERNAL",
    "dailyChange": "155.85",
    "dailyHigh": "6167.15",
    "dailyLow": "6011.3",
    "dailyVolume": "418693670.8",
    "data": [
      {
        "date": 1533513600000,
        "value": "6045.34"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none line
payload object false none none
» trading_pair_id integer false none none
» resolution integer false none none
» source string false none none
» dailyChange string false none none
» dailyHigh string false none none
» dailyLow string false none none
» dailyVolume string false none none
» data [object] false none none
»» date integer false none UTC timestamp of the trade, in milliseconds
»» value string false none none

Enumerated Values

Property Value
source INTERNAL
source EXTERNAL

WebsocketOrderBook

{
  "message_type": "order_book",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "bids": [
          {
            "price": "6043.23",
            "amount": "2.5510545",
            "value": "15417.19"
          }
        ],
        "asks": [
          {
            "price": "6044.1",
            "amount": "4.81763208",
            "value": "29118.25"
          }
        ]
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none order_book
payload object false none none
» trading_pair_id integer false none Trading pair id
» data [object] false none none
»» bids [object] false none none
»»» price string false none none
»»» amount string false none none
»»» value string false none none
»» asks [object] false none none
»»» price string false none none
»»» amount string false none none
»»» value string false none none

WebsocketUnsubscribedChartChannel

{
  "message_type": "unsubscribed",
  "payload": {
    "channel_name": "order_book",
    "parameters": {
      "trading_pair_id": 1,
      "resolution": 86400,
      "source": "INTERNAL"
    }
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none Confirmation of unsubscribing
payload object false none none
» channel_name string false none Channel name
» parameters object false none Subscription parameters
»» trading_pair_id integer false none none
»» resolution integer false none none
»» source string false none none

WebsocketUnsubscribedChannelTradingId

{
  "message_type": "unsubscribed",
  "payload": {
    "channel_name": "order_book",
    "parameters": {
      "trading_pair_id": 1
    }
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none Confirmation of unsubscribing
payload object false none none
» channel_name string false none Channel name
» parameters object false none Subscription parameters
»» trading_pair_id integer false none Trading pair id

WebsocketUnsubscribedChannelWithoutParams

{
  "message_type": "unsubscribed",
  "payload": {
    "channel_name": "order_book"
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none Confirmation of unsubscribing
payload object false none none
» channel_name string false none Channel name

WebsocketTrades

{
  "message_type": "trades",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "id": 123,
        "price": "6045.37",
        "amount": "0.48216109",
        "time": 1533553731493
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none trades
payload object false none none
» trading_pair_id integer false none Trading pair id
» data [object] false none none
»» id integer false none The id of the trade
»» price string false none none
»» amount string false none none
»» time integer false none none

WebsocketTicker

{
  "message_type": "ticker",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "ask_price": "6045.72",
        "bid_price": "6044.69",
        "last_price": "6045.72",
        "volume": "42000.0024",
        "high": "18245.44",
        "low": "10.69"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none ticker
payload object false none none
» trading_pair_id integer false none Trading pair id
» data [object] false none none
»» ask_price string|null false none none
»» bid_price string|null false none none
»» last_price string|null false none none
»» volume string false none 24h volume
»» high string|null false none none
»» low string|null false none none

WebsocketPortfolio

{
  "message_type": "portfolio",
  "payload": {
    "data": [
      {
        "id": 916,
        "assets": [
          {
            "trading_asset_id": 2,
            "available_amount": "24990.00",
            "reserved_amount": "24990.00",
            "locked_amount": "24990.00",
            "wallet_address": "11111111-1111-1111-1111-111111111111"
          }
        ]
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none portfolio
payload object false none none
» data [object] false none none
»» id integer false none Trading pair id
»» assets [object] false none none
»»» trading_asset_id integer false none none
»»» available_amount string false none none
»»» reserved_amount string false none none
»»» locked_amount string false none none
»»» wallet_address string false none this value is optional

WebsocketUserBrokerOrders

{
  "message_type": "user_broker_orders",
  "payload": {
    "data": [
      {
        "id": 16575930,
        "customer_offer_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
        "portfolio_id": 1,
        "base_asset_id": 3,
        "quote_asset_id": 2,
        "direction": "BUY",
        "base_asset_amount": "0.5",
        "quote_asset_amount": "10000.00",
        "price": "20000.00",
        "created_at": 1533555163180,
        "status": "NEW"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none user_broker_orders
payload object false none none
» data [object] false none none
»» id integer false none none
»» customer_offer_id string false none none
»» portfolio_id integer false none none
»» base_asset_id integer false none none
»» quote_asset_id integer false none none
»» direction string false none none
»» base_asset_amount string false none none
»» quote_asset_amount string false none none
»» price string false none This is price rounded to quote asset decimal precision. Calculate quote_asset_amount/base_asset_amount yourself to get precise price
»» created_at integer false none UTC timestamp when order was placed, in milliseconds
»» status string false none none

WebsocketUserOrders

{
  "message_type": "user_orders",
  "payload": {
    "data": [
      {
        "id": 16575930,
        "customer_order_id": "04e4bf8e-0a0f-4026-9eef-0906813225f3",
        "portfolio_id": 1,
        "trading_pair_id": 1,
        "direction": "BUY",
        "type": "LIMIT",
        "amount": "0.1",
        "remaining_amount": "0.05",
        "price": "100",
        "time_in_force": "GTC",
        "stop_price": null,
        "date": 1533555163180,
        "status": "PARTIALLY_FILLED",
        "trades": [
          {
            "id": 1234,
            "amount": "0.05",
            "price": "100",
            "time": 1533555164180
          }
        ]
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none user_orders
payload object false none none
» data [object] false none none
»» id integer false none none
»» customer_order_id string false none none
»» portfolio_id integer false none none
»» trading_pair_id integer false none none
»» direction string false none none
»» type string false none none
»» amount string false none none
»» remaining_amount string false none none
»» price string false none none
»» time_in_force string|null false none none
»» stop_price string|null false none none
»» date integer false none UTC timestamp of the trade, in milliseconds
»» status string false none none
»» trades [object] false none none
»»» id integer false none none
»»» amount string false none Amount of traded assets, number as string
»»» price string false none Price for one unit of asset
»»» time integer false none UTC timestamp of trade, in milliseconds

WebsocketExchangeRates

[
  {
    "quote_trading_asset_id": 2,
    "base_trading_asset_id": 3,
    "created_at": 1585219721,
    "rate": "6555.45"
  }
]

Properties

Name Type Required Restrictions Description
quote_trading_asset_id integer false none none
base_trading_asset_id integer false none none
created_at integer false none none
rate string false none none

WebSocketUserActivity

{
  "message_type": "user_activity",
  "payload": {
    "data": [
      {
        "type": "SEND",
        "data": {
          "timestamp": 1635938412032,
          "trading_asset_id": 3,
          "amount": "1.00000000",
          "total": "1.00505000",
          "fee": "0.00505000",
          "transaction_details": "2NE6R1ASZVv9qc6SEyzhqxdQBuvkt4bGsS8",
          "tx_hash": null,
          "account_owner": null
        },
        "id": 3100
      }
    ],
    "count": 1
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none user_activity
payload object false none none
» data [object] false none none
»» type string false none One of SEND, WITHDRAWAL_RETURN or DEPOSIT
»» data object false none none
»»» timestamp integer false none UTC timestamp of activity, in milliseconds
»»» trading_asset_id integer false none none
»»» amount string false none none
»»» total string false none none
»»» fee string false none none
»»» transaction_details string|null false none none
»»» tx_hash string|null false none none
»»» account_owner string|null false none none
»» id integer false none none
» count integer false none none

TradingPairId

{
  "trading_pair_id": 0
}

Properties

Name Type Required Restrictions Description
trading_pair_id integer true none ID of trading pair

Condition

{
  "id": 0,
  "description": "string",
  "settings": "string",
  "condition_type": "string",
  "progress_per_group": {
    "group_id": null,
    "progress_for_group": null,
    "time_when_satisfied": "string"
  }
}

Properties

Name Type Required Restrictions Description
id integer true none none
description string true none none
settings string true none none
condition_type string true none none
progress_per_group object true none none
» group_id int true none none
» progress_for_group float true none none
» time_when_satisfied string true none none

Reward

{
  "id": 0,
  "description": "string",
  "settings": "string",
  "type": "string"
}

Properties

Name Type Required Restrictions Description
id integer true none none
description string true none none
settings string true none none
type string true none none