ABOUT Crosstower API
Crosstower REST & Streaming API version 3.0 provides programmatic access to Crosstower’s next generation trading engine.
We strongly recommend that our new customers use API version 3.0 to get the best trading experience. We also recommend that our current traders switch to the newest version 3.0.
API version 2.0 is still available. For detailed description refer to API v2.
By using the Crosstower API you confirm that you have read and accepted the API License Agreement.
DEVELOPMENT GUIDE
API URLs
API Explorer
You can explore the API using SwaggerUI including methods requiring authorization.
DateTime Format
All timestamps are returned in ISO 8601 format or UNIX timestamp in milliseconds (UTC).
Example: "2021-06-03T10:20:49.315Z"
or "1614815872000"
.
Date Format
Some timestamps are returned in ISO 8601 format which includes a calendar date only.
Example: "2021-06-03"
.
Number Format
All finance data, e.g., price, quantity, fee, etc., should be arbitrary precision numbers and have a string representation.
Example: "10.2000058"
.
Custom Formats
In nested JSON objects, child objects have custom formats which are described in tables below a place of the first occurrence.
Pagination
Parameters:
Parameter | Description |
---|---|
limit | Number of results per call. |
offset | Number of results offset. |
sort | Sort direction. Accepted values: ASC (ascending order), DESC (descending order) |
by | Filter type. Accepted values: id , timestamp |
from | Interval initial value. If filter by timestamp is used, then parameter type is DateTime ; otherwise — Number . |
till | Interval end value. If filter by timestamp is used, then parameter type is DateTime ; otherwise — Number . |
RATE LIMITING
The following Rate Limits are applied:
- for the Market data and other /public requests, the limit is 30 requests per second for one IP;
- for Trading, the limit is 500 requests per second for one user. Trading includes place, replace and cancel order requests;
- for all other requests, the limit is 20 requests per second for one user.
Significantly exceeding the Rate Limits can lead to suspension.
Change Log
31.05.2023
- Added a new
preferred_network
filter inGET /public/currency
endpoint.
19.05.2023
- Added
price/rate/
feeds in WebSocket market data.
18.04.2023
- Added multichain support.
15.11.2022
- Added WebSocket balance feed.
28.07.2022
- Added One-Triggers-Other (OTO) order lists.
16.03.2022
- Added All-Or-None (AON), One-Cancels-Other (OCO), and One-Triggers-One-Cancels-Other (OTOCO) order lists.
27.12.2021
- Added Take-profit orders.
23.11.2021
- Added Prime Trust.
- Added amount locks.
19.11.2021
- Increased rate limits up to 300 requests per second.
10.11.2021
- Added socket request to get single currency trading balance.
- Allowed to view and get trading history for disabled symbols.
- Allowed to get trading history by several comma-separated symbols.
24.08.2021
- Added ability to request Wallet and Trading balance for a single currency.
subscribe_balance
method replaced bysubscribe_wallet_balances
. Response was changed. Changes are backward compatible.- Added
taker
field to trade execution reports both for REST and WS. - Fixed market data subscription acknowledgement wasn't returned is some cases.
- Fixed
unsubscribe
methods on trading subscriptions. - Fixed documentation inaccuracies for REST and WS order models.
30.07.2021
- General documentation fixes.
- Added Sub-accounts section.
28.07.2021
- APIv3 initial release
BEST PRACTICES
The Crosstower API development team strives to bring the best trading experience to API users. This manual contains a set of best practices for using the API as efficiently as possible.
HTTP Persistent Connection
The underlying TCP connection is kept active for multiple requests/responses. Subsequent requests will result in reduced latency as the TCP handshaking process is no longer required.
If you use the HTTP 1.0 client, please ensure it supports the Keep-Alive directive and submit the "Connection: Keep-Alive" header with a request.
Keep-Alive is a part of the HTTP/1.1 or HTTP/2 protocol and enabled by default on compliant clients. However, you will have to ensure your implementation does not set other values as the connection header.
Retrieving and Updating Account State
Use the Streaming API for real-time updates of orders, trades, and any transaction changes.
REST API Reference
HTTP Status Codes
- 200 OK. Successful request
- 400 Bad Request. Returns JSON with the error message
- 401 Unauthorized. Authorization is required or has been failed
- 403 Forbidden. Action is forbidden
- 404 Not Found. Data requested cannot be found
- 429 Too Many Requests. Your connection has been rate limited
- 500 Internal Server. Internal Server Error
- 503 Service Unavailable. Service is down for maintenance
- 504 Gateway Timeout. Request timeout expired
Error Response
{
"error": {
"code": 20001,
"message": "Insufficient funds",
"description": "Check that the funds are sufficient, taken into account the commissions"
}
}
All error responses have error code
and human readable message
fields. Some errors contain an additional description
field.
Market Data
Currencies
Get Currencies
curl "https://api.crosstower.com/api/3/public/currency"
Response:
{
"BTC":
{
"full_name": "test",
"crypto": true,
"payin_enabled": true,
"payout_enabled": true,
"transfer_enabled": true,
"sign": "฿",
"qr_prefix": "bitcointestnet:",
"crypto_payment_id_name": "",
"crypto_explorer": "https://blockchain.info/tx/{tx}",
"precision_transfer": "1",
"delisted": false,
"networks":
[
{
"code": "test123",
"network": "test",
"protocol": "test123",
"default": true,
"is_ens_available": true,
"payin_enabled": true,
"payout_enabled": true,
"precision_payout": "1",
"payout_fee": "0.000000000000",
"payout_is_payment_id": false,
"payin_payment_id": false,
"payin_confirmations": 3
}
]
},
"ETH":
{
"full_name": "Ethereum TST",
"crypto": true,
"payin_enabled": true,
"payout_enabled": true,
"transfer_enabled": true,
"sign": "E",
"qr_prefix": "ethereum:",
"crypto_payment_id_name": "",
"crypto_explorer": "https://www.etherchain.org/tx/{tx}",
"precision_transfer": "0.000000000001",
"delisted": false,
"networks":
[
{
"code": "ETHTEST",
"network": "ETHTEST",
"protocol": "",
"default": true,
"is_ens_available": true,
"payin_enabled": true,
"payout_enabled": true,
"precision_payout": "0.000000000000000001",
"payout_fee": "0.000000000000",
"payout_is_payment_id": false,
"payin_payment_id": false,
"payin_confirmations": 2
}
]
}
}
GET /api/3/public/currency
Returns the actual list of available currencies, tokens, etc.
You can optionally use a comma-separated list of currencies. If it is not provided, null
or empty, the request returns all currencies.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
currencies | String | Optional. Comma-separated list of currency codes. |
preferred_network | String | Optional. Code of the default network for currencies. |
Response:
Name | Type | Description |
---|---|---|
full_name | String | Currency full name (e.g., "Bitcoin" ). |
crypto | Boolean | Flag indicating whether the currency is a cryptocurrency. |
payin_enabled | Boolean | Flag indicating whether generating deposit addresses is allowed for the currency. |
payout_enabled | Boolean | Flag indicating whether withdrawals are allowed for the currency. |
transfer_enabled | Boolean | Flag indicating whether transfers between the bank and the exchange accounts are allowed for the network (may be disabled on maintenance). |
sign | String | Currency sign. |
crypto_payment_id_name | String | The name of an additional account identifier used for the protocol. |
crypto_explorer | String | The link to the currency explorer with "{tx}" placeholder instead of a hash. |
precision_transfer | Number | The minimum amount of a transfer. |
account_top_order | Number | Optional. The absolute position of the currency in the currency list. |
qr_prefix | String | The QR prefix used for indication of the currency in a deposit address. |
delisted | Boolean | Flag indicating whether the currency has been delisted. |
networks | Array of Network | Networks that may host operations on the currency. |
Network model consists of:
Name | Type | Description |
---|---|---|
code | String | Currency code. |
network | String | Code of the currency of the hosting network. |
is_ens_available | Boolean | Flag indicating whether the network supports ENS (Ethereum Name Service). |
protocol | String | Optional. The protocol or the standard powering the network, for example, "ERC20" . |
default | Boolean | Flag indicating whether the network is the default for the currency. |
payin_enabled | Boolean | Flag indicating whether generating deposit addresses is allowed for the network. |
payout_enabled | Boolean | Flag indicating whether withdrawals are allowed for the network. |
precision_payout | Number | The minimum amount of a withdrawal. |
payout_fee | Number | Optional. Default withdrawal fee. |
payout_is_payment_id | Boolean | Flag indicating whether providing additional information for withdrawals is needed. |
payin_payment_id | Boolean | Flag indicating whether providing additional information for deposits is needed. |
payin_confirmations | Number | The number of confirmation needed for a transaction to be accepted in the network. |
address_regex | String | Optional. Regular expression to a deposit address. |
payment_id_regex | String | Optional. Regular expression for a payment identifier. |
low_processing_time | Number | Optional. The lowest processing time in seconds for a withdrawal. |
high_processing_time | Number | Optional. The highest processing time in seconds for a withdrawal. |
avg_processing_time | Number | Optional. The average processing time in seconds for a withdrawal. |
crypto_payment_id_name | String | Optional. Transaction identifier, e.g., comment, message, memo, attachment, etc. |
crypto_explorer | String | Optional. The link to the network explorer with "{tx}" placeholder instead of a hash. |
Get Currency
curl "https://api.crosstower.com/api/3/public/currency/BTC"
Response:
{
"full_name": "test",
"crypto": true,
"payin_enabled": true,
"payout_enabled": true,
"transfer_enabled": true,
"sign": "฿",
"qr_prefix": "bitcointestnet:",
"crypto_payment_id_name": "",
"crypto_explorer": "https://blockchain.info/tx/{tx}",
"precision_transfer": "1",
"delisted": false,
"networks":
[
{
"code": "test123",
"network": "test",
"protocol": "test123",
"default": true,
"is_ens_available": true,
"payin_enabled": true,
"payout_enabled": true,
"precision_payout": "1",
"payout_fee": "0.000000000000",
"payout_is_payment_id": false,
"payin_payment_id": false,
"payin_confirmations": 3
}
]
}
GET /api/3/public/currency/{currency}
Returns the data for a certain currency.
Requires no API key Access Rights.
Response:
Name | Type | Description |
---|---|---|
full_name | String | Currency full name (e.g., "Bitcoin" ). |
crypto | Boolean | Flag indicating whether the currency is a cryptocurrency. |
payin_enabled | Boolean | Flag indicating whether generating deposit addresses is allowed for the currency. |
payout_enabled | Boolean | Flag indicating whether withdrawals are allowed for the currency. |
transfer_enabled | Boolean | Flag indicating whether transfers between the bank and the exchange accounts are allowed for the network (may be disabled on maintenance). |
sign | String | Currency sign. |
crypto_payment_id_name | String | The name of an additional account identifier used for the protocol. |
crypto_explorer | String | The link to the currency explorer with "{tx}" placeholder instead of a hash. |
precision_transfer | Number | The minimum amount of a transfer. |
account_top_order | Number | Optional. The absolute position of the currency in the currency list. |
qr_prefix | String | The QR prefix used for indication of the currency in a deposit address. |
delisted | Boolean | Flag indicating whether the currency has been delisted. |
networks | Array of Network | Networks that may host operations on the currency. |
Symbols
Get Symbols
curl "https://api.crosstower.com/api/3/public/symbol"
Response:
{
"ETHBTC": {
"type": "spot",
"base_currency": "ETH",
"quote_currency": "BTC",
"status": "working",
"quantity_increment": "0.001",
"tick_size": "0.000001",
"take_rate": "0.001",
"make_rate": "-0.0001",
"fee_currency": "BTC"
}
}
GET /api/3/public/symbol
Returns the actual list of currency symbols (currency pairs) traded on exchange. The first listed currency of a symbol is called the base currency, and the second currency is called the quote currency. The currency pair indicates how much of the quote currency is needed to purchase one unit of the base currency. Read more
You can optionally use a comma-separated list of symbols. If it is not provided, null
or empty, the request returns all symbols.
Requires no API key Access Rights.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
symbols | String | Comma-separated list of symbol codes. |
Response:
Name | Type | Description |
---|---|---|
type | String | Symbol type. Possible values: spot |
base_currency | String | Name (code) of base currency, (e.g., "ETH" ). |
quote_currency | String | Name (code) of quote currency. |
status | String | Exchange status. Possible values: working , suspended |
quantity_increment | Number | Symbol quantity should be divided by this value with no remainder. |
tick_size | Number | Symbol price should be divided by this value with no remainder. |
take_rate | Number | Default fee rate. |
make_rate | Number | Default fee rate for market making trades. |
fee_currency | String | Currency in which fees are determined. |
Get Symbol
curl "https://api.crosstower.com/api/3/public/symbol/ETHBTC"
Response:
{
"type": "spot",
"base_currency": "ETH",
"quote_currency": "BTC",
"status": "working",
"quantity_increment": "0.0001",
"tick_size": "0.000001",
"take_rate": "0.002",
"make_rate": "0.001",
"fee_currency": "BTC"
}
GET /api/3/public/symbol/{symbol}
Returns the data for a certain symbol.
Requires no API key Access Rights.
Response:
Name | Type | Description |
---|---|---|
type | String | Symbol type. Possible values: spot |
base_currency | String | Name (code) of base currency, (e.g., "ETH" ). |
quote_currency | String | Name (code) of quote currency. |
status | String | Exchange status. Possible values: working , suspended |
quantity_increment | Number | Symbol quantity should be divided by this value with no remainder. |
tick_size | Number | Symbol price should be divided by this value with no remainder. |
take_rate | Number | Default fee rate. |
make_rate | Number | Default fee rate for market making trades. |
fee_currency | String | Currency in which fees are determined. |
Get Symbols Mappings
curl -X GET -H "broker-id:1" \
"https://{host}/api/3/public/mapping/symbol?symbols=WAVESUSD,REPETH"
The above command returns JSON structured like this:
{
"WAVESUSD":{
"core_symbol_id":1499,
"core_symbol":"WAVESUSD",
"core_base_currency":"WAVES",
"core_quote_currency":"USD",
"core_fee_currency":"USD",
"quantity_increment":"0.01",
"tick_size":"0.00001"
},
"REPETH":{
"core_symbol_id":564,
"core_symbol":"REPETH",
"core_base_currency":"REP",
"core_quote_currency":"ETH",
"core_fee_currency":"ETH",
"quantity_increment":"0.001",
"tick_size":"0.000001"
}
GET /api/3/public/mapping/symbol
Returns symbols mappings from the Trading Terminal to the Matching Engine.
Parameters:
Name | Type | Description |
---|---|---|
symbols | String | Optional. Symbol code or codes, separated by commas. |
Response:
Name | Type | Description |
---|---|---|
core_symbol_id | Number | Symbol identifier in the Matching Engine. |
core_symbol | String | Symbol code in the Matching Engine. |
core_base_currency | String | Base currency code in the Matching Engine. |
core_quote_currency | String | Quote currency code in the Matching Engine. |
core_fee_currency | String | The currency used for charging fees. |
quantity_increment | Number | Quantity should be divided by this value without residue. |
tick_size | Number | Price should be divided by this value without residue. |
Get Symbol Mapping
curl -X GET -H "broker-id:1" \
"https://{host}/api/3/public/mapping/symbol/WAVESUSD"
The above command returns JSON structured like this:
{
"core_symbol_id":1499,
"core_symbol":"WAVESUSD",
"core_base_currency":"WAVES",
"core_quote_currency":"USD",
"core_fee_currency":"USD",
"quantity_increment":"0.01",
"tick_size":"0.00001"
}
GET /api/3/public/mapping/symbol/{symbol}
Returns symbol mapping from the Trading Terminal to the Matching Engine.
Parameters:
Name | Type | Description |
---|---|---|
symbol | String | Symbol code. |
Response:
Name | Type | Description |
---|---|---|
core_symbol_id | Number | Symbol identifier in the Matching Engine. |
core_symbol | String | Symbol code in the Matching Engine. |
core_base_currency | String | Base currency code in the Matching Engine. |
core_quote_currency | String | Quote currency code in the Matching Engine. |
core_fee_currency | String | The currency used for charging fees. |
quantity_increment | Number | Quantity should be divided by this value without residue. |
tick_size | Number | Price should be divided by this value without residue. |
Tickers
Get Tickers
curl "https://api.crosstower.com/api/3/public/ticker"
Response:
{
"ETHBTC": {
"ask": "0.050043",
"bid": "0.050042",
"last": "0.050042",
"low": "0.047052",
"high": "0.051679",
"open": "0.047800",
"volume": "36456.720",
"volume_quote": "1782.625000",
"timestamp": "2021-06-12T14:57:19.999Z"
}
}
GET /api/3/public/ticker
Returns ticker information.
You can optionally use a comma-separated list of symbols. If it is not provided, null
or empty, the request returns tickers for all symbols.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
symbols | String | Optional. Comma-separated list of symbol codes. |
Response:
Name | Type | Description |
---|---|---|
ask | Number or null | Best ask price. Can return null if no data. |
bid | Number or null | Best bid price. Can return null if no data. |
last | Number or null | Last trade price. Can return null if no data. |
low | Number | The lowest trade price within 24 hours. |
high | Number | The highest trade price within 24 hours. |
open | Number or null | Last trade price 24 hours ago. Can return null if no data. |
volume | Number | Total trading amount within 24 hours in base currency. |
volume_quote | Number | Total trading amount within 24 hours in quote currency. |
timestamp | DateTime | Last update or refresh ticker timestamp. |
Get Ticker by Symbol
curl "https://api.crosstower.com/api/3/public/ticker/ETHBTC"
Response:
{
"ask": "0.020572",
"bid": "0.020566",
"last": "0.020574",
"low": "0.020388",
"high": "0.021084",
"open": "0.020913",
"volume": "138444.3666",
"volume_quote": "2853.6874972480",
"timestamp": "2021-06-02T17:52:36.731Z"
}
GET /api/3/public/ticker/{symbol}
Returns the ticker for a certain symbol.
Requires no API key Access Rights.
Response:
Name | Type | Description |
---|---|---|
ask | Number or null | Best ask price. Can return null if no data. |
bid | Number or null | Best bid price. Can return null if no data. |
last | Number or null | Last trade price. Can return null if no data. |
low | Number | The lowest trade price within 24 hours. |
high | Number | The highest trade price within 24 hours. |
open | Number or null | Last trade price 24 hours ago. Can return null if no data. |
volume | Number | Total trading amount within 24 hours in base currency. |
volume_quote | Number | Total trading amount within 24 hours in quote currency. |
timestamp | DateTime | Last update or refresh ticker timestamp. |
Prices
Get Prices
curl "https://api.crosstower.com/api/3/public/price/rate?from=ETH&to=BTC"
Response:
{
"ETH":{
"currency": "BTC",
"price": "0.021084",
"timestamp": "2021-06-02T17:52:36.731Z"
}
}
GET /api/3/public/price/rate
Returns currencies quotation prices.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
from | String | Source currency code. |
to | String | Target currency code. |
Response:
Name | Type | Description |
---|---|---|
currency | String | Quote currency code. |
price | Number | Quotation price. |
timestamp | DateTime | Last update or refresh price timestamp. |
Get Prices History
curl "https://api.crosstower.com/api/3/public/price/history?from=ETH&to=BTC"
Response:
{
"ETH":{
"currency": "BTC",
"history":[
{
"timestamp": "2021-07-01T20:00:00.000Z",
"open": "0.063420",
"close": "0.063767",
"min": "0.063403",
"max": "0.063782"
}
]
}
GET /api/3/public/price/history
Returns quotation prices history.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
from | String | Source currency code. |
to | String | Target currency code. |
until | DateTime | Optional. Interval end value. |
since | DateTime | Optional. Interval initial value. |
limit | Number | Optional Default value: 1 Accepted values: 1 – 1000 |
period | String | Optional. Accepted values: M1 (one minute), M3 , M5 , M15 , M30 , H1 (one hour), H4 , D1 (one day), D7 , 1M (one month) Default value: M30 (30 minutes) |
sort | String | Optional. Sort direction. Accepted values: ASC , DESC Default value: DESC |
Response:
Name | Type | Description |
---|---|---|
currency | String | Quote currency code. |
history | History | Quotation price history entry. |
History model consists of:
Name | Type | Description |
---|---|---|
timestamp | DateTime | Last update or refresh price timestamp. |
open | Number | Open price. |
close | Number | Closing price. |
min | Number | The lowest price for the period. |
max | Number | The highest price for the period. |
Get Ticker Last Prices
curl "https://api.crosstower.com/api/3/public/price/ticker"
Response:
{
"ETHBTC": {
"price": "0.050042",
"timestamp": "2021-06-12T14:57:19.999Z"
}
}
GET /api/3/public/price/ticker
Returns tickers' last prices for all symbols.
You can optionally use a comma-separated list of symbols. If it is not provided, null
or empty, the request returns tickers' last prices for all symbols.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
symbols | String | Optional. Comma-separated list of symbol codes. |
Response:
Name | Type | Description |
---|---|---|
price | Number | Ticker last price. |
timestamp | DateTime | Last update or refresh ticker timestamp. |
Get Ticker Last Price by Symbol
curl "https://api.crosstower.com/api/3/public/price/ticker/ETHBTC"
Response:
{
"price": "0.021084",
"timestamp": "2021-06-02T17:52:36.731Z"
}
GET /api/3/public/price/ticker/{symbol}
Returns the ticker last price for a certain symbol.
Requires no API key Access Rights.
Response:
Name | Type | Description |
---|---|---|
price | Number | Ticker last price. |
timestamp | DateTime | Last update or refresh ticker timestamp. |
Trades
Get Trades
curl "https://api.crosstower.com/api/3/public/trades"
Response:
{
"BTCUSDT":[
{
"id":3494,
"price":"9793.94",
"qty":"0.21469",
"side":"sell",
"timestamp":"2021-06-24T12:54:41.972Z"
}
],
"ETHBTC":[
{
"id":3495,
"price":"0.027668",
"qty":"0.069",
"side":"buy",
"timestamp":"2021-06-24T12:54:32.843Z"
}
]
}
GET /api/3/public/trades
Returns trades information for all or multiple symbols.
You can optionally use a comma-separated list of symbols. If it is not provided, null
or empty, the request returns trades for all symbols.
Requires no API key Access Rights.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
symbols | String | Comma-separated list of symbol codes. |
by | String | Filter type. Accepted values: id , timestamp Default value: timestamp |
sort | String | Sort direction. Accepted values: ASC , DESC Default value: DESC |
from | DateTime or Number | Interval initial value. If sorting by timestamp is used, then DateTime ; otherwise — Number . |
till | DateTime or Number | Interval end value. If sorting by timestamp is used, then DateTime ; otherwise — Number . |
limit | Number | Default value: 10 Accepted values: 1 – 1000 |
Response:
Name | Type | Description |
---|---|---|
id | Number | Trade identifier. |
price | Number | Trade price. |
qty | Number | Trade quantity. |
side | String | Trade side. Accepted values: sell , buy |
timestamp | DateTime | Trade timestamp. |
Get Trades by Symbol
curl "https://api.crosstower.com/api/3/public/trades/ETHBTC?sort=DESC"
Response:
[
{
"id": 9533117,
"price": "0.046001",
"qty": "0.220",
"side": "sell",
"timestamp": "2021-06-14T12:18:40.426Z"
},
{
"id": 9533116,
"price": "0.046002",
"qty": "0.022",
"side": "buy",
"timestamp": "2021-06-14T11:56:37.027Z"
}
]
GET /api/3/public/trades/{symbol}
Returns trades information for a certain symbol.
Requires no API key Access Rights.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
by | String | Filter type. Accepted values: id , timestamp Default value: timestamp |
sort | String | Sort direction. Accepted values: ASC , DESC Default value: DESC |
from | DateTime or Number | Optional. Interval initial value. If sorting by timestamp is used, then DateTime ; otherwise — Number . |
till | DateTime or Number | Optional. Interval end value. If sorting by timestamp is used, then DateTime ; otherwise — Number . |
limit | Number | Default value: 100 Accepted values: 1 – 1000 |
offset | Number | Default value: 0 Accepted values: 0 – 100000 |
Response:
Name | Type | Description |
---|---|---|
id | Number | Trade identifier. |
price | Number | Trade price. |
qty | Number | Trade quantity. |
side | String | Trade side. Possible values: sell , buy |
timestamp | DateTime | Trade timestamp. |
Order Books
Get Order Books
curl "https://api.crosstower.com/api/3/public/orderbook"
Response:
{
"BTCUSDT": {
"timestamp": "2021-06-11T11:18:03.857366871Z",
"ask": [
[
"9777.51", // Price
"4.50579" // Amount
],
[
"9777.52",
"5.79832"
]
],
"bid": [
[
"9777.5",
"0.00002"
],
[
"9776.26",
"0.0001"
]
]
},
"ETHBTC": {
"timestamp": "2021-06-11T11:18:03.790858502Z",
"ask": [
[
"0.022626",
"0.0057"
],
[
"0.022628",
"1.4259"
]
],
"bid": [
[
"0.022624",
"0.5748"
],
[
"0.022623",
"26.5"
]
]
}
}
GET /api/3/public/orderbook
An Order Book is a list of buy and sell orders for a specific symbol, structured by price level.
You can optionally use a comma-separated list of symbols. If it is not provided, null
or empty, the request returns an Order Book for all symbols.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
depth | Number | Optional. Order Book depth. Default value: 10 Set to 0 to view the full Order Book. |
symbols | String | Optional. Comma-separated list of symbol codes. |
Response:
Name | Type | Description |
---|---|---|
timestamp | DateTime | Publication timestamp. |
ask | Array | Ask side array of levels. |
bid | Array | Bid side array of levels. |
Get Order Book by Symbol
curl "https://api.crosstower.com/api/3/public/orderbook/ETHBTC?volume=0.5"
Response:
{
"timestamp": "2021-06-11T11:30:38.597950917Z",
"ask": [
[
"9779.68", // Price
"2.497" // Quantity
]
],
"bid": [
[
"9779.67",
"0.03719"
],
[
"9779.29",
"0.171"
],
[
"9779.27",
"0.171"
],
[
"9779.21",
"0.171"
]
]
}
GET /api/3/public/orderbook/{symbol}
The request returns an Order Book for a certain symbol.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
depth | Number | Optional. Order Book depth. Default value: 100 Set to 0 to view the full Order Book. |
volume | Number | Optional. Desired volume for market depth search. |
Please note that if the volume
is specified, the depth
will be ignored.
Response:
Name | Type | Description |
---|---|---|
timestamp | DateTime | Publication timestamp. |
ask | Array | Ask side array of levels. |
bid | Array | Bid side array of levels. |
Candles
Get Candles
curl "https://api.crosstower.com/api/3/public/candles"
Response:
{
"BTCUSDT":[
{
"timestamp": "2021-07-01T20:00:00.000Z",
"open": "33079.93",
"close": "33236.53",
"min": "33079.93",
"max": "33295.73",
"volume": "146.86223",
"volume_quote": "4877838.3025063"
}
],
"ETHBTC":[
{
"timestamp": "2021-07-01T20:00:00.000Z",
"open": "0.063420",
"close": "0.063767",
"min": "0.063403",
"max": "0.063782",
"volume": "866.6776",
"volume_quote": "55.2132903904"
}
]
}
GET /api/3/public/candles
Candles are used for the representation of a specific symbol as an OHLC chart.
You can optionally use a comma-separated list of symbols. If it is not provided, null
or empty, the request returns candles for all symbols.
Requires no API key Access Rights.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
symbols | String | Comma-separated list of symbol codes. |
sort | String | Sort direction. Accepted values: ASC , DESC Default value: DESC |
period | String | Accepted values: M1 (one minute), M3 , M5 , M15 , M30 , H1 (one hour), H4 , D1 (one day), D7 , 1M (one month) Default value: M30 (30 minutes) |
from | DateTime | Interval initial value. |
till | DateTime | Interval end value. |
limit | Number | Default value: 10 Accepted values: 1 – 1000 |
Response:
Name | Type | Description |
---|---|---|
timestamp | DateTime | Candle timestamp. |
open | Number | Open price. |
close | Number | Closing price. |
min | Number | The lowest price for the period. |
max | Number | The highest price for the period. |
volume | Number | Volume in base currency. |
volume_quote | Number | Volume in quote currency. |
Get Candles by Symbol
curl "https://api.crosstower.com/api/3/public/candles/ETHBTC"
Response:
[
{
"timestamp": "2021-06-20T20:00:00.000Z",
"open": "0.050459",
"close": "0.050087",
"min": "0.050000",
"max": "0.050511",
"volume": "1326.628",
"volume_quote": "66.555987736"
},
{
"timestamp": "2021-06-20T20:30:00.000Z",
"open": "0.050108",
"close": "0.050139",
"min": "0.050068",
"max": "0.050223",
"volume": "87.515",
"volume_quote": "4.386062831"
}
]
GET /api/3/public/candles/{symbol}
Returns candles for a certain symbol.
Requires no API key Access Rights.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
sort | String | Sort direction. Accepted values: ASC , DESC Default value: DESC |
period | String | Accepted values: M1 (one minute), M3 , M5 , M15 , M30 , H1 (one hour), H4 , D1 (one day), D7 , 1M (one month) Default value: M30 (30 minutes) |
from | DateTime | Interval initial value. |
till | DateTime | Interval end value. |
limit | Number | Default value: 100 Accepted values: 1 – 1000 |
offset | Number | Default value: 0 Accepted values: 0 – 100000 |
Response:
Name | Type | Description |
---|---|---|
timestamp | DateTime | Candle timestamp. |
open | Number | Open price. |
close | Number | Closing price. |
min | Number | The lowest price for the period. |
max | Number | The highest price for the period. |
volume | Number | Volume in base currency. |
volume_quote | Number | Volume in quote currency. |
Authentication
Public market data are available without authentication. Authentication is required for other requests.
You should create API keys on the API Settings page. You can create multiple API keys with different access rights for your applications.
Alternatively, you may obtain API keys via the Auth API by creating a session (POST /account/auth
) and an API key (POST /api-key
).
Basic
curl -u "apiKey:secretKey" https://api.crosstower.com/api/3/spot/balance
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
const fetch = require('node-fetch');
const credentials = Buffer.from('apiKey' + ':' + 'secretKey').toString('base64');
fetch('https://api.crosstower.com/api/3/spot/balance', {
method: 'GET',
headers: {
'Authorization': 'Basic ' + credentials
}
});
To authorize, place credentials to the request header. Those must be constituted of apiKey
and secretKey
as follows: "Basic " + apiKey + ":" + secretKey
.
HS256
from base64 import b64encode
from hashlib import sha256
from hmac import HMAC
from time import time
from urllib.parse import urlsplit
from requests import Session
from requests.auth import AuthBase
class HS256(AuthBase):
def __init__(self, api_key: str, secret_key: str, window: int = None):
self.api_key = api_key
self.secret_key = secret_key
self.window = window
def __call__(self, r):
url = urlsplit(r.url)
message = [r.method, url.path]
if url.query:
message.append('?')
message.append(url.query)
if r.body:
message.append(r.body)
timestamp = str(int(time() * 1000))
window = str(self.window) if self.window else None
message.append(timestamp)
if window:
message.append(window)
signature = HMAC(key=self.secret_key.encode(),
msg=''.join(message).encode(),
digestmod=sha256).hexdigest()
data = [self.api_key, signature, timestamp]
if window:
data.append(window)
base64_encoded = b64encode(':'.join(data).encode()).decode()
r.headers['Authorization'] = f'HS256 {base64_encoded}'
return r
auth = HS256(api_key='apiKey', secret_key='secretKey')
with Session() as s:
response = s.get('https://api.crosstower.com/api/3/spot/balance', auth=auth)
print(response.json())
The alternative authentication method is the HMAC signature.
To send a request, you should establish a persistent session using the credentials signed as follows:
- Create an HMAC signature with
secret_key
as the secret key, SHA256 as the hash algorithm, and payload as the message, structured like:<method> + <URL path> + [“?” + <query>] + [<body>] + <timestamp> + [<window>]
- Add the authorization header to a request. It should have the following structure:
"HS256 " + Base64(api_key + ":" + <HMAC signature> + ":" + timestamp + [":" + window])
Spot Trading
Order Model
{
"id": 828680665,
"client_order_id": "f4307c6e507e49019907c917b6d7a084",
"symbol": "ETHBTC",
"side": "sell",
"status": "partiallyFilled",
"type": "limit",
"time_in_force": "GTC",
"quantity": "13.942",
"price": "0.011384",
"quantity_cumulative": "5.240",
"created_at": "2021-06-16T14:18:47.321Z",
"updated_at": "2021-06-16T14:18:47.321Z",
"post_only": false,
"trades": [
{
"id": 1361171432,
"quantity": "5.240",
"price": "0.011384",
"fee": "0.001237803000",
"taker": true,
"timestamp": "2021-06-16T14:18:47.321Z"
}
]
}
Order model consists of:
Name | Type | Description |
---|---|---|
id | Number | Unique order identifier as assigned by exchange. |
client_order_id | String | Unique order identifier as assigned by the trader. Uniqueness must be guaranteed until the last order with the same client_order_id becomes inactive (canceled, expired, or fully executed) and some time after that. |
order_list_id | String | Optional. Order list identifier. Returned only for an order list request. |
contingency_type | String | Optional. Order list type. Returned only for an order list request. Possible values: allOrNone , oneCancelOther , oneTriggerOther , oneTriggerOneCancelOther |
symbol | String | Symbol code. |
side | String | Trade side. Possible values: sell , buy |
status | String | Order state. Possible values: new — an order is placed in the order book. suspended — a stopLimit , stopMarket , takeProfitLimit or takeProfitMarket order is parked until it meets the conditions for placement in the order book. partiallyFilled — an order is executed, but a part of its quantity is not filled yet. filled — order quantity filled completely. canceled — an order is canceled. It can either be done by a user through a cancel/replace request or by the system under specific circumstances. expired — an order is deactivated after it no longer satisfies Time in Force (IOC, FOK) or Post Only requirements. |
type | String | Order type. Possible values: limit , market , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket |
time_in_force | String | Time in Force is a special instruction used when placing an order to indicate how long it will remain active before it is executed or expired. GTC — "Good-Till-Canceled" order won't be closed until it is filled. IOC — "Immediate-Or-Cancel" order must be executed immediately. Any part of an IOC order that cannot be filled immediately will be canceled. FOK — "Fill-Or-Kill" order must be executed immediately and completely or not executed at all. Day — keeps the order active until the end of the trading day (23:59 UTC+0). GTD — "Good-Till-Date" order may remain active until the time specified in expire_time . |
quantity | Number | Order quantity. |
quantity_cumulative | Number | Executed order quantity. |
price | Number | Optional. Order price. |
stop_price | Number | Optional. The price level that triggers order activation. Specified if type is stopLimit , stopMarket , takeProfitLimit , or takeProfitMarket . |
expire_time | DateTime | Optional. Date of order expiration. Specified if time_in_force is GTD . |
post_only | Boolean | A post-only order is an order that does not remove liquidity. If a post-only order causes a match with a pre-existing order as a taker, then the order will expire. |
original_client_order_id | String | Optional. Identifier of replaced order. |
created_at | DateTime | Date of order's creation. |
updated_at | DateTime | Date of order's last update. |
trades | Array of Trade | Optional. List of trades. Never returned for an order list request. |
Trade model consists of:
Name | Type | Description |
---|---|---|
id | Number | Trade identifier. |
quantity | Number | Quantity of trade. |
price | Number | Trade price. |
fee | Number | Fee paid for trade. |
taker | Boolean | Liquidity indicator. |
timestamp | DateTime | Date of trade. |
Get Spot Trading Balance
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/balance"
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
b = session.get('https://api.crosstower.com/api/3/spot/balance').json()
print(b)
Response. All currencies:
[
{
"currency": "ETH",
"available": "10.000000000",
"reserved": "0.56"
},
{
"currency": "BTC",
"available": "0.010205869",
"reserved": "0"
}
]
Response. One currency:
{
"available": "10.000000000",
"reserved": "0.56"
}
GET /api/3/spot/balance
GET /api/3/spot/balance/{currency}
Returns the user's trading balance.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Optional. Currency filter. |
Response:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
available | Number | Amount available for trading or transfer to wallet. |
reserved | Number | Total amount reserved for active orders and incomplete transfers to wallet. |
Get All Active Spot Orders
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order"
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
b = session.get('https://api.crosstower.com/api/3/spot/order').json()
print(b)
Response:
[
{
"id": 840450210,
"client_order_id": "c1837634ef81472a9cd13c81e7b91401",
"symbol": "ETHBTC",
"side": "buy",
"status": "partiallyFilled",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.020",
"price": "0.046001",
"quantity_cumulative": "0.005",
"post_only": false,
"created_at": "2021-06-12T17:17:57.437Z",
"updated_at": "2021-06-12T17:18:08.610Z"
}
]
GET /api/3/spot/order
Returns a list of all active spot orders.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
symbol | String | Optional. Parameter to filter active spot orders by symbol. |
Response: array of spot orders
Get Active Spot Order
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order/c1837634ef81472a9cd13c81e7b91401"
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
b = session.get('https://api.crosstower.com/api/3/spot/order/c1837634ef81472a9cd13c81e7b91401').json()
print(b)
Response:
{
"id": 840450210,
"client_order_id": "c1837634ef81472a9cd13c81e7b91401",
"symbol": "ETHBTC",
"side": "buy",
"status": "partiallyFilled",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.020",
"price": "0.046001",
"quantity_cumulative": "0.005",
"post_only": false,
"created_at": "2021-06-12T17:17:57.437Z",
"updated_at": "2021-06-12T17:18:08.610Z"
}
GET /api/3/spot/order/{client_order_id}
Returns an active spot order by client_order_id
.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Response: spot order
Create New Spot Order
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order" \
-d "symbol=ETHBTC&side=sell&quantity=0.063&price=0.046016"
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
orderData = {'symbol':'ETHBTC', 'side': 'sell', 'quantity': '0.063', 'price': '0.046016' }
r = session.post('https://api.crosstower.com/api/3/spot/order/', data = orderData)
print(r.json())
Response:
{
"id": 0,
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "sell",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"quantity_cumulative": "0.000",
"post_only": false,
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
}
Error response example:
{
"error": {
"code": 20001,
"message": "Insufficient funds",
"description": "Check that the funds are sufficient, given commissions"
}
}
POST /api/3/spot/order
Creates a new spot order.
Requires the "Place/cancel orders" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
client_order_id | String | Optional. If omitted, an order will be created, and it will be generated by the Server. Uniqueness must be guaranteed until the last order with the same client_order_id becomes inactive (canceled, expired, or fully executed) and some time after that. Must be from 8 to 32 long. May include Latin letters of any case, digits, and _ , - . If specified and corresponds to an existing order, a request will be rejected. |
symbol | String | Symbol code. |
side | String | Trade side. Accepted values: sell , buy |
type | String | Optional. Order type. Must be set to market , stopMarket , or takeProfitMarket if price was left unspecified. Accepted values: limit , market , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket Default value: limit |
time_in_force | String | Optional. Time in Force instruction. Accepted values: GTC , IOC , FOK , Day , GTD Default value: GTC |
quantity | Number | Order quantity. |
price | Number | Order price. Required if type is limit , stopLimit , or takeProfitLimit . |
stop_price | Number | The price level that triggers order activation. Required if type is stopLimit , stopMarket , takeProfitLimit , or takeProfitMarket . |
expire_time | DateTime | Date of order expiration. Required if time_in_force is GTD . |
strict_validate | Boolean | Price and quantity will be checked for incrementation within the symbol’s tick size and quantity step. See the symbol's tick_size and quantity_increment . |
post_only | Boolean | Optional. If a post-only order causes a match with a pre-existing order as a taker, then the order will expire. |
take_rate | Number | Optional. Liquidity taker fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup. |
make_rate | Number | Optional. Liquidity provider fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup. |
Response: spot order
Price accuracy and quantity
Symbol config contains the tick_size
parameter which means that price
should be divided by tick_size
with no remainder. quantity
should be divided by quantity_increment
with no remainder.
By default, if strict_validate
is not enabled, the Server rounds half down the price
and quantity
for tick_size
and quantity_increment
.
Example of ETHBTC: if tick_size
is 0.000001
, then price 0.046016
is valid, and 0.0460165
is invalid.
Fees
Charged fee is determined by the symbol's fee_currency
. Maker-taker fees offer a transaction rebate make_rate
to those who provide liquidity (a maker), while charging customers who take that liquidity take_rate
(a taker).
To create buy orders, you must have sufficient balance including fees.
To create market buy orders, you must have sufficient balance including fees, considering maximum possible market order slippage of 10%. Available balance > price × quantity × 1.1 + price × quantity × 1.1 × max(take_rate, make_rate)
Order result status
For orders with time_in_force
equal to IOC
or FOK
, the REST API returns final order status: filled
or expired
.
If an order can be instantly executed, then the REST API returns a status of filled
or partiallyFilled
in the order's info.
Create New Spot Order List
AON request:
curl -X POST \
-H 'Content-Type: application/json'\
-u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order/list"
-d '{
"contingency_type": "allOrNone",
"orders": [
{
"symbol": "ETHBTC",
"side": "sell",
"quantity": "0.063",
"type": "market",
"time_in_force": "FOK"
},
{
"symbol": "BTCUSDT",
"side": "sell",
"quantity": "0.057",
"type": "market",
"time_in_force": "FOK"
}
]
}'
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
headers = {'Content-Type': 'application/json'}
orderData = '{"contingency_type": "allOrNone", "orders": [{"symbol": "ETHBTC", "side": "sell", "quantity": "0.063", "type": "market", "time_in_force": "FOK"}, {"symbol": "BTCUSDT", "side": "sell", "quantity": "0.057", "type": "market", "time_in_force": "FOK"}]}'
r = session.post('https://api.crosstower.com/api/3/spot/order/list', data = orderData, headers=headers)
print(r.json())
AON response:
[
{
"id": 840450210,
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "sell",
"status": "filled",
"type": "market",
"time_in_force": "FOK",
"quantity": "0.063",
"price": "0.071476",
"quantity_cumulative": "0.000",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "allOrNone",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
},
{
"id": 840450211,
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "BTCUSDT",
"side": "sell",
"status": "filled",
"type": "market",
"time_in_force": "FOK",
"quantity": "0.057",
"price": "43510.67",
"quantity_cumulative": "0.000",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "allOrNone",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
}
]
OCO request:
curl -X POST \
-H 'Content-Type: application/json' \
-u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order/list" \
-d '{
"contingency_type": "oneCancelOther",
"orders": [
{
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "buy",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"post_only": false
},
{
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "ETHBTC",
"side": "sell",
"type": "stopMarket",
"time_in_force": "GTC",
"quantity": "0.063",
"stop_price": "0.044050",
"post_only": false
}
]
}'
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
headers = {'Content-Type': 'application/json'}
orderData = '{"contingency_type": "oneCancelOther", "orders": [{"client_order_id": "d8574207d9e3b16a4a5511753eeef175", "symbol": "ETHBTC", "side": "buy", "type": "limit", "time_in_force": "GTC", "quantity": "0.063", "price": "0.046016", "post_only": false}, {"client_order_id": "a53406ea49e160c63b620ca21e9fb634", "symbol": "ETHBTC", "side": "sell", "type": "stopMarket", "time_in_force": "GTC", "quantity": "0.063", "stop_price": "0.044050", "post_only": false}]}'
r = session.post('https://api.crosstower.com/api/3/spot/order/list', data = orderData, headers=headers)
print(r.json())
OCO response:
[
{
"id": 840450210,
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"quantity_cumulative": "0.063",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneCancelOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
},
{
"id": 840450211,
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "ETHBTC",
"side": "sell",
"status": "suspended",
"type": "stopMarket",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.044016",
"quantity_cumulative": "0.057",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneCancelOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
}
]
OTO request:
curl -X POST \
-H 'Content-Type: application/json' \
-u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order/list" \
-d '{
"contingency_type": "oneTriggerOther",
"orders": [
{
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "buy",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"post_only": false
},
{
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "ETHBTC",
"side": "sell",
"type": "stopMarket",
"time_in_force": "GTC",
"quantity": "0.063",
"stop_price": "0.044050",
"post_only": false
}
]
}'
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
headers = {'Content-Type': 'application/json'}
orderData = '{"contingency_type": "oneTriggerOther", "orders": [{"client_order_id": "d8574207d9e3b16a4a5511753eeef175", "symbol": "ETHBTC", "side": "buy", "type": "limit", "time_in_force": "GTC", "quantity": "0.063", "price": "0.046016", "post_only": false}, {"client_order_id": "a53406ea49e160c63b620ca21e9fb634", "symbol": "ETHBTC", "side": "sell", "type": "stopMarket", "time_in_force": "GTC", "quantity": "0.063", "stop_price": "0.044050", "post_only": false}]}'
r = session.post('https://api.crosstower.com/api/3/spot/order/list', data = orderData, headers=headers)
print(r.json())
OTO response:
[
{
"id": 840450210,
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"quantity_cumulative": "0.063",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneTriggerOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
},
{
"id": 840450211,
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "ETHBTC",
"side": "sell",
"status": "suspended",
"type": "stopMarket",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.044016",
"quantity_cumulative": "0.057",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneTriggerOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
}
]
OTOCO request:
curl -X POST \
-H 'Content-Type: application/json' \
-u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order/list" \
-d '{
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneTriggerOneCancelOther",
"orders": [
{
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "buy",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"post_only": false
},
{
"client_order_id": "2723cdfba2d609b621d5d055e3ef9be2",
"symbol": "ETHBTC",
"side": "sell",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.050000",
"post_only": false
},
{
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "ETHBTC",
"side": "sell",
"type": "stopMarket",
"time_in_force": "GTC",
"quantity": "0.063",
"stop_price": "0.044050",
"post_only": false
}
]
}'
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
headers = {'Content-Type': 'application/json'}
orderData = '{"contingency_type": "oneTriggerOneCancelOther", "orders": [{"client_order_id": "d8574207d9e3b16a4a5511753eeef175", "symbol": "ETHBTC", "side": "buy", "type": "limit", "time_in_force": "GTC", "quantity": "0.063", "price": "0.046016", "post_only": false}, {"client_order_id": "2723cdfba2d609b621d5d055e3ef9be2", "symbol": "ETHBTC", "side": "sell", "type": "limit", "time_in_force": "GTC", "quantity": "0.063", "price": "0.050000", "post_only": false}, {"client_order_id": "a53406ea49e160c63b620ca21e9fb634", "symbol": "ETHBTC", "side": "sell", "type": "stopMarket", "time_in_force": "GTC", "quantity": "0.063", "stop_price": "0.044050", "post_only": false}]}'
r = session.post('https://api.crosstower.com/api/3/spot/order/list', data = orderData, headers=headers)
print(r.json())
OTOCO response:
[
{
"id": 840450210,
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"quantity_cumulative": "0.000",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneTriggerOneCancelOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
},
{
"id": 840450211,
"client_order_id": "2723cdfba2d609b621d5d055e3ef9be2",
"symbol": "ETHBTC",
"side": "sell",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.050000",
"quantity_cumulative": "0.000",
"post_only": false,
"inactive": true,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneTriggerOneCancelOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
},
{
"id": 840450211,
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "ETHBTC",
"side": "sell",
"status": "suspended",
"type": "stopMarket",
"time_in_force": "GTC",
"quantity": "0.063",
"stop_price": "0.044050",
"price": "0.044016",
"quantity_cumulative": "0.000",
"post_only": false,
"inactive": true,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneTriggerOneCancelOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
}
]
Error response example:
{
"error": {
"code": 20001,
"message": "Insufficient funds",
"description": "Check that the funds are sufficient, given commissions"
}
}
POST /api/3/spot/order/list
Creates a new spot order list.
Requires the "Place/cancel orders" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
order_list_id | String | Order list identifier. If omitted, it will be generated by the system upon order list creation. Must be equal to client_order_id of the first order in the request. |
contingency_type | String | Order list type. Accepted values: allOrNone (AON) — all orders in the set should be executed within a single transaction or become expired otherwise; oneCancelOther (OCO) — all orders in the set should be canceled if one of them was executed; oneTriggerOther (OTO) — execution of the first (primary) order on the list activates other (secondary) orders as independent of each other; oneTriggerOneCancelOther (OTOCO) — the execution of the first (primary) order on the list activates the other (secondary) orders as an OCO order list. |
orders | Array of Order | Orders in the list. There must be 2 or 3 orders for allOrNone /oneCancelOther /oneTriggerOther and 3 — for oneTriggerOneCancelOther . Placing any other number of orders will result in an error. |
Order model consists of:
Name | Type | Description |
---|---|---|
client_order_id | String | Optional. Must be different from the identifiers of other orders in the list. If omitted, it will be generated by the system upon order list creation. Uniqueness must be guaranteed until the last order with the same client_order_id becomes inactive (canceled, expired, or fully executed) and some time after that. |
symbol | String | Symbol code. For an allOrNone order list, symbol code must be unique for each order in the list. For an oneTriggerOneCancelOther order list, symbol code must be the same for all orders in the list (placing orders in different order books is not supported). |
side | String | Trade side. Accepted values: sell , buy |
type | String | Optional. Order type. Accepted values: for allOrNone — limit , market ; for oneCancelOther (and secondary orders in oneTriggerOneCancelOther ) — limit , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket ; for oneTriggerOneCancelOther — limit , market , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket . Default value: limit |
time_in_force | String | Optional (required for allOrNone ). Time in Force instruction. Accepted values: for allOrNone — FOK ; for oneCancelOther (and secondary orders in oneTriggerOneCancelOther ) — GTC , IOC (except limit orders), FOK (except limit orders), Day , GTD ; for oneTriggerOneCancelOther — GTC , IOC , FOK , Day , GTD . |
quantity | Number | Order quantity. |
price | Number | Order price. Required if type is limit , stopLimit , or takeProfitLimit . |
stop_price | Number | The price level that triggers order activation. Required if type is stopLimit , stopMarket , takeProfitLimit , or takeProfitMarket . |
expire_time | DateTime | Date of order expiration. Required if time_in_force is GTD . |
strict_validate | Boolean | Price and quantity will be checked for incrementation within the symbol’s tick size and quantity step. See the symbol's tick_size and quantity_increment . |
post_only | Boolean | Optional. If a post-only order causes a match with a pre-existing order as a taker, then the order will expire. |
take_rate | Number | Optional. Liquidity taker fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup. |
make_rate | Number | Optional. Liquidity provider fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup. |
Response: array of spot orders
Replace Spot Order
curl -X PATCH -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order/d8574207d9e3b16a4a5511753eeef174" \
-d "quantity=0.063&price=0.046016&new_client_order_id=d8574207d9e3b16a4a5511753eeef175"
import requests
session = requests.session()
session.auth = ("apiKey", "secretKey")
orderData = {'quantity': '0.063', 'price': '0.046016', 'new_client_order_id': 'd8574207d9e3b16a4a5511753eeef175'}
r = session.patch('https://api.crosstower.com/api/3/spot/order/d8574207d9e3b16a4a5511753eeef174', data = orderData)
print(r.json())
Response:
{
"id": 0,
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "sell",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"quantity_cumulative": "0.000",
"post_only": false,
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
}
Error response example:
{
"error": {
"code": 20001,
"message": "Insufficient funds",
"description": "Check that the funds are sufficient, given commissions"
}
}
PATCH /api/3/spot/order/{client_order_id}
Replaces a spot order
Requires the "Place/cancel orders" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
new_client_order_id | String | client_order_id for a new order. |
quantity | Number | Order quantity. |
price | Number | Order price. Required if type is limit , stopLimit , or takeProfitLimit . |
strict_validate | Boolean | Price and quantity will be checked for incrementation within the symbol’s tick size and quantity step. See the symbol's tick_size and quantity_increment . |
Response: spot order
Cancel All Spot Orders
DELETE /api/3/spot/order
Cancels all active spot orders.
Requires the "Place/cancel orders" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
symbol | String | Optional. Parameter to filter active spot orders by symbol. |
Response: array of spot orders
Cancel Spot Order
curl -X DELETE -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/order/d8574207d9e3b16a4a5511753eeef175"
Response:
{
"id": 0,
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "sell",
"status": "canceled",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"quantity_cumulative": "0.000",
"post_only": false,
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
}
Example of Order not found error response:
{
"error": {
"code": 20002,
"message": "Order not found",
"description": ""
}
}
DELETE /api/3/spot/order/{client_order_id}
Cancels a spot order.
Requires the "Place/cancel orders" API key Access Right.
Response: spot order
Get All Trading Commissions
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/fee"
Response:
[
{
"symbol": "BTCUSDT",
"take_rate": "0.001",
"make_rate": "-0.0001"
},
{
"symbol": "ETHBTC",
"take_rate": "0.001",
"make_rate": "-0.0001"
}
]
GET /api/3/spot/fee
Returns personal trading commission rates for all symbols.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Get Trading Commission
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/fee/ETHBTC"
Response:
{
"symbol": "ETHBTC",
"take_rate": "0.001",
"make_rate": "-0.0001"
}
GET /api/3/spot/fee/{symbol}
Returns personal trading commission rate by symbol.
Requires the "Place/cancel orders" API key Access Right.
Spot Trading History
Spot Orders History
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/history/order?symbol=ETHBTC"
[
{
"id": 828680665,
"client_order_id": "f4307c6e507e49019907c917b6d7a084",
"symbol": "ETHBTC",
"side": "sell",
"status": "partiallyFilled",
"type": "limit",
"time_in_force": "GTC",
"quantity": "13.942",
"price": "0.011384",
"price_average": "0.055487",
"quantity_cumulative": "5.240",
"created_at": "2021-06-16T14:18:47.321Z",
"updated_at": "2021-06-19T15:23:54.876Z"
},
{
"id": 828680667,
"client_order_id": "f4307c6e507e49019907c917b6d7a084",
"symbol": "ETHBTC",
"side": "sell",
"status": "partiallyFilled",
"type": "limit",
"time_in_force": "GTC",
"quantity": "13.942",
"price": "0.011384",
"price_average": "0.045000",
"quantity_cumulative": "5.240",
"created_at": "2021-06-16T14:18:50.321Z",
"updated_at": "2021-06-19T15:23:56.876Z"
}
]
GET /api/3/spot/history/order
Returns all spot orders. Orders without executions are deleted after 24 hours.
Requires the "Orderbook, History, Trading balance" API key Access Right.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
client_order_id | String | If specified, other parameters will be ignored, including limit and offset . |
symbol | String | Comma-separated symbol codes. |
sort | String | Sort direction. Accepted values: DESC , ASC Default value: DESC |
by | String | Filter type. Accepted values: timestamp , id Default value: id |
from | DateTime | Interval initial value. |
till | DateTime | Interval end value. |
limit | Number | Default value: 100 Maximum value: 1000 |
offset | Number | Default value: 0 Maximum value: 100000 |
Response:
Name | Type | Description |
---|---|---|
id | Number | Unique order identifier as assigned by exchange. |
client_order_id | String | Unique order identifier as assigned by the trader. The order history may list several orders with the same client_order_id . |
symbol | String | Symbol code. |
side | String | Trade side. Possible values: sell , buy |
status | String | Order state. Possible values: new — an order is placed in the order book. suspended — a stopLimit , stopMarket , takeProfitLimit or takeProfitMarket order is parked until it meets the conditions for placement in the order book. partiallyFilled — an order is executed, but a part of its quantity is not filled yet. filled — order quantity filled completely. canceled — an order is canceled. It can either be done by a user through a cancel/replace request or by the system under specific circumstances. expired — an order is deactivated after it no longer satisfies Time in Force (IOC, FOK) or Post Only requirements. |
type | String | Order type. Possible values: limit , market , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket |
time_in_force | String | Time in Force is a special instruction used when placing an order to indicate how long it will remain active before it is executed or expired. GTC — "Good-Till-Canceled" order won't be closed until it is filled. IOC — "Immediate-Or-Cancel" order must be executed immediately. Any part of an IOC order that cannot be filled immediately will be canceled. FOK — "Fill-Or-Kill" order must be executed immediately and completely or not executed at all. Day — keeps the order active until the end of the trading day (23:59 UTC+0). GTD — "Good-Till-Date" order may remain active until the time specified in expire_time . |
quantity | Number | Order quantity. |
quantity_cumulative | Number | Executed order quantity. |
price | Number | Order price. |
price_average | Number | Average price of executed order quantity. |
expire_time | DateTime | Date of order expiration. Specified if time_in_force is GTD . |
stop_price | Number | The price level that triggers order activation. Specified if type is stopLimit , stopMarket , takeProfitLimit , or takeProfitMarket . |
created_at | DateTime | Date of order's creation. |
updated_at | DateTime | Date of order's last update. |
order_list_id | String | Optional. Order list identifier. |
contingency_type | String | Optional. Order list type. Possible values: allOrNone , oneCancelOther , oneTriggerOther , oneTriggerOneCancelOther |
Spot Trades History
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/spot/history/trade?symbol=ETHBTC"
[
{
"id": 9535486,
"order_id": 816088377,
"client_order_id": "f8dbaab336d44d5ba3ff578098a68454",
"symbol": "ETHBTC",
"side": "sell",
"quantity": "0.061",
"price": "0.045487",
"fee": "0.000002775",
"timestamp": "2021-06-17T12:32:57.848Z",
"taker": true
},
{
"id": 9535437,
"order_id": 816088021,
"client_order_id": "27b9bfc068b44194b1f453c7af511ed6",
"symbol": "ETHBTC",
"side": "buy",
"quantity": "0.038",
"price": "0.046000",
"fee": "-0.000000174",
"timestamp": "2021-06-17T12:30:57.848Z",
"taker": true
}
]
GET /api/3/spot/history/trade
Returns the user's spot trading history.
Requires the "Orderbook, History, Trading balance" API key Access Right.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
order_id | String | Unique order identifier as assigned by exchange. |
symbol | String | Comma-separated symbol codes. |
sort | String | Sort direction. Accepted values: DESC , ASC Default value: DESC |
by | String | Filter type. Accepted values: timestamp , id Default value: id |
from | DateTime or Number | Interval initial value. If sorting by timestamp is used, then DateTime ; otherwise — Number . |
till | DateTime or Number | Interval end value. If sorting by timestamp is used, then DateTime ; otherwise — Number . |
limit | Number | Default value: 100 Maximum value: 1000 |
offset | Number | Default value: 0 Maximum value: 100000 |
Response:
Name | Type | Description |
---|---|---|
id | Number | Trade unique identifier as assigned by exchange. |
order_id | Number | Unique order identifier as assigned by exchange. |
client_order_id | String | Unique order identifier as assigned by the trader. The order history may list several orders with the same client_order_id . |
symbol | String | Symbol code. |
side | String | Trade side. Possible values: sell , buy |
quantity | Number | Trade quantity. |
price | Number | Trade price. |
fee | Number | Trade commission. Can be negative ("rebate" — reward paid to the trader). See fee currency in the symbol config. |
timestamp | DateTime | Trade timestamp. |
taker | Boolean | Liquidity indicator. |
Wallet Management
Wallet Balance
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/balance"
Response. All currencies:
[
{
"currency":"BTC",
"available":"0.00005821",
"reserved":"0.00001"
},
{
"currency":"USDT",
"available":"0.01",
"reserved":"0"
}
]
Response. One currency:
{
"available":"0.00005821",
"reserved":"0.00001"
}
GET /api/3/wallet/balance
GET /api/3/wallet/balance/{currency}
Returns the user's wallet balances except zero balances.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Optional. Currency filter. |
Response:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
available | Number | Amount available for withdrawals or transfers to the trading account. |
reserved | Number | Amount reserved for incomplete transactions (including the fee). |
Get Deposit Crypto Address
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/address?currency=BTC"
[
{
"currency":"BTC",
"address":"3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv"
}
]
GET /api/3/wallet/crypto/address
Get current addresses. Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Optional. Currency code. |
network_code | String | Optional. Network code. |
Response:
Name | Type | Description |
---|---|---|
currency | String | Optional. Currency code. |
address | String | Address for deposits. |
payment_id | String | Optional. An additional identifier required for specific currencies (for example, "Memo"). |
public_key | String | Optional. An additional identifier required for specific currencies. |
network_code | String | Optional. Network code. |
Generate Deposit Crypto Address
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/address" \
-d "currency=BTC"
{
"currency":"BTC",
"address":"3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv"
}
POST /api/3/wallet/crypto/address
Creates a new deposit address. Existing addresses may still receive funds. For some tokens (e.g., Ethereum tokens), a single address is generated per base currency with additional identifiers which differ for each address: payment_id
or public_key
. As a result, generating a new address for such token will change the current address for an entire base currency accordingly.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
network_code | String | Optional. Network code. |
Response:
Name | Type | Description |
---|---|---|
currency | String | Optional. Currency code. |
address | String | Address for deposits. |
payment_id | String | Optional. An additional identifier required for specific currencies (for example, "Memo"). |
public_key | String | Optional. An additional identifier required for specific currencies. |
network_code | String | Optional. Network code. |
Last 10 Deposit Crypto Addresses
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/address/recent-deposit?currency=BTC"
[
{
"currency":"BTC",
"address":"3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv"
}
]
GET /api/3/wallet/crypto/address/recent-deposit
Returns the last 10 unique addresses used for deposits (by currency).
Requires the "Payment information" API key Access Right.
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
network_code | String | Optional. Network code. |
Response:
Name | Type | Description |
---|---|---|
currency | String | Optional. Currency code. |
address | String | Address for deposits. |
payment_id | String | Optional. An additional identifier required for specific currencies (for example, "Memo"). |
public_key | String | Optional. An additional identifier required for specific currencies. |
network_code | String | Optional. Network code. |
Last 10 Withdrawal Crypto Addresses
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/address/recent-withdraw?currency=BTC"
[
{
"currency":"BTC",
"address":"3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv"
}
]
GET /api/3/wallet/crypto/address/recent-withdraw
Returns the last 10 unique addresses used for withdrawals (by currency).
Requires the "Payment information" API key Access Right.
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
network_code | String | Optional. Network code. |
Response:
Name | Type | Description |
---|---|---|
currency | String | Optional. Currency code. |
address | String | Address for deposits. |
payment_id | String | Optional. An additional identifier required for specific currencies (for example, "Memo"). |
public_key | String | Optional. An additional identifier required for specific currencies. |
network_code | String | Optional. Network code. |
Withdraw Crypto
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/withdraw" \
-d "currency=BTC&amount=0.001&address=3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv&auto_commit=false"
Success response:
{
"id": "d2ce578f-647d-4fa0-b1aa-4a27e5ee597b"
}
Validation error:
{
"error": {
"code": 10001,
"message": "Validation error",
"description": "Invalid currency: fiat"
}
}
Invalid currency error:
{
"error": {
"code": 2002,
"message": "Currency not found",
"description": "The requested currency can't found. Requested: USD"
}
}
Insufficient funds error:
{
"error": {
"code": 20001,
"message": "Insufficient funds",
"description": "Check that the funds are sufficient, given commissions"
}
}
Limits exceeded error:
{
"error": {
"code": 20003,
"message": "Limit exceeded",
"description": "Withdrawal limit exceeded"
}
}
POST /api/3/wallet/crypto/withdraw
Withdraw crypto. The transaction gets the status CREATED
right after the creation.
Requires the "Withdraw cryptocurrencies" API key Access Right.
Please take note that changing security settings affects withdrawals:
- It is impossible to withdraw funds without enabling the two-factor authentication (2FA).
- Password reset blocks withdrawals for 72 hours (3 days).
- 2FA reset blocks withdrawals for 96 hours (4 days).
- Each time a new address is added to the whitelist, it takes 48 hours before that address becomes active for withdrawal.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
network_code | String | Optional. Network code. |
amount | Number | The amount that will be sent to the specified address. |
address | String | Address identifier. |
payment_id | String | Optional. An additional identifier required for specific currencies (for example, "Memo"). |
include_fee | Boolean | Default value: false If true is set, then total spent value will include fees. |
auto_commit | Boolean | Default value: true If false is set, then you should commit or rollback a transaction in an hour. Used in two-phase commit schema. |
use_offchain | String | Whether the withdrawal may be committed offchain. Accepted values: never , optionally , required Default value: never |
public_comment | String | Optional. Maximum length is 255. |
Response:
Name | Type | Description |
---|---|---|
id | String | Transaction unique identifier. |
Convert Between Currencies
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/convert" \
-d "from_currency=USDT20&to_currency=USDT&amount=0.01"
{
"result": [
"d2ce578f-647d-4fa0-b1aa-4a27e5ee597b",
"d2ce57hf-6g7d-4ka0-b8aa-4a27e5ee5i7b"
]
}
POST /api/3/wallet/convert
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
from_currency | String | Currency code. |
to_currency | String | Currency code. |
amount | Number | The amount that will be sent to the specified address. |
Response:
Name | Type | Description |
---|---|---|
result | Array | Transaction unique identifiers as assigned by exchange. |
Withdraw Crypto Commit or Rollback
curl -X PUT -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/withdraw/d2ce578f-647d-4fa0-b1aa-4a27e5ee597b"
{
"result": true
}
PUT /api/3/wallet/crypto/withdraw/{id}
Commit a withdrawal. The transaction gets the status PENDING
.
DELETE /api/3/wallet/crypto/withdraw/{id}
Roll back a withdrawal.
If the auto_commit
parameter has been set to false
while sending the request for withdrawing crypto, the withdrawal needs to be committed or rolled back one hour after the request. Use PUT /api/3/wallet/crypto/withdraw/{id}
to approve the withdrawal operation, or DELETE /api/3/wallet/crypto/withdraw/{id}
to discard it.
The id
parameter must contain the unique transaction identifier value received as a result of the POST /api/3/wallet/crypto/withdraw
request.
Requires the "Withdraw cryptocurrencies" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
id | String | Transaction unique identifier returned to a POST /api/3/wallet/crypto/withdraw request. |
Both methods are idempotent.
Response:
Name | Type | Description |
---|---|---|
result | Boolean | true if the request is completed. |
Check If Crypto Address Belongs to Current Account
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/address/check-mine?address=1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"
{
"result": true
}
GET /api/3/wallet/crypto/address/check-mine
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
address | String | Address. |
Response:
Name | Type | Description |
---|---|---|
result | Boolean | true if the address belongs to the current account. |
Transfer Between Wallet and Exchange
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/transfer" \
-d "currency=eth&amount=0.01&source=wallet&destination=spot"
[
"d2ce578f-647d-4fa0-b1aa-4a27e5ee597b"
]
POST /api/3/wallet/transfer
Transfers funds from the wallet to the exchange account to make them available for trading.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
amount | Number | The amount that will be transferred between accounts. |
source | String | Transfer source account type. Accepted values: wallet , spot . Must not be the same as destination . |
destination | String | Transfer destination accounts type. Accepted values: wallet , spot . Must not be the same as source . |
Response:
Name | Type | Description |
---|---|---|
— | Array of String | Transaction unique identifier as assigned by exchange. |
Transfer Money to Another User
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/internal/withdraw" \
-d "by=email&identifier=user@example.com¤cy=BTC&amount=0.001"
{
"result": "fd3088da-31a6-428a-b9b6-c482673ff0f2"
}
POST /api/3/wallet/internal/withdraw
Requires the "Withdraw cryptocurrencies" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
amount | Number | The amount that will be transferred. |
by | String | Type of the beneficiary identifier specified below. Accepted values: email , username , external_id |
identifier | String | Beneficiary identifier value. Either email, external identifier, or username. |
public_comment | String | Optional text comment for the external usage. Can be up to 255 characters long, excluding the following characters: & , ' , < , > , " |
Response:
Name | Type | Description |
---|---|---|
result | String | Transaction unique identifier as assigned by exchange. |
Get Transactions History
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/transactions?currencies=ETH,BTC&sort=DESC"
[
{
"id": 50844835,
"created_at": "2021-06-22T21:03:04.111Z",
"updated_at": "2021-06-22T21:04:41.487Z",
"status": "SUCCESS",
"type": "WITHDRAW",
"subtype": "BLOCKCHAIN",
"native": {
"tx_id": "27fa7f14-ca49-42fd-834a-4ce630d069d2",
"index": 1071885589,
"currency": "ETH",
"amount": "0.01042",
"fee": "0.00958",
"hash": "0xfb0ba568213d11230cd34d62fddd1cc1fe11fdc173l4f2007b0e47a06ad73d20",
"address": "0xd959463c3fcb222124bb7bb642d6a6573a6c5aba",
"confirmations": 20
}
},
{
"id": 36896428,
"created_at": "2020-11-12T10:27:26.135Z",
"updated_at": "2020-11-12T10:42:29.065Z",
"status": "SUCCESS",
"type": "DEPOSIT",
"subtype": "BLOCKCHAIN",
"native": {
"tx_id": "a271ad64-5f34-4115-a63e-1cb5bbe4f67e",
"index": 429625504,
"currency": "BTC",
"amount": "0.04836614",
"hash": "4d7ae7c9d6fe84405ae167b3f0beacx8c68eb5a9d5189bckeb65d5e306427oe6",
"address": "3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv",
"confirmations": 2,
"senders": [
"0xd959463c3fcb0d2124bb7ac642d6a6573a6c5aba"
]
}
}
]
GET /api/3/wallet/transactions
Returns all transactions or a number of transactions by identifiers.
Requires the "Payment information" API key Access Right.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
from | DateTime | Interval initial value (inclusive). |
till | DateTime | Interval end value (inclusive). |
types | String | Comma-separated transaction types. |
subtypes | String | Comma-separated transaction subtypes. |
statuses | String | Comma-separated transaction statuses. Accepted values: CREATED , PENDING , FAILED , SUCCESS , ROLLED_BACK |
currencies | String | Comma-separated currency codes. |
networks | String | Comma-separated network codes. |
id_from | Number | Index interval initial value. Accepted values: 0 or greater |
id_till | Number | Index interval end value. Accepted values: 0 or greater |
tx_ids | String | Comma-separated transaction identifiers. |
order_by | String | Defines sorting type. Accepted values: created_at , id , updated_at Default value: created_at |
sort | String | Sort direction. Accepted values: DESC , ASC Default value: DESC |
limit | Number | Default value: 100 Maximum value: 1000 |
offset | Number | Default value: 0 Maximum value: 100000 |
GET /api/3/wallet/transactions/{tx_id}
Returns transaction by identifier.
Requires the "Payment information" API key Access Right.
Response:
Name | Type | Description |
---|---|---|
id | Number | Transaction unique identifier as assigned by exchange. |
status | String | Transaction status. Possible values: CREATED , PENDING , FAILED , SUCCESS , ROLLED_BACK |
type | String | Transaction type. |
subtype | String | Transaction subtype. |
created_at | DateTime | Date of transaction creation. |
updated_at | DateTime | Date of transaction last update. |
native | Native | Optional. Transaction native attributes as assigned by the platform. |
primetrust | PrimeTrust | Optional. Additional attributes assigned to Prime Trust transactions. |
meta | Meta | Optional. Additional attributes assigned to certain types of transactions. |
network_code | String | Optional. Network code. |
Native model consists of:
Name | Type | Description |
---|---|---|
tx_id | String | Transaction unique identifier as assigned by exchange. |
index | Number | Internal index value that represents when the entry was updated. |
currency | String | Currency code. |
amount | Number | Amount of funds. |
fee | Number | Payment commission value. |
address | String | Address identifier. |
payment_id | String | Optional. An additional identifier required for specific currencies (for example, "Memo"). |
hash | String | Transaction hash. |
offchain_id | String | Transaction identifier of external system. |
confirmations | Number | Current count of confirmations for transaction in network. |
public_comment | String | Optional. |
error_code | String | Payout error reason. Possible values: INVALID_ADDRESS , INVALID_PAYMENT_ID , BAD_PRECISION |
senders | Array of String | Senders for this payin transaction. Displayed only for deposits. |
PrimeTrust model consists of:
Name | Type | Description |
---|---|---|
deposit | Deposit | Optional. Transaction details as of a deposit. |
withdrawal | Withdrawal | Optional. Transaction details as of a withdrawal. |
transfer | Transfer | Optional. Transaction details as of a transfer. |
Deposit and Withdrawal models consist of:
Name | Type | Description |
---|---|---|
id | Number | Payment identifier. |
tx_id | String | Transactions identifier. |
provider_id | String | Provider identifier. |
method_id | String | Payment method identifier. |
method_type | String | Method type. Possible values: ACH , CREDIT_CARD , WIRE |
currency | String | Currency code. |
amount | String | Amount of funds. |
balance | String | Prime Trust balance. |
Transfer model consists of:
Name | Type | Description |
---|---|---|
id | Number | Payment identifier. |
tx_id | String | Transactions identifier. |
provider_id | String | Provider identifier. |
currency | String | Currency code. |
amount | String | Amount of funds. |
balance | String | Prime Trust balance. |
Meta model consists of:
Name | Type | Description |
---|---|---|
fiat_to_crypto | Fiat to Crypto | Optional. Attributes of a fiat deposit, or an order (for subtype equal to FIAT ). |
Fiat to Crypto model consists of:
Name | Type | Description |
---|---|---|
id | Number | Order identifier. |
provider_name | String | Optional. Provider name. |
order_type | String | Order type. Possible values: buy |
source_currency | String | Source currency code. |
target_currency | String | Destination currency code. |
wallet_address | String | Wallet address for the incoming payment. |
tx_hash | String | Transaction hash. |
target_amount | String | Amount in the target currency. |
source_amount | String | Amount in the source currency. |
status | String | Order status. Possible values: INITIAL —the order is created in the system but will possibly never be submitted by the user; IN_PROGRESS —the order is pending; COMPLETED —the order was successfully processed at the provider's end; FAILED —the order failed at the provider's end; EXPIRED —the order expired after not receiving an incoming fiat payment;UNKNOWN —no status obtained at the provider's end. |
created_at | DateTime | Order creation date. |
updated_at | DateTime | Optional. Date of order last update. |
deleted_at | DateTime | Optional. Date of order deletion. |
payment_method_type | String | Optional. Payment system alias. |
type
field may have the following values:
Type | Description |
---|---|
DEPOSIT |
Deposit to a wallet address. |
WITHDRAW |
Withdrawal to another crypto address. |
TRANSFER |
Transfer of funds between wallet and trading accounts. |
SWAP |
Exchange funds between different wallets. |
PRIMETRUST_DEPOSIT |
Fiat provider deposit. |
PRIMETRUST_WITHDRAWAL |
Fiat provider withdrawal. |
PRIMETRUST_TRANSFER |
Fiat provider transfer. |
subtype
field may have the following values:
Type | Subtype | Description |
---|---|---|
DEPOSIT ,WITHDRAW ,PRIMETRUST_DEPOSIT ,PRIMETRUST_WITHDRAWAL |
UNCLASSIFIED |
Deposit or withdrawal of fiat or crypto. |
DEPOSIT ,WITHDRAW |
BLOCKCHAIN |
Deposit or withdrawal of crypto committed to the Blockchain. |
DEPOSIT |
AFFILIATE |
Referral's reward payment. |
DEPOSIT |
BUY_CRYPTO |
Bying crypto with fiat. |
DEPOSIT ,WITHDRAW |
OFFCHAIN |
Deposit or withdrawal of crypto offchain. |
DEPOSIT ,WITHDRAW |
FIAT |
Fiat deposit or withdrawal. |
DEPOSIT ,WITHDRAW |
SUB_ACCOUNT |
Transfer between subaccounts. |
TRANSFER |
WALLET_TO_SPOT |
Transfer from a wallet to a spot trading account. |
TRANSFER |
SPOT_TO_WALLET |
Transfer from a futures trading account to a wallet. |
SWAP |
CHAIN_SWITCH_FROM |
Transferring funds from an original wallet during a chain swap. |
SWAP |
CHAIN_SWITCH_TO |
Transferring funds to a target wallet during a chain swap. |
PRIMETRUST_TRANSFER |
PRIMETRUST_TO_SPOT |
Transfer from a spot trading account to a fiat provider account. |
PRIMETRUST_TRANSFER |
SPOT_TO_PRIMETRUST |
Transfer from a fiat provider account to a spot trading account. |
status
field may have the following values:
Name | Description |
---|---|
CREATED |
The transaction has been created and needs to be approved. For withdrawals, the status means that the transaction has been created but not committed. It remains in this status until manually validated or moved to a blockchain. |
PENDING |
The transaction has been created and is queued until the fees are paid and it can be processed further. Also, for withdrawals and deposits, the status means that blockchain confirmations have not yet been gathered. |
FAILED |
The transaction could not be committed. |
ROLLED_BACK |
The transaction has been canceled. |
SUCCESS |
The transaction has been approved and fully processed. |
Check If Offchain is Available
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/check-offchain-available" \
-d "currency=ETH&address=0xfaEF4bE10dDF50B68c220c9ab19381e20B8EEB2B"
{
"result": true
}
POST /api/3/wallet/crypto/check-offchain-available
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
address | String | Address identifier. |
payment_id | String | Optional. An additional identifier required for specific currencies (for example, "Memo"). |
Response:
Name | Type | Description |
---|---|---|
result | String | true if an offchain transaction is available to the specified address. |
Estimate Withdrawal Fee
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/crypto/fee/estimate?currency=BTC&amount=0.01"
{
"fee": "0.000625"
}
GET /api/3/wallet/crypto/fee/estimate
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
amount | Number | The amount that will be withdrawn. |
network_code | String | Optional. Network code. |
Response:
Name | Type | Description |
---|---|---|
fee | String | Estimated withdrawal fee considering user's personal settings. The fee value is guaranteed not to change until the transaction is committed. |
Get Amount Locks
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/amount-locks?currency=BTC"
[
{
"id": 1,
"currency": "BTC",
"amount": "12.023",
"date_end": "",
"description": "default",
"canceled": false,
"canceled_at": null,
"cancel_description": null,
"created_at": "2021-07-29T12:07:09.883538Z"
}
]
GET /api/3/wallet/amount-locks
Returns a list of amount locks.
Amount locks allow to set the minimum user's balance to determine their solvency. The locked amount is not displayed in user's balances.
Amount locks are not tied to a currency. All locks in total affect the ability to withdraw the balance in any currency.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
currency | String | Optional. Currency code. |
active | Boolean | Optional. Value showing whether the lock is active. |
limit | Number | Default value: 100 Accepted range: 0 – 1000 |
offset | Number | Optional Default value: 0 Minimum value: 0 |
Response:
Name | Type | Description |
---|---|---|
id | Number | Lock identifier. |
currency | String | Currency code. |
amount | String | Reserved amount. |
date_end | DateTime | The date and time of the lock expiration. |
description | String | Lock text description. |
canceled | Boolean | Value showing whether the lock was canceled. |
canceled_at | DateTime | The date and time at which the the lock was canceled. |
cancel_description | String | Text description on cancelation. |
created_at | DateTime | The date and time of the lock was created. |
Prime Trust
Get Providers
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/providers"
[
{
"id": 1,
"name": "providerName"
}
]
GET /api/3/wallet/external/fiat/providers
Returns a list of available providers.
Requires the "Payment information" API key Access Right.
Response:
Name | Type | Description |
---|---|---|
id | Number | Provider identifier. |
name | String | Provider name. |
Get Provider
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/providers/1"
{
"id": 1,
"name": "providerName"
}
GET /api/3/wallet/external/fiat/providers/{id}
Returns a provider by its identifier.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
id | Number | Provider identifier. |
Response:
Name | Type | Description |
---|---|---|
id | Number | Provider identifier. |
name | String | Provider name. |
Get Currencies
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/currencies?provider_id=1¤cy=USD"
[
{
"provider_id": 1,
"currency": "USD",
"enabled_deposit": true,
"enabled_withdrawal": true
}
]
GET /api/3/wallet/external/fiat/currencies
Returns a list of available currencies.
Requires the "Payment information" API key Access Right.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
currency | String | Currency code. |
Response:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
currency | String | Currency code. |
enabled_deposit | Boolean | Shows whether the deposit is available for the currency. |
enabled_withdrawal | Boolean | Shows whether the withdrawal is available for the currency. |
Get Currency Balances
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/balance?provider_id=1¤cy=USD"
[
{
"provider_id": 1,
"currency": "USD",
"available": "1.23",
"pending": "0.5",
"hold": "0"
}
]
GET /api/3/wallet/external/fiat/balance
Returns a list of currency balances.
Requires the "Payment information" API key Access Right.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
currency | String | Currency code. |
Response:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
currency | String | Currency code. |
available | Number | Currency balance available for spending. |
pending | Number | Sum of all incomplete deposit amounts. This amount may become available soon. |
hold | Number | Sum of all incomplete withdrawal amounts. |
Create Plaid Widget Token
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/link-tokens" \
-H "Content-Type: application/json" \
-d '{"provider_id":1, "redirect_uri":"https://example.com/oauth.html"}'
{
"link_token": "string",
"expiration": "2020-12-25T23:45:00.000Z"
}
POST /api/3/wallet/external/fiat/link-tokens
Creates a new Link token. The token is used in a Plaid widget (for ACH
payment methods).
Requires the "Withdraw cryptocurrencies" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
redirect_uri | String | Optional. OAuth redirect URI indicating the destination where a user should be forwarded after completing the Link flow. Example: https://example.com/oauth.html (more details). |
android_package_name | String | Optional. Name of an app's Android package. Example: com.example.application (more details). |
Response:
Name | Type | Description |
---|---|---|
link_token | String | Link token string. |
expiration | String | Date until which the token can be used. |
Get Wire Deposit Instructions
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/wire-instructions?provider_id=1"
[
{
"provider_id": 1,
"bank_routing_number": "123456789",
"bank_name": "Bank Name",
"bank_address": "1234 Street St. Suite 1234, Los Angeles CA 1234",
"bank_phone": "+1 234 567 8910",
"provider_account_number": "1234567890",
"provider_account_name": "Provider Name",
"provider_account_address": "1234 Street St. Suite 1234, Los Angeles CA 1234",
"reference": "QNCUSNTW3"
}
]
GET /api/3/wallet/external/fiat/wire-instructions
Returns provider wire instructions. They should be provided to the sender's bank to make wire deposits.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Optional. Provider identifier. |
Response:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
bank_routing_number | String | ABA routing number, 9 digits. |
bank_name | String | Depository bank name. |
bank_address | String | Bank address. |
bank_phone | String | Bank phone. |
provider_account_number | String | Provider account number in a bank, 4-17 digits. |
provider_account_name | String | Provider account name in a bank. |
provider_account_address | String | Provider account address. |
reference | String | User account reference that is used to match transaction and charge deposit. |
Get Payment Method Types
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/method-types?provider_id=1&method_type=ACH"
[
{
"provider_id": 1,
"method_type": "ACH",
"enabled_deposit": true,
"customizable_deposit": true,
"enabled_withdrawal": true,
"customizable_withdrawal": true
}
]
GET /api/3/wallet/external/fiat/method-types
Returns a list of available payment method types.
Requires the "Payment information" API key Access Right.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
method_type | String | Payment method type. Accepted values: ACH , CREDIT_CARD |
enabled_deposit | Boolean | Shows whether the deposit is available for the method type. |
customizable_deposit | Boolean | Shows whether it is allowed to use different method parameters while making deposits. |
enabled_withdrawal | Boolean | Shows whether the withdrawal is available for the method type. |
customizable_withdrawal | Boolean | Shows whether it is allowed to use different method parameters while making withdrawals. |
Response:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
method_type | String | Method type. Possible values: ACH , CREDIT_CARD |
enabled_deposit | Boolean | Shows whether the deposit is available for the method type. |
customizable_deposit | Boolean | Shows whether it is allowed to use different method parameters while making deposits. |
enabled_withdrawal | Boolean | Shows whether the withdrawal is available for the method type. |
customizable_withdrawal | Boolean | Shows whether it is allowed to use different method parameters while making withdrawals. |
Get Payment Methods
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/methods?provider_id=1"
[
{
"provider_id": 1,
"method_id": "cf91c5e7-aebf-4c48-a5e6-365a7e9c834d",
"method_type": "ACH",
"enabled_deposit": true,
"enabled_withdrawal": true,
"bank_routing_number": "000000000",
"bank_name": "string",
"bank_account_name": "string",
"ip_address": "0.0.0.0",
"label": "string",
"currencies": ["USD"]
},
{
"provider_id": 1,
"method_id": "4b4b265d-904e-4efc-8e2f-041f9468c391",
"method_type": "CREDIT_CARD",
"enabled_deposit": true,
"enabled_withdrawal": false,
"credit_card_name": "JOHN DOE",
"credit_card_type": "VI",
"credit_card_last_4": "1234",
"ip_address": "0.0.0.0",
"label": "Personal Wallet Address",
"currencies": ["USD"]
}
]
GET /api/3/wallet/external/fiat/methods
Returns a list of available payment methods.
If enabled_deposit
and enabled_withdrawal
are not specified, all methods available for deposit or withdrawal will be returned.
Requires the "Payment information" API key Access Right.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
method_id | String | Payment method identifier. |
method_type | String | Method type. Accepted values: ACH , CREDIT_CARD |
currency | String | Currency code. |
enabled_deposit | Boolean | Shows whether the deposit is available for the method. |
enabled_withdrawal | Boolean | Shows whether the withdrawal is available for the method. |
Response:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
method_id | String | Payment method identifier. |
method_type | String | Method type. Possible values: ACH , CREDIT_CARD |
enabled_deposit | Boolean | Shows whether the deposit is available for the method. |
enabled_withdrawal | Boolean | Shows whether the withdrawal is available for the method. |
bank_routing_number | String | Optional. ABA routing number, 9 digits (for ACH type only). |
bank_name | String | Optional. Depository bank name (for ACH type only). |
bank_account_name | String | Optional. Bank account name (for ACH type only). |
credit_card_name | String | Optional. Name of a credit card which was supplied to the widget (for CREDIT_CARD type only). |
credit_card_type | String | Optional. Payment service code. For example: AE (American Express), MC (MasterCard), VI (Visa), etc. (for CREDIT_CARD type only). |
credit_card_last_4 | String | Optional. Last 4 digits of a credit card number (for CREDIT_CARD type only). |
ip_address | String | IP address provided by user or detected automatically. |
label | String | An optional text label (if supplied). |
currencies | Array | List of currencies, supported by the method. |
Create Payment Method
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/methods" \
-d '{"provider_id":1, "method_type":"ACH", "plaid_public_token":"public-sandbox-b0e2c4ee-a763-4df5-bfe9-46a46bce993d", "plaid_account_id":"ygPnJweommTWNr9doD6ZfGR6GGVQy7fyREmWy"}'
{
"method_id": "cf91c5e7-aebf-4c48-a5e6-365a7e9c834d"
}
POST /api/3/wallet/external/fiat/methods
Creates a new payment method. Used only for ACH
, because CREDIT_CARD
methods are created by the provider's credit card widget.
Requires the "Withdraw cryptocurrencies" API key Access Right.
To create an ACH
method, the user should:
- Create a Link token.
- Provide obtained token to Plaid widget.
- Get Plaid
public_token
andaccounts[0].id
from the widget output. - Send a payment method creation request with these
public_token
(plaid_public_token
) andaccounts[0].id
(plaid_account_id
).
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Optional. Provider identifier. |
method_type | String | Optional. Method type. Accepted values: ACH |
plaid_public_token | String | Optional. Plaid public_token , obtained from the Link onSuccess callback (required for ACH method). |
plaid_account_id | String | Optional. Plaid account_id[0].id , obtained from the Link onSuccess callback (required for ACH method). |
bank_routing_number | String | Optional. ABA routing number. |
bank_account_number | String | Optional. Bank account number. |
bank_account_name | String | Optional. Bank account name. |
ip_address | String | IP address (provided by user or detected automatically). |
label | String | Optional. Text label. |
Response:
Name | Type | Description |
---|---|---|
method_id | String | Payment method identifier. |
Delete Payment Method
curl -X DELETE -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/methods?provider_id=1&method_id=cf91c5e7-aebf-4c48-a5e6-365a7e9c834d"
{
"success": true
}
DELETE /api/3/wallet/external/fiat/methods
Removes an existing provider payment method by the combination of its identifier and provider identifier.
Requires the "Withdraw cryptocurrencies" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
method_id | String | Payment method identifier. |
Response:
Name | Type | Description |
---|---|---|
success | Boolean | Shows whether the method was deleted successfully. |
Create Deposit
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/deposit" \
-d '{"provider_id":1, "method_id":"cf91c5e7-aebf-4c48-a5e6-365a7e9c834d", "currency":"USD", "amount":"50.0"}'
{
"request_id": "1cc2f3fe-e3aa-48d6-966b-9b8a61030dd0",
"status": "CREATED"
}
POST /api/3/wallet/external/fiat/deposit
Create a new provider deposit request.
Requires the "Withdraw cryptocurrencies" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Optional. Provider identifier. |
method_id | Number | Method identifier. |
currency | String | Currency code. |
amount | String | Transaction amount. |
three_ds_challenge_id | String | Optional. 3-D Secure challenge identifier received from the widget. |
Response:
Name | Type | Description |
---|---|---|
request_id | String | Idempotent operation identifier. |
status | String | Transaction status. Possible values: CREATED , PENDING , SUCCESS , ROLLED_BACK , FAILED |
Create Withdrawal
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/withdraw" \
-d '{"provider_id":1, "method_id":"cf91c5e7-aebf-4c48-a5e6-365a7e9c834d", "currency":"USD", "amount":"50.0"}'
{
"request_id": "1cc2f3fe-e3aa-48d6-966b-9b8a61030dd0",
"status": "PENDING"
}
POST /api/3/wallet/external/fiat/withdraw
Create a new provider withdrawal request.
Requires the "Withdraw cryptocurrencies" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Optional. Provider identifier. |
method_id | Number | Method identifier. |
currency | String | Currency code. |
amount | Number | Transaction amount. |
Response:
Name | Type | Description |
---|---|---|
request_id | String | Idempotent operation identifier. |
status | String | Transaction status. Possible values: PENDING |
Create Transfer
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/wallet/external/fiat/transfer" \
-d '{"provider_id":1, "transfer_type":"PRIMETRUST_TO_SPOT", "currency":"USD", "amount":"50.0"}'
{
"request_id": "1cc2f3fe-e3aa-48d6-966b-9b8a61030dd0",
"status": "PENDING"
}
POST /api/3/wallet/external/fiat/transfer
Create a new provider transfer request.
Requires the "Withdraw cryptocurrencies" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Optional. Provider identifier. |
transfer_type | String | Transfer direction. Accepted values: PRIMETRUST_TO_SPOT , SPOT_TO_PRIMETRUST , PRIMETRUST_TO_DERIVATIVES , DERIVATIVES_TO_PRIMETRUST |
currency | String | Currency code. |
amount | Number | Transaction amount. |
Response:
Name | Type | Description |
---|---|---|
request_id | String | Idempotent operation identifier. |
status | String | Transaction status. Possible values: PENDING |
Sub-accounts
Get Sub-accounts List
curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account"
Response:
{
"result": [
{
"sub_account_id": "179B5D",
"email": "user+1@example.com",
"status": "active"
},
{
"sub_account_id": "179B5E",
"email": "user+2@example.com",
"status": "active"
},
{
"sub_account_id": "179B5F",
"email": "user+3@example.com",
"status": "disable"
}
]
}
Error response example:
Failed authorization:
{
"error": {
"code": 1002,
"message": "Authorization is required or has been failed"
}
}
Empty sub-account's list:
{
"result": []
}
GET /api/3/sub-account
Returns list of sub-accounts per a super account.
Requires no API key Access Rights.
Response:
Name | Type | Description |
---|---|---|
sub_account_id | String | Unique identifier of a sub-account. Hex number. |
String | Email address of a sub-account. | |
status | String | User status of a sub-account. Possible values: new , active , disable |
Freeze Sub-account
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/sub-account/freeze" \
-d "sub_account_ids=179B5D,179B5E"
Response:
{
"result": true
}
Error response example:
Sub-accounts are already frozen or disabled:
{
"error": {
"code": 21004,
"message": "Sub account is already frozen or disabled"
}
}
POST /api/3/sub-account/freeze
Freezes sub-accounts listed. It implies that the Sub-accounts frozen wouldn't be able to:
- login;
- withdraw funds;
- trade;
- complete pending orders;
- use API keys.
For any sub-account listed, all orders will be canceled and all funds will be transferred from the Trading balance.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
sub_account_ids | Array | Sub-accounts' identifiers separated by commas (,). Those could be obtained by the GET /api/3/sub-account request. |
Response:
Name | Type | Description |
---|---|---|
result | Boolean | Value indicating whether sub-accounts were successfully frozen. |
Activate Sub-account
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/sub-account/activate" \
-d "sub_account_ids=179B5D,179B5E"
Response:
{
"result": true
}
Error response example:
Sub-accounts are disabled, and their functionality can't be restored through activation:
{
"result": false
}
Failed authorization:
{
"error": {
"code": 1002,
"message": "Authorization is required or has been failed"
}
}
Wrong input data format:
{
"error": {
"code": 10001,
"message": "Validation error"
}
}
Sub-accounts listed don't exist:
{
"error": {
"code": 21001,
"message": "Cannot find sub account"
}
}
POST /api/3/sub-account/activate
Activates sub-accounts listed. It would make sub-accounts active after being frozen.
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
sub_account_ids | Array | Sub-accounts' identifiers separated by commas (,). Those could be obtained by the GET /api/3/sub-account request. |
Response:
Name | Type | Description |
---|---|---|
result | Boolean | Value indicating whether sub-accounts were successfully activated. |
Transfer Funds
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/sub-account/transfer" \
-d "sub_account_id=179B5D&amount=1¤cy=BTC&type=to_sub_account"
Response:
{
"result": "ae37e806-0191-45fc-8c49-18137274772c"
}
Error response example:
Insufficient permissions:
{
"error": {
"code": 1003,
"message": "Action is forbidden for this API key"
}
}
Sub-account is frozen or disabled:
{
"error": {
"code": 21004,
"message": "Sub account is already frozen or disabled"
}
}
Insufficient funds:
{
"error": {
"code": 20001,
"message": "Insufficient funds",
"description": "Check that the funds are sufficient, given commissions"
}
}
POST /api/3/sub-account/transfer
Transfers funds from the super-account to a sub-account or from a sub-account to the super-account.
Requires the "Withdraw cryptocurrencies" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
sub_account_id | Number | Identifier of a sub-account to deposit/withdraw funds. |
amount | Number | Amount of funds to be transferred. |
currency | String | Name (code) of base currency (e.g., "BTC" ). |
type | String | Type of transaction. Accepted values: to_sub_account , from_sub_account |
Response:
Name | Type | Description |
---|---|---|
result | String | Identifier of the transaction resulting. |
Get ACL Settings
curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account/acl?sub_account_ids=179B5D,179B5E"
Response:
{
"result": [
{
"sub_account_id": "179B5E",
"deposit_address_generation_enabled": true,
"withdraw_enabled": true,
"description": "",
"created_at": "2021-07-30T14:50:08.621Z",
"updated_at": "2021-07-30T14:50:08.621Z"
}
]
}
Error response example:
Insufficient permissions:
{
"error": {
"code": 1003,
"message": "Action is forbidden for this API key"
}
}
Sub-account is frozen or disabled:
{
"error": {
"code": 21004,
"message": "Sub account is already frozen or disabled"
}
}
GET /api/3/sub-account/acl
Returns a list of withdrawal settings for sub-accounts listed.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
sub_account_ids | Array | Optional. Sub-accounts' identifiers separated by commas (,). Those could be obtained by the GET /api/3/sub-account request. |
Response:
Name | Type | Description |
---|---|---|
sub_account_id | String | Unique identifier of a sub-account. |
deposit_address_generation_enabled | Boolean | Value indicating the desired state of deposits. |
withdraw_enabled | Boolean | Value indicating the desired state of withdrawals. |
description | String | Textual description. Normally left empty. |
created_at | DateTime | ACL creation time. |
updated_at | DateTime | ACL update time. |
Change ACL Settings
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/sub-account/acl" \
-d "sub_account_ids=179B5E&deposit_address_generation_enabled=true&withdraw_enabled=true"
Response:
{
"result": [
{
"sub_account_id": "179B5E",
"deposit_address_generation_enabled": true,
"withdraw_enabled": true,
"description": "",
"created_at": "2021-07-30T14:50:08.621Z",
"updated_at": "2021-07-30T14:50:08.621Z"
}
]
}
Error response example:
Sub-account is frozen or disabled:
{
"error": {
"code": 21004,
"message": "Sub account is already frozen or disabled"
}
}
Insufficient permissions:
{
"error": {
"code": 1003,
"message": "Action is forbidden for this API key"
}
}
POST /api/3/sub-account/acl
Disables or enables withdrawals for a sub-account.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
sub_account_ids | Array | Sub-accounts' identifiers separated by commas (,). Those could be obtained by the GET /api/3/sub-account request. |
deposit_address_generation_enabled | Boolean | Value indicating the desired state of deposits. |
withdraw_enabled | Boolean | Value indicating the desired state of withdrawals. |
description | String | Textual description. Normally left empty. |
created_at | DateTime | ACL creation time. |
updated_at | DateTime | ACL update time. |
Response:
Name | Type | Description |
---|---|---|
sub_account_id | String | Unique identifier of a sub-account. |
deposit_address_generation_enabled | Boolean | Value indicating the desired state of deposits. |
withdraw_enabled | Boolean | Value indicating the desired state of withdrawals. |
description | String | Textual description. Normally left empty. |
created_at | DateTime | ACL creation time. |
updated_at | DateTime | ACL update time. |
Get Sub-account Balance
curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/sub-account/balance/179B5E"
Response:
{
"result": {
"wallet": [
{
"currency": "1ST",
"available": "0.0",
"reserved": "0.0"
}
],
"spot": [
{
"currency": "1ST",
"available": "0",
"reserved": "0"
}
]
}
}
Error response example:
Insufficient permissions:
{
"error": {
"code": 1003,
"message": "Action is forbidden for this API key"
}
}
GET /api/3/sub-account/balance/{sub_acc_id}
Returns non-zero balance values by sub-account identifier specified. Report will include the wallet and Trading balances for each currency. It is functional with no regard to the state of a sub-account. All account types are optional and appear only in case of non-zero balance.
Requires the "Payment information" API key Access Right.
Get Sub-account Crypto Address
curl -X GET -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/sub-account/crypto/address/179B5E/BTC"
Response:
{
"result": {
"address": "3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv"
}
}
GET /api/3/sub-account/crypto/address/{sub_acc_id}/{currency}
Returns sub-account crypto address for currency.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
network_code | String | Optional. Network code. |
Response:
Name | Type | Description |
---|---|---|
address | String | Address for deposits. |
payment_id | String | Optional. An additional identifier required for specific currencies (for example, "Memo"). |
public_key | String | Optional. An additional identifier required for specific currencies. |
Buy Crypto
You can purchase cryptocurrency on our platform. The current section requests allow receiving the list of providers, available for buying crypto, and information about them. You can receive rates and orders, and create orders using these API methods as well.
Get Providers Information
curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/buy-crypto/provider"
Response:
[
{
"provider_id": 2,
"provider_name": "provider",
"methods": [
{
"id": 0,
"name": "credit_debit_card",
"description": "",
"method_type": "credit_card",
"logo_url": "https://example.com/logo.png",
"status": "ACTIVE",
"type": "credit_debit_card",
"supported_source": [
{
"code": "USD",
"display_name": "USD"
}
],
"supported_target": [
{
"code": "ETH",
"display_name": "ETH"
}
],
"transaction_limits": [
{
"currency_code": "USD",
"target_code": "ETH",
"source_min": "0",
"source_max": "124"
}
]
}
]
}
]
GET /api/3/buy-crypto/provider
Returns the providers' information (transaction limits, available currencies, payment methods).
Requires the "Payment information" API key Access Right.
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
source | String | The source (fiat) currency code. |
target | String | The target (crypto) currency code. |
Response:
Name | Type | Description |
---|---|---|
provider_id | Number | Provider identifier. |
provider_name | String | Provider name. |
methods | Array of Method | Payment methods list. |
Method model consists of:
Name | Type | Description |
---|---|---|
id | Number | Payment method identifier. |
name | String | Payment method name. |
description | String | Payment method text description. |
method_type | String | Method type. |
logo_url | String | Payment method logo URL. |
status | String | Payment method status. Possible values: active |
type | String | Payment method type. |
supported_source | Array of Currency | The source currencies, supported by the payment method. |
supported_target | Array of Currency | The target currencies, supported by the payment method. |
transaction_limits | Array of Limit | Payment method limits. |
Currency model consists of:
Name | Type | Description |
---|---|---|
code | String | The currency code. |
display_name | String | The currency display name. |
Limit model consists of:
Name | Type | Description |
---|---|---|
currency_code | String | Transaction source currency code. |
target_code | String | Transaction target currency code. |
source_min | String | Minimum source currency amount. |
source_max | String | Maximum source currency amount. |
Get Rates per Payment Method
curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/buy-crypto/provider/1/rate"
Response:
{
"spot_price": "10268.74",
"prices": [
{
"payment_method_id": 6025,
"type": "credit_debit_card",
"target_code": "BTC",
"target_amount": "1",
"source_code": "USD",
"source_amount": "10472.06"
}
]
}
GET /api/3/buy-crypto/provider/{provider_id}/rate
Returns the rates information per payment method.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
source | String | Source currency code. |
target | String | Target currency code. |
source_amount | String | Optional. Amount in the source currency. |
target_amount | String | Optional. Amount in the target currency. |
payment_method_id | Number | Optional. Payment method identifier. |
Response:
Name | Type | Description |
---|---|---|
spot_price | String | The spot price. |
prices | Array of Price | Prices list. |
Price model consists of:
Name | Type | Description |
---|---|---|
payment_method_id | Number | Payment method identifier. |
type | String | Payment method type. |
target_code | String | Target currency code. |
source_code | String | Source currency code. |
target_amount | String | Amount in the target currency. |
source_amount | String | Amount in the source currency. |
Get Order List
curl -X GET -u "apiKey:secretKey" "https://api.crosstower.com/api/3/buy-crypto/provider/1/order"
Response:
[
{
"id": 79,
"provider_id": 1,
"order_type": "buy",
"source_code": "BTC",
"target_code": "GBP",
"wallet_address": "2N2gCeg7C1zKvZpFkdNNEnRFux9VSttzSVx",
"checkout_url": "",
"status": "expired",
"created_at": "2021-06-07T10:04:40Z"
}
]
GET /api/3/buy-crypto/provider/{provider_id}/order
Returns the list of buying cryptocurrency orders.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
from | Number | Unix timestamp, filter by order creation date. |
till | Number | Unix timestamp, filter by order creation date. |
limit | Number | Optional. Limit. |
offset | Number | Optional. Offset. |
source_code | String | Optional. Source currency code. |
target_code | String | Optional. Target currency code. |
wallet_address | String | Optional. Filter by wallet address. |
Response:
Name | Type | Description |
---|---|---|
id | String | Order identifier. |
provider_id | Number | Provider identifier. |
order_type | String | Provider order type (buy). |
source_code | String | Source currency code. |
target_code | String | Target currency code. |
wallet_address | String | The user will receive cryptocurrency from the crypto provider to this address. This address is generated and provided to the crypto provider by the exchange (by us). |
checkout_url | String | Checkout URL. |
status | String | Provider order status. Possible values: initial , in_progress , completed , failed , expired |
created_at | String | Order creation date and time. |
operation_id | String | Operation identifier. |
Create Order
curl -X POST -u "apiKey:secretKey" \
"https://api.crosstower.com/api/3/buy-crypto/provider/1/order" \
-H "Content-Type: application/json" \
-d '{"target":"BTC", "source":"EUR", "source_amount":"20", "payment_method_id":6037}'
Response:
{
"id": 79,
"provider_id": 1,
"order_type": "buy",
"source_code": "BTC",
"target_code": "GBP",
"wallet_address": "2N2gCeg7C1zKvZpFkdNNEnRFux9VSttzSVx",
"checkout_url": "",
"status": "expired",
"created_at": "2021-06-07T10:04:40Z"
}
POST /api/3/buy-crypto/provider/{provider_id}/order
Creates an order. The checkout_url
will lead to a provider's widget page.
Requires the "Payment information" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
target | String | Target currency. |
source | String | Source currency. |
source_amount | String | Amount in source currency. |
target_amount | String | Optional. Amount in target currency. |
payment_method_id | Number | Payment method identifier to use. |
ip | String | Optional. IP address. |
user_agent | String | Optional. User's client agent. |
Response:
Name | Type | Description |
---|---|---|
id | Number | Order identifier. |
provider_id | Number | Provider identifier. |
order_type | String | Provider order type (buy). |
source_code | String | Source currency code. |
target_code | String | Target currency code. |
wallet_address | String | The user will receive cryptocurrency from the crypto provider to this address. This address is generated and provided to the crypto provider by the exchange. |
checkout_url | String | Checkout URL. |
status | String | Provider order status. Possible values: initial , in_progress , completed , failed , expired |
created_at | String | Order creation date and time. |
operation_id | String | Operation identifier. |
Socket API Reference
Ping
wscat -c wss://api.crosstower.com/api/3/ws/public -P
Ping messages
< Received ping
< Received ping
< Received ping
After a WebSocket connection is established, the system sends ping messages to the client each 30 seconds.
In order to see incoming ping messages, place -P
flag after the endpoint.
Request Object
Request
{
"method": "spot_new_order",
"params": {
"client_order_id": "57d5525562c945448e3cbd559bd068c4",
"symbol": "ETHBTC",
"side": "sell",
"price": "0.059837",
"quantity": "0.015"
},
"id": 123
}
An RPC call is represented by sending a Request object to a Server.
The Request object has the following members:
method
— a String containing the name of the method to be invoked;params
— a Structured value that holds the parameter values to be used during the invocation of the method;id
— An identifier established by the Client that MUST contain a String, Number, ornull
value if included. If it is not included it is assumed to be a notification. The value SHOULD NOT benull
.
Notification
Notification
{
"ch": "trades",
"update": {
"BTCUSDT": [{
"t": 1626861123552,
"i": 1555634359,
"p": "30877.68",
"q": "0.00006",
"s": "sell"
}]
}
}
A Notification is a Request object without an id
member. A Request object (a Notification) signifies the lack of the Client's interest in the corresponding Response object. Therefore, no Response objects need to be returned to the Client.
The Notification object has the following members:
method
— a string containing the name of the method to be invoked;params
— a structured value holding the parameter values to be used during the method invocation.
Response Object
When a RPC call is made, the Server MUST reply with a Response, except for Notifications cases.
Response on success subscription is true
. Example:
Response
{
"result": true,
"id": 123
}
Response error
{
"error": {
"code": 2001,
"message": "Symbol not found",
"description": "Symbol not found"
},
"id": 123
}
The Response is represented as a single JSON Object, with the following members:
result
— this member is REQUIRED on success. This member MUST NOT exist if there was an error during method invocation. The value of this member is determined by the method invoked on the Server;error
— this member is REQUIRED on error. This member MUST NOT exist if there was no error triggered during method invocation. The value for this member MUST be an Object as defined in the "Error Response" section.
Socket Market Data
In order to access market data via WebSocket interface, connect to the endpoint:
wscat -c wss://api.crosstower.com/api/3/ws/public
Request
{
"method": "subscribe",
"ch": "orderbook/top/1000ms", // Channel
"params": {
"symbols": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
From that point on, you will be able to send request messages in JSON format with the following parameters:
Name | Type | Description |
---|---|---|
method | String | The name of the method to be invoked. Accepted values: subscribe , unsubscribe , subscriptions |
ch | String | Channel name. |
params | JSON | Parameter values to be used during the method invocation. The set of parameters may vary depending on the channel chosen. |
id | String | Optional. Request identifier as assigned by sender. |
Response
{
"result": {
"ch": "orderbook/top/1000ms", // Channel
"subscriptions": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
Any valid and successfully processed request will result in a JSON-formatted response message containing the following fields:
Name | Type | Description |
---|---|---|
result | Result | Details about resulting subscription status. |
id | String | Optional. Request identifier as assigned by sender. |
Result model consists of:
Name | Type | Description |
---|---|---|
ch | String | Channel name. |
subscriptions | Array of String | List of active subscriptions. |
Subscriptions
In case of a successful subscriptions, the server will send:
- for
price/rate/{speed}
,ticker/price/{speed}
,ticker/{speed}
,orderbook/{depth}/{speed}
,orderbook/top/{speed}
: data notifications (data
) with a specified rate.{speed}
— the period of updating data which embraces the changes that have occurred if any; - for
trades
,orderbook/full
,candles/{period}
: snapshot (snapshot
) and update (update
) notifications.
In the second case, the first snapshot comes right after the response if the limit
parameter is greater than 0. Snapshot gives a full account of the market within the defined scope, and an update contains only recent changes which are being sent immediately.
Batch Notifications
If a market data request includes a number subscriptions, a choice of channel will determine the distribution of updates over incoming notifications.
In the basic scenario, a single notification will contain data on a particular symbol only. Subscription to "batch" channels (ones ending with /batch
) allows notifying via combined updates per multiple symbols.
Get Active Subscriptions
Request
{
"method": "subscriptions",
"ch": "trades", // Channel
"params": {"symbols": ["ETHBTC", "BTCUSDT"]},
"id": 123
}
Response
{
"result": {
"ch": "trades", // Channel
"subscriptions": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
Method: subscriptions
Returns the list of all active subscriptions on a channel.
Subscribe to Trades
Request
{
"method": "subscribe",
"ch": "trades", // Channel
"params": {
"symbols": ["ETHBTC", "BTCUSDT"],
"limit": 1
},
"id": 123
}
Response
{
"result": {
"ch": "trades", // Channel
"subscriptions": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
Notification snapshot
{
"ch": "trades", // Channel
"snapshot": {
"BTCUSDT": [{
"t": 1626861109494, // Timestamp in milliseconds
"i": 1555634969, // Trade identifier
"p": "30881.96", // Price
"q": "12.66828", // Quantity
"s": "buy" // Side
}]
}
}
Notification update
{
"ch": "trades",
"update": {
"BTCUSDT": [{
"t": 1626861123552,
"i": 1555634969,
"p": "30877.68",
"q": "0.00006",
"s": "sell"
}]
}
}
Channel: trades
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. |
limit | Number | Optional. Limit to returned entries. Accepted values: 0 – 1000 Default value: 0 (no history returned) |
Subscribe to Candles
Request
{
"method": "subscribe",
"ch": "candles/M1", // Channel
"params": {
"symbols": ["BTCUSDT"],
"limit": 10
},
"id": 123
}
Response
{
"result": {
"ch": "candles/M1",
"subscriptions": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
Notification snapshot
{
"ch": "candles/M1", // Channel
"snapshot": {
"BTCUSDT": [{
"t": 1626860340000, // Message timestamp
"o": "30881.95", // Open price
"c": "30890.96", // Last price
"h": "30900.8", // High price
"l": "30861.27", // Low price
"v": "1.27852", // Base asset volume
"q": "39493.9021811" // Quote asset volume
}, {
"t": 1626860400000,
"o": "30888.33",
"c": "30860.52",
"h": "30889.53",
"l": "30860.31",
"v": "3.80019",
"q": "117283.0686182"
}, {
"t": 1626860460000,
"o": "30858.39",
"c": "30863.56",
"h": "30864.89",
"l": "30853.83",
"v": "53.04288",
"q": "1636858.7119248"
}]
}
}
Notification update
{
"ch": "candles/M1",
"update": {
"ETHBTC": [{
"t": 1626860880000,
"o": "0.060711",
"c": "0.060749",
"h": "0.060749",
"l": "0.060711",
"v": "12.2800",
"q": "0.7455339675"
}]
}
}
Channel: candles/{period}
Supported periods: M1
(one minute), M3
, M5
, M15
, M30
, H1
(one hour), H4
, D1
(one day), D7
, 1M
(one month)
Requires no API key Access Rights.
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. |
limit | Number | Optional. Limit to returned entries. Accepted values: 0 – 1000 Default value: 0 (no history returned) |
Subscribe to Price Rates
Request
{
"method": "subscribe",
"ch": "price/rate/1s", // Channel
"params": {
"currencies": ["ETH","BTC"],
"target_currency": "USDT"
},
"id": 123
}
Response
{
"result": {
"ch": "price/rate/1s", // Channel
"target_currency": "USDT",
"subscriptions": ["ETH","BTC"]
},
"id": 123
}
Data notification
{
"ch": "price/rate/1s",
"target_currency": "USDT",
"data": {
"ETH": {
"t": 1684490221380, // Timestamp
"r": "1810.155" // Rate
}
}
}
{
"ch": "price/rate/1s",
"target_currency": "USDT",
"data": {
"BTC": {
"t": 1684487340001,
"r": "26863.71"
}
}
}
Channel: price/rate/{speed}
Supported speed: 1s
, 3s
Parameters:
Name | Type | Description |
---|---|---|
currencies | Array of String | List of currency codes. Value ["*"] means all symbols are selected. |
target_currency | String | Quote currency. |
Subscribe to Price Rates in Batches
Request
{
"method": "subscribe",
"ch": "price/rate/1s/batch", // Channel
"params": {
"currencies": ["ETH","BTC"],
"target_currency": "USDT"
},
"id": 123
}
Response
{
"result": {
"ch": "price/rate/1s/batch", // Channel
"target_currency": "USDT",
"subscriptions": ["ETH","BTC"]
},
"id": 123
}
Data notification
{
"ch": "price/rate/1s/batch",
"target_currency": "USDT",
"data": {
"ETH": {
"t": 1684490221380, // Timestamp
"r": "1810.155" // Rate
},
"BTC": {
"t": 1684487340001,
"r": "26863.71"
}
}
}
Channel: price/rate/{speed}/batch
Supported speed: 1s
, 3s
Parameters:
Name | Type | Description |
---|---|---|
currencies | Array of String | List of currency codes. Value ["*"] means all symbols are selected. |
target_currency | String | Quote currency. |
Subscribe to Mini Ticker
Request
{
"method": "subscribe",
"ch": "ticker/price/1s", // Channel
"params": {
"symbols": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Response
{
"result": {
"ch": "ticker/price/1s", // Channel
"subscriptions": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Data notification
{
"ch": "ticker/price/1s",
"data": {
"ETHBTC": {
"t": 1614815872000, // Timestamp in milliseconds
"o": "0.030781", // Open price
"c": "0.060043", // Last price
"h": "0.031788", // High price
"l": "0.030733", // Low price
"v": "62.587", // Base asset volume
"q": "1.951420577" // Quote asset volume
}
}
}
{
"ch": "ticker/price/1s",
"data": {
"BTCUSDT": {
"t": 1614815872030,
"o": "32636.79",
"c": "32085.51",
"h": "33379.92",
"l": "30683.28",
"v": "11.90667",
"q": "384081.1955629"
}
}
}
Channel: ticker/price/{speed}
Supported speed: 1s
, 3s
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. Value ["*"] means all symbols are selected. |
Subscribe to Mini Ticker in Batches
Request
{
"method": "subscribe",
"ch": "ticker/price/1s/batch", // Channel
"params": {
"symbols": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Response
{
"result": {
"ch": "ticker/price/1s/batch", // Channel
"subscriptions": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Data notification
{
"ch": "ticker/price/1s/batch",
"data": {
"ETHBTC": {
"t": 1614815872000, // Timestamp in milliseconds
"o": "0.030781", // Open price
"c": "0.060043", // Last price
"h": "0.031788", // High price
"l": "0.030733", // Low price
"v": "62.587", // Base asset volume
"q": "1.951420577" // Quote asset volume
},
"BTCUSDT": {
"t": 1614815872030,
"o": "32636.79",
"c": "32085.51",
"h": "33379.92",
"l": "30683.28",
"v": "11.90667",
"q": "384081.1955629"
}
}
}
Channel: ticker/price/{speed}/batch
Supported speed: 1s
, 3s
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. Value ["*"] means all symbols are selected. |
Subscribe to Ticker
Request
{
"method": "subscribe",
"ch": "ticker/1s", // Channel
"params": {
"symbols": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Response
{
"result": {
"ch": "ticker/1s", // Channel
"subscriptions": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Data notification
{
"ch": "ticker/1s",
"data": {
"ETHBTC": {
"t": 1614815872000, // Timestamp in milliseconds
"a": "0.031175", // Best ask
"A": "0.03329", // Best ask quantity
"b": "0.031148", // Best bid
"B": "0.10565", // Best bid quantity
"c": "0.031210", // Last price
"o": "0.030781", // Open price
"h": "0.031788", // High price
"l": "0.030733", // Low price
"v": "62.587", // Base asset volume
"q": "1.951420577", // Quote asset volume
"p": "0.000429", // Price change
"P": "1.39", // Price change percent
"L": 1182694927 // Last trade identifier
}
}
}
{
"ch": "ticker/1s",
"data": {
"BTCUSDT": {
"t": 1614815872050,
"a": "32289.55",
"A": "0.41210",
"b": "32286.67",
"B": "1.70049",
"c": "0.057069",
"o": "0.030545",
"h": "0.029653",
"l": "0.031804",
"v": "11.90667",
"q": "384081.1955629",
"p": "0.003131",
"P": "2.77",
"L": 1182694927
}
}
}
Channel: ticker/{speed}
Supported speed: 1s
, 3s
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. Value ["*"] means all symbols are selected. |
Subscribe to Ticker in Batches
Request
{
"method": "subscribe",
"ch": "ticker/1s/batch", // Channel
"params": {
"symbols": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Response
{
"result": {
"ch": "ticker/1s/batch", // Channel
"subscriptions": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Data notification
{
"ch": "ticker/1s/batch",
"data": {
"ETHBTC": {
"t": 1614815872000, // Timestamp in milliseconds
"a": "0.031175", // Best ask
"A": "0.03329", // Best ask quantity
"b": "0.031148", // Best bid
"B": "0.10565", // Best bid quantity
"c": "0.031210", // Last price
"o": "0.030781", // Open price
"h": "0.031788", // High price
"l": "0.030733", // Low price
"v": "62.587", // Base asset volume
"q": "1.951420577", // Quote asset volume
"p": "0.000429", // Price change
"P": "1.39", // Price change percent
"L": 1182694927 // Last trade identifier
},
"BTCUSDT": {
"t": 1614815872050,
"a": "32289.55",
"A": "0.41210",
"b": "32286.67",
"B": "1.70049",
"c": "0.057069",
"o": "0.030545",
"h": "0.029653",
"l": "0.031804",
"v": "11.90667",
"q": "384081.1955629",
"p": "0.003131",
"P": "2.77",
"L": 1182694927
}
}
}
Channel: ticker/{speed}/batch
Supported speed: 1s
, 3s
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. Value ["*"] means all symbols are selected. |
Subscribe to Full Order Book
Request
{
"method": "subscribe",
"ch": "orderbook/full", // Channel
"params": {
"symbols": ["ETHBTC"]
},
"id": 123
}
Response
{
"result": {
"ch": "orderbook/full", // Channel
"subscriptions": ["ETHBTC"]
},
"id": 123
}
Notification snapshot
{
"ch": "orderbook/full", // Channel
"snapshot": {
"ETHBTC": {
"t": 1626866578796, // Timestamp in milliseconds
"s": 27617207, // Sequence number
"a": [ // Asks
["0.060506", "0"],
["0.060549", "12.6431"],
["0.060570", "0"],
["0.060612", "0"]
],
"b": [ // Bids
["0.060439", "4.4095"],
["0.060414", "0"],
["0.060407", "7.3349"],
["0.060390", "0"]
]
}
}
}
Notification update
{
"ch": "orderbook/full",
"update": {
"ETHBTC": {
"t": 1626866578902,
"s": 27617208,
"a": [
["0.060508", "0"],
["0.060509", "2.5486"]
],
"b": [
["0.060501", "3.9000"],
["0.060500", "3.0459"]
]
}
}
}
Channel: orderbook/full
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. |
Subscribe to Partial Order Book
Request
{
"method": "subscribe",
"ch": "orderbook/D5/100ms", // Channel
"params": {
"symbols": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Response
{
"result": {
"ch": "orderbook/D5/100ms", // Channel
"subscriptions": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Data notification
{
"ch": "orderbook/D5/100ms", // Channel
"data": {
"BTCUSDT": {
"t": 1626958488996, // Timestamp in milliseconds
"s": 29472321, // Sequence number
"a": [ // Asks
["32091.84", "0.01016"],
["32091.85", "0.41484"],
["32095.82", "0.00705"],
["32095.95", "0.52001"],
["32097.04", "0.20518"]
],
"b": [ // Bids
["32089.29", "0.00228"],
["32088.70", "0.40315"],
["32084.29", "0.00616"],
["32084.27", "0.53169"],
["32078.89", "0.01016"]
]
},
"ETHBTC": {
"t": 1626958488990,
"s": 28438797,
"a": [
["0.061873", "4.8257"],
["0.061887", "1.9938"],
["0.061912", "0.5427"],
["0.061913", "0.1696"],
["0.061914", "0.1575"]
],
"b": [
["0.061867", "0.9868"],
["0.061858", "0.1598"],
["0.061854", "1.8327"],
["0.061850", "0.8125"],
["0.061842", "0.1763"]
]
}
}
}
Channel: orderbook/{depth}/{speed}
Supported depth: D5
, D10
, D20
Supported speed: 100ms
, 500ms
, 1000ms
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. Value ["*"] means all symbols are selected. |
Subscribe to Partial Order Book in Batches
Request
{
"method": "subscribe",
"ch": "orderbook/D5/1000ms/batch", // Channel
"params": {
"symbols": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Response
{
"result": {
"ch": "orderbook/D5/1000ms/batch", // Channel
"subscriptions": ["ETHBTC","BTCUSDT"]
},
"id": 123
}
Data notification
{
"ch": "orderbook/D5/1000ms/batch", // Channel
"data": {
"BTCUSDT": {
"t": 1626958488996, // Timestamp in milliseconds
"s": 29472321, // Sequence number
"a": [ // Asks
["32091.84", "0.01016"],
["32091.85", "0.41484"],
["32095.82", "0.00705"],
["32095.95", "0.52001"],
["32097.04", "0.20518"]
],
"b": [ // Bids
["32089.29", "0.00228"],
["32088.70", "0.40315"],
["32084.29", "0.00616"],
["32084.27", "0.53169"],
["32078.89", "0.01016"]
]
},
"ETHBTC": {
"t": 1626958488990,
"s": 28438797,
"a": [
["0.061873", "4.8257"],
["0.061887", "1.9938"],
["0.061912", "0.5427"],
["0.061913", "0.1696"],
["0.061914", "0.1575"]
],
"b": [
["0.061867", "0.9868"],
["0.061858", "0.1598"],
["0.061854", "1.8327"],
["0.061850", "0.8125"],
["0.061842", "0.1763"]
]
}
}
}
Channel: orderbook/{depth}/{speed}/batch
Supported depth: D5
, D10
, D20
Supported speed: 100ms
, 500ms
, 1000ms
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. Value ["*"] means all symbols are selected. |
Subscribe to Top of Book
Request
{
"method": "subscribe",
"ch": "orderbook/top/1000ms", // Channel
"params": {
"symbols": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
Response
{
"result": {
"ch": "orderbook/top/1000ms", // Channel
"subscriptions": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
Data notifications
{
"ch": "orderbook/top/1000ms",
"data": {
"ETHBTC": {
"t": 1626954648761, // Timestamp in milliseconds
"a": "0.062135", // Best ask
"A": "4.1591", // Best ask quantity
"b": "0.062124", // Best bid
"B": "0.9877" // Best bid quantity
}
}
}
{
"ch": "orderbook/top/1000ms",
"data": {
"BTCUSDT": {
"t": 1626954648863,
"a": "31936.09",
"A": "1.30000",
"b": "31933.40",
"B": "0.00058"
}
}
}
Channel: orderbook/top/{speed}
Supported speed: 100ms
, 500ms
, 1000ms
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. Value ["*"] means all symbols are selected. |
Subscribe to Top of Book in Batches
Request
{
"method": "subscribe",
"ch": "orderbook/top/100ms/batch", // Channel
"params": {
"symbols": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
Response
{
"result": {
"ch": "orderbook/top/100ms/batch", // Channel
"subscriptions": ["ETHBTC", "BTCUSDT"]
},
"id": 123
}
Data notification
{
"ch": "orderbook/top/100ms/batch",
"data": {
"ETHBTC": {
"t": 1614815872000 // Timestamp in milliseconds
"a": "0.031175", // Best ask
"A": "0.4033", // Best ask quantity
"b": "0.031148", // Best bid
"B": "0.3649", // Best bid quantity
},
"BTCUSDT": {
"t": 1614815872005
"a": "0.031175",
"A": "0.4033",
"b": "0.031148",
"B": "0.3649",
}
}
}
Channel: orderbook/top/{speed}/batch
Supported speed: 100ms
, 500ms
, 1000ms
Parameters:
Name | Type | Description |
---|---|---|
symbols | Array of String | List of symbol codes. Value ["*"] means all symbols are selected. |
Socket Authentication
Basic
Example with Basic algorithm:
wscat -c wss://api.crosstower.com/api/3/ws/trading
{
"method": "login",
"params": {
"type": "BASIC",
"api_key": "apiKey",
"secret_key": "secretKey"
}
}
Request method: login
Parameters:
Name | Type | Description |
---|---|---|
type | String | Encryption algorithm. Accepted values: BASIC |
api_key | String | API public key. |
secret_key | String | API secret key. |
HS256
Example with HS256 algorithm:
wscat -c wss://api.crosstower.com/api/3/ws/trading
{
"method": "login",
"params": {
"type": "HS256",
"api_key": "apiKey",
"timestamp": 1626861109494,
"signature": "secretKey"
}
}
Signature generation example
from websocket import create_connection
import websocket
import json
from hashlib import sha256
from hmac import HMAC
from time import time
timestamp = int(time() * 1000)
api_key = "apiKey"
secret = "secretKey"
window = 10000
message = str(timestamp)
if window:
message += str(window)
ws = create_connection('wss://api.crosstower.com/api/3/ws/trading')
sign = HMAC(key=secret.encode(),
msg=message.encode(),
digestmod=sha256).hexdigest()
res = ws.send(json.dumps({"method": "login", "params": {"type": "HS256", "api_key": api_key, "timestamp": timestamp, "window": window, "signature": sign}}))
print(ws.recv())
Request method: login
Parameters:
Name | Type | Description |
---|---|---|
type | String | Encryption algorithm. Accepted values: HS256 |
api_key | String | API public key. |
timestamp | Number | Timestamp. |
window | Number | Optional. Maximum difference between timestamp and the moment of request processing in seconds. Accepted range: 1 – 60 Default value: 10 |
signature | String | HMAC SHA256 sign with API secret key. |
Socket Trading
Trade via socket has some major differences compared to REST:
- quickness. The time to place a new order is a bit higher than network latency;
- the Server notifies you of any order updates;
- FIFO. Your requests are executed on a First In First Out basis.
Socket Spot Trading
Subscribe to Reports
Request
wscat -c wss://api.crosstower.com/api/3/ws/trading
{
"method": "spot_subscribe",
"params": {},
"id": 123
}
Subscription result:
{
"jsonrpc": "2.0",
"result": true,
"id": 123
}
Notification Spot orders snapshot
{
"jsonrpc": "2.0",
"method": "spot_orders",
"params": [
{
"id": 584244931496,
"client_order_id": "b5acd79c0a854b01b558665bcf379456",
"symbol": "BTCUSDT",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.01000",
"quantity_cumulative": "0",
"price": "0.01",
"post_only": false,
"created_at": "2021-07-02T22:52:32.864Z",
"updated_at": "2021-07-02T22:52:32.864Z",
"report_type": "status"
},
{
"id": 584246978340,
"client_order_id": "eeb7d144eca545cd93d83078bc60b7f4",
"symbol": "BTCUSDT",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.01000",
"quantity_cumulative": "0",
"price": "0.02",
"post_only": false,
"created_at": "2021-07-02T22:56:43.588Z",
"updated_at": "2021-07-02T22:56:43.588Z",
"report_type": "status"
}
]
}
Notification Spot order update
{
"jsonrpc": "2.0",
"method": "spot_order",
"params": {
"id": 584244931496,
"client_order_id": "b5acd79c0a854b01b558665bcf379456",
"symbol": "BTCUSDT",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.01000",
"quantity_cumulative": "0",
"price": "0.01",
"post_only": false,
"created_at": "2021-07-02T22:52:32.864Z",
"updated_at": "2021-07-02T22:52:32.864Z",
"report_type": "new"
}
}
Notification Spot trade
{
"jsonrpc": "2.0",
"method": "spot_order",
"params": {
"id": 626857425737,
"client_order_id": "rqq6qnVTWvHa5YYG-7RviHLyA8JBu6Gj",
"symbol": "BTCUSDT",
"side": "buy",
"status": "filled",
"type": "market",
"time_in_force": "GTC",
"quantity": "0.00001",
"quantity_cumulative": "0.00001",
"post_only": false,
"created_at": "2021-08-23T16:29:24.006Z",
"updated_at": "2021-08-23T16:29:24.006Z",
"trade_id": 1361977606,
"trade_quantity": "0.00001",
"trade_price": "49595.04",
"trade_fee": "0.001239876000",
"trade_taker": true,
"report_type": "trade"
}
}
Method: spot_subscribe
, spot_unsubscribe
Income methods: spot_order
, spot_orders
Subscribes to execution reports of user's orders.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Response:
Name | Type | Description |
---|---|---|
id | Number | Unique order identifier as assigned by exchange. |
client_order_id | String | Unique order identifier as assigned by the trader. |
symbol | String | Symbol code. |
side | String | Trade side. Accepted values: sell , buy |
status | String | Order state. Possible values: new — an order is placed in the order book. suspended — a stopLimit , stopMarket , takeProfitLimit or takeProfitMarket order is parked until it meets the conditions for placement in the order book. partiallyFilled — an order is executed, but a part of its quantity is not filled yet. filled — (in updates) order quantity filled completely. canceled — (in updates) an order is canceled. It can either be done by a user through a cancel/replace request or by the system under specific circumstances. expired — (in updates) an order is deactivated after it no longer satisfies Time in Force (IOC, FOK) or Post Only requirements. |
type | String | Order type. Possible values: limit , market , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket |
time_in_force | String | Time in Force is a special instruction used when placing an order to indicate how long it will remain active before it is executed or expired. GTC — "Good-Till-Canceled" order won't be closed until it is filled. IOC — "Immediate-Or-Cancel" order must be executed immediately. Any part of an IOC order that cannot be filled immediately will be canceled. FOK — "Fill-Or-Kill" order must be executed immediately and completely or not executed at all. Day — keeps the order active until the end of the trading day (23:59 UTC+0). GTD — "Good-Till-Date" order may remain active until the time specified in expire_time . |
quantity | Number | Order quantity. |
price | Number | Order price. |
cum_quantity | Number | Cumulative executed quantity. |
post_only | Boolean | A post-only order is an order that does not remove liquidity. If a post-only order causes a match with a pre-existing order as a taker, then the order will expire. |
created_at | DateTime | Report creation date. |
updated_at | DateTime | Date of the report's last update. |
stop_price | Number | Required for stop-limit, stop-market, take-profit limit, and take-profit market orders. |
expire_time | DateTime | Date of order expiration for time_in_force equal to GTD . |
original_client_order_id | String | Identifier of replaced order. |
trade_id | Number | Trade identifier. Required if report_type is trade . |
trade_quantity | Number | Quantity of trade. Required if report_type is trade . |
trade_price | Number | Trade price. Required if report_type is trade . |
trade_fee | Number | Fee paid for trade. Required if report_type is trade . |
trade_taker | Boolean | Liquidity indicator. Required if report_type is trade . |
report_type | String | Report type. Possible values: status — (in snapshots) the record of an event occurred during the last snapshot period. new — (in updates) an order has been placed in the order book (status is new ). suspended — (in updates) a stopLimit , stopMarket , takeProfitLimit or takeProfitMarket order is parked until it meets the conditions for placement in the order book (status is suspended ). canceled — (in updates) an order is canceled. It can either be done by a user through a cancel/replace request or by the system under specific circumstances. rejected — (in updates) order request has been rejected (it is applicable exclusively to a request entry, so the status of the related canceled/replaced order will not change — i.e., it cannot be different from new , suspended , partiallyFilled ). status is rejected . expired — (in updates) an order is deactivated as it no longer satisfies Time in Force (IOC, FOK) or Post Only requirements (status is expired ). replaced — (in updates) an order cancel/replace request has been accepted and successfully processed (status is canceled , a new order placed instead has the new status value). trade — (in updates) an order has been fully or partially executed (status is filled or partiallyFilled ). |
Get Active Spot Orders
Notification report
{
"jsonrpc": "2.0",
"result": [
{
"id": 583502239480,
"client_order_id": "9be4d950d3c04485854ec5d7f260b1e8",
"symbol": "BTCUSDT",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.01000",
"quantity_cumulative": "0",
"price": "0.01",
"post_only": false,
"created_at": "2021-07-01T23:04:04.048Z",
"updated_at": "2021-07-01T23:04:04.048Z",
"report_type": "status"
}
],
"id": 123
}
Method: spot_get_orders
Returns active orders.
Place New Spot Order
Request:
{
"method": "spot_new_order",
"params": {
"client_order_id": "57d5525562c945448e3cbd559bd068c4",
"symbol": "ETHBTC",
"side": "sell",
"type": "limit",
"quantity": "0.015",
"price": "0.059837"
},
"id": 123
}
Success response:
{
"jsonrpc": "2.0",
"result": {
"id": 583565960004,
"client_order_id": "57d5525562c945448e3cbd559bd06211",
"symbol": "BTCUSDT",
"side": "buy",
"status": "new",
"type": "market",
"time_in_force": "GTC",
"quantity": "0.00001",
"quantity_cumulative": "0",
"post_only": false,
"created_at": "2021-07-02T00:58:05.307Z",
"updated_at": "2021-07-02T00:58:05.307Z",
"report_type": "new"
},
"id": 123
}
Example error response:
{
"error": {
"code": 20001,
"message": "Insufficient funds",
"description": "Check that the funds are sufficient, given commissions"
},
"id": 123
}
Method: spot_new_order
Creates a new spot order.
Requires the "Place/cancel orders" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
client_order_id | String | Optional. Unique order identifier as assigned by the trader. Uniqueness must be guaranteed until the last order with the same client_order_id becomes inactive (canceled, expired, or fully executed) and some time after that. |
symbol | String | Symbol code. |
side | String | Trade side. Accepted values: sell , buy |
type | String | Optional. Order type. Must be set to market , stopMarket , or takeProfitMarket if price was left unspecified. Accepted values: limit , market , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket Default value: limit |
time_in_force | String | Optional. Order type. Accepted values: GTC , IOC , FOK , Day , GTD Default value: GTC |
quantity | Number | Order quantity. |
price | Number | Order price. Required for limit types. |
stop_price | Number | Required for stop-limit, stop-market, take-profit limit, and take-profit market orders. |
expire_time | DateTime | Required if time_in_force is GTD . |
strict_validate | Boolean | Price and quantity will be checked for incrementation within the symbol's tick size and quantity step. See the symbol's tick_size and quantity_increment . |
post_only | Boolean | A post-only order is an order that does not remove liquidity. If a post-only order causes a match with a pre-existing order as a taker, then the order will expire. |
take_rate | Number | Optional. Liquidity taker fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup. |
make_rate | Number | Optional. Liquidity provider fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup. |
Create New Spot Order List
Request:
{
"method": "spot_new_order_list",
"params": {
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneCancelOther",
"orders": [
{
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "buy",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"post_only": false
},
{
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "ETHBTC",
"side": "sell",
"type": "stopMarket",
"time_in_force": "GTC",
"quantity": "0.063",
"stop_price": "0.044050",
"price": "0.044016",
"post_only": false
}
]
},
"id": 123
}
Success response:
{
"jsonrpc": "2.0",
"result": [
{
"id": 840450210,
"client_order_id": "d8574207d9e3b16a4a5511753eeef175",
"symbol": "ETHBTC",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.063",
"price": "0.046016",
"quantity_cumulative": "0.000",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneCancelOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
},
{
"id": 840450211,
"client_order_id": "a53406ea49e160c63b620ca21e9fb634",
"symbol": "ETHBTC",
"side": "sell",
"status": "suspended",
"type": "stopMarket",
"time_in_force": "GTC",
"quantity": "0.063",
"stop_price": "0.044050",
"price": "0.044016",
"quantity_cumulative": "0.000",
"post_only": false,
"order_list_id": "d8574207d9e3b16a4a5511753eeef175",
"contingency_type": "oneCancelOther",
"created_at": "2021-06-15T17:01:05.092Z",
"updated_at": "2021-06-15T17:01:05.092Z"
}
],
"id": 123
}
Example error response:
{
"error": {
"code": 20001,
"message": "Insufficient funds",
"description": "Check that the funds are sufficient, given commissions"
},
"id": 123
}
Method: spot_new_order_list
Creates a new spot order list.
Requires the "Place/cancel orders" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
order_list_id | String | Order list identifier. If omitted, it will be generated by the system upon order list creation. Must be equal to client_order_id of the first order in the request. |
contingency_type | String | Order list type. Accepted values: allOrNone (AON) — all orders in the set should be executed within a single transaction or become expired otherwise; oneCancelOther (OCO) — all orders in the set should be canceled if one of them was executed; oneTriggerOther (OTO) — execution of the first (primary) order on the list activates other (secondary) orders as independent of each other; oneTriggerOneCancelOther (OTOCO) — the execution of the first (primary) order on the list activates the other (secondary) orders as an OCO order list. |
orders | Array of Order | Orders in the list. There must be 2 or 3 orders for allOrNone /oneCancelOther /oneTriggerOther and 3 — for oneTriggerOneCancelOther . Placing any other number of orders will result in an error. |
Order model consists of:
Name | Type | Description |
---|---|---|
client_order_id | String | Optional. Must be different from the identifiers of other orders in the list. If omitted, it will be generated by the system upon order list creation. Uniqueness must be guaranteed until the last order with the same client_order_id becomes inactive (canceled, expired, or fully executed) and some time after that. |
symbol | String | Symbol code. For an allOrNone order list, symbol code must be unique for each order in the list. For an oneTriggerOneCancelOther order list, symbol code must be the same for all orders in the list (placing orders in different order books is not supported). |
side | String | Trade side. Accepted values: sell , buy |
type | String | Optional. Order type. Accepted values: for allOrNone — limit , market ; for oneCancelOther (and secondary orders in oneTriggerOneCancelOther ) — limit , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket ; for oneTriggerOneCancelOther — limit , market , stopLimit , stopMarket , takeProfitLimit , takeProfitMarket . Default value: limit |
time_in_force | String | Optional (required for allOrNone ). Time in Force instruction. Accepted values: for allOrNone — FOK ; for oneCancelOther (and secondary orders in oneTriggerOneCancelOther ) — GTC , IOC (except limit orders), FOK (except limit orders), Day , GTD ; for oneTriggerOneCancelOther — GTC , IOC , FOK , Day , GTD . |
quantity | Number | Order quantity. |
price | Number | Order price. Required if type is limit , stopLimit , or takeProfitLimit . |
stop_price | Number | The price level that triggers order activation. Required if type is stopLimit , stopMarket , takeProfitLimit , or takeProfitMarket . |
expire_time | DateTime | Date of order expiration. Required if time_in_force is GTD . |
strict_validate | Boolean | Price and quantity will be checked for incrementation within the symbol’s tick size and quantity step. See the symbol's tick_size and quantity_increment . |
post_only | Boolean | Optional. If a post-only order causes a match with a pre-existing order as a taker, then the order will expire. |
take_rate | Number | Optional. Liquidity taker fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup. |
make_rate | Number | Optional. Liquidity provider fee, a fraction of order volume, such as 0.001 (for 0.1% fee). Can only increase the fee. Used for fee markup. |
Cancel Spot Order
Request:
{
"method": "spot_cancel_order",
"params": {
"client_order_id": "57d5525562c945448e3cbd559bd068c4"
},
"id": 123
}
Response:
{
"jsonrpc": "2.0",
"result": {
"id": 583569472521,
"client_order_id": "8a97337322774d8ea56448290fbc87b3",
"symbol": "BTCUSDT",
"side": "buy",
"status": "canceled",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.00001",
"quantity_cumulative": "0",
"price": "0.01",
"post_only": false,
"created_at": "2021-07-02T01:03:56.625Z",
"updated_at": "2021-07-02T01:05:41.84Z",
"report_type": "canceled"
},
"id": 123
}
Method: spot_cancel_order
Cancels an existing order.
Cancel/Replace Spot Order
Request:
{
"method": "spot_replace_order",
"params": {
"client_order_id": "d6b645556af740b1bd1683400fd9cbce",
"new_client_order_id": "d6b645556af740b1bd1683400fd9cbcf",
"quantity": "0.00001",
"price": "0.02"
},
"id": 123
}
Response:
{
"jsonrpc": "2.0",
"result": {
"id": 583572753114,
"client_order_id": "d6b645556af740b1bd1683400fd9cbcf",
"symbol": "BTCUSDT",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.00001",
"quantity_cumulative": "0",
"price": "0.02",
"post_only": false,
"created_at": "2021-07-02T01:10:06.976Z",
"updated_at": "2021-07-02T01:11:18.238Z",
"original_client_order_id": "d6b645556af740b1bd1683400fd9cbce",
"report_type": "replaced"
}
}
The Cancel/Replace request is used to change the parameters of an existing order and to change the quantity or price attribute of an open order.
Do not use this request to cancel the quantity remaining in an outstanding order. Use the Cancel request message for this purpose.
It is stipulated that a newly entered order cancels a prior order that has been entered but not yet executed.
Method: spot_replace_order
Requires the "Place/cancel orders" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
client_order_id | String | Required. Identifier of the order being replaced. |
new_client_order_id | String | Required. client_order_id for a new order. Uniqueness must be guaranteed until the last order with the same client_order_id becomes inactive (canceled, expired, or fully executed) and some time after that. |
quantity | Number | New order quantity. |
price | Number | New order price. |
strict_validate | Boolean | Price and quantity will be checked for the incrementation within tick size and quantity step. See symbol's tick_size and quantity_increment . |
Cancel Spot Orders
Request:
{
"method": "spot_cancel_orders",
"params": {},
"id": 123
}
Response:
{
"jsonrpc": "2.0",
"result": [
{
"id": 583572753114,
"client_order_id": "d6b645556af740b1bd1683400fd9cbcf",
"symbol": "BTCUSDT",
"side": "buy",
"status": "new",
"type": "limit",
"time_in_force": "GTC",
"quantity": "0.00001",
"quantity_cumulative": "0",
"price": "0.02",
"post_only": false,
"created_at": "2021-07-02T01:10:06.976Z",
"updated_at": "2021-07-02T01:11:18.238Z",
"report_type": "canceled"
}
]
}
Method: spot_cancel_orders
Cancels all user's active orders and returns the ones which could not be canceled.
Requires the "Place/cancel orders" API key Access Right.
Subscribe to Spot Balances
Request
{
"method": "spot_balance_subscribe",
"params": {
"mode": "updates"
},
"id": 123
}
Subscription result:
{
"jsonrpc": "2.0",
"result": true,
"id": 123
}
Notification Spot balance
{
"jsonrpc": "2.0",
"method": "spot_balance",
"params": [
{
"currency": "BCN",
"available": "100.000000000000",
"reserved": "0"
},
{
"currency": "BTC",
"available": "0.013634021",
"reserved": "0"
},
{
"currency": "ETH",
"available": "0",
"reserved": "0"
}
]
}
Method: spot_balance_subscribe
, spot_balance_unsubscribe
Income methods: spot_balance
Subscribes to user's balances.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Parameters:
Name | Type | Description |
---|---|---|
mode | String | Optional. Subscription mode. Accepted values: updates — messages arrive after balance updates. batches — messages arrive at equal intervals if there were any updates. |
Response:
Name | Type | Description |
---|---|---|
currency | String | Currency code. |
available | Number | Amount available for trading or transfer to wallet. |
reserved | Number | Total amount reserved for active orders and incomplete transfers to wallet. |
Get Spot Trading Balances
Request:
{
"method": "spot_balances",
"params": {},
"id": 123
}
Response:
{
"jsonrpc":"2.0",
"result": [
{
"currency": "BCN",
"available": "100.000000000000",
"reserved": "0"
},
{
"currency": "BTC",
"available": "0.013634021",
"reserved": "0"
},
{
"currency": "ETH",
"available": "0",
"reserved": "0"
}
],
"id": 123
}
Method: spot_balances
Returns all non-zero trading balances.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Get Spot Trading Balance
Request:
{
"method": "spot_balance",
"params": {
"currency": "BTC"
},
"id": 123
}
Response:
{
"jsonrpc":"2.0",
"result": {
"currency": "BTC",
"available": "0.013634021",
"reserved": "0"
},
"id": 123
}
Method: spot_balance
Returns trading balance for a single currency.
Get Spot Fees
Request:
{
"method": "spot_fees",
"params": {},
"id": 123
}
Response:
{
"jsonrpc":"2.0",
"result": [
{
"symbol": "BTCUSDT",
"take_rate": "0.001",
"make_rate": "-0.0001"
},
{
"symbol": "ETHBTC",
"take_rate": "0.001",
"make_rate": "-0.0001"
}
],
"id": 123
}
Method: spot_fees
Returns fees for all available symbols.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Get Spot Fee
Request:
{
"jsonrpc":"2.0",
"method": "spot_fee",
"params": {
"symbol": "BTCUSDT"
},
"id": 123
}
Response:
{
"jsonrpc":"2.0",
"result":
{
"symbol": "BTCUSDT",
"take_rate": "0.001",
"make_rate": "-0.0001"
},
"id": 123
}
Method: spot_fee
Returns fees for the symbol specified.
Requires the "Orderbook, History, Trading balance" API key Access Right.
Socket Wallet Management
Description
WebSocket Account API uses the same authorization approach as described in the Socket Session Authentication section.
API provides the following tools to manage a general account:
- a subscription to the transactions:
- any sequenced transaction changes such as creating or updating.
- a balance request;
- a transaction history request.
Subscribe to Transactions
Method: subscribe_transactions
and the corresponding unsubscription method: unsubscribe_transactions
Income method: transaction_update
A full transaction model description can be found in the "Get Transactions History" section.
A subscription to the transactions has to be used rather than the transaction polling.
A transaction notification occurs each time the transaction has been changed, such as creating a transaction, updating the pending state (e.g., the hash assigned) or completing a transaction. This is the easiest way to track deposits or develop real-time asset monitoring.
Subscription request:
wscat -c wss://api.crosstower.com/api/3/ws/wallet
{
"method": "subscribe_transactions",
"params": {},
"id": 7652
}
Subscription result:
{
"result": true,
"id": 7652
}
Notification. Updated Transaction:
{
"method": "transaction_update",
"params": {
{
"id": 50844835,
"created_at": "2021-06-22T21:03:04.111Z",
"updated_at": "2021-06-22T21:04:41.487Z",
"status": "SUCCESS",
"type": "WITHDRAW",
"subtype": "BLOCKCHAIN",
"native": {
"tx_id": "27fa7f14-ca49-42fd-834a-4ce630d069d2",
"index": 1071885589,
"currency": "ETH",
"amount": "0.01042",
"fee": "0.00958",
"hash": "0xfb0ba568213d11230cd34d62fddd1cc1fe11fdc173l4f2007b0e47a06ad73d20",
"address": "0xd959463c3fcb222124bb7bb642d6a6573a6c5aba",
"confirmations": 20
}
}
}
Subscribe to Wallet Balance
Method: subscribe_wallet_balances
and the corresponding unsubscription method: unsubscribe_wallet_balances
Income methods: wallet_balances
, wallet_balance_update
This subscription aims to provide an easy way to be informed of the current balance state.
If the state has been changed or potentially changed, the wallet_balance_update
event will come with the actual state.
Please be aware that only non-zero values are present.
Event wallet_balances
arrives after each successful subscription.
Subscription request:
{
"method": "subscribe_wallet_balances",
"params": {},
"id": 7653
}
Subscription result:
{
"jsonrpc": "2.0",
"result": true,
"id": 7653
}
Notification. Balance snapshot:
{
"jsonrpc": "2.0",
"method": "wallet_balances",
"params": [
{
"currency": "BTC",
"available": "0.00005821",
"reserved": "0"
},
{
"currency": "ETH",
"available": "11",
"reserved": "0"
}
]
}
Notification. Balance update:
{
"jsonrpc": "2.0",
"method": "wallet_balance_update",
"params": {
"currency": "BTC",
"available": "0.10005821",
"reserved": "0"
}
}
Request Wallet Balance
Request:
{
"method": "wallet_balances",
"params": {},
"id": 5543
}
Response:
{
"jsonrpc": "2.0",
"result": [
{
"currency": "BTC",
"available": "0.00005821",
"reserved": "0"
},
{
"currency": "ETH",
"available": "11",
"reserved": "0"
}
],
"id": 5543
}
Request:
{
"method": "wallet_balance",
"params": {
"currency": "BTC"
},
"id": 5543
}
Response:
{
"jsonrpc": "2.0",
"result": {
"currency": "BTC",
"available": "0.00005821",
"reserved": "0"
},
"id": 5543
}
Methods: wallet_balances
, wallet_balance
Get all wallet balances or balance for a single asset.
Please note that the method returns non-zero balances only.
Get Transactions
Request:
{
"method": "get_transactions",
"params": {
"limit": 10,
"offset": 0,
"sort": "desc",
"from": "2020-01-31T00:00:00.000Z",
"till": "2021-07-31T22:33:00.555Z",
"statuses": "SUCCESS",
"currencies": "ETH,BTC"
},
"id": 7655
}
Response:
{
"result": [
{
"id": 50844835,
"created_at": "2021-06-22T21:03:04.111Z",
"updated_at": "2021-06-22T21:04:41.487Z",
"status": "SUCCESS",
"type": "WITHDRAW",
"subtype": "BLOCKCHAIN",
"native": {
"tx_id": "27fa7f14-ca49-42fd-834a-4ce630d069d2",
"index": 1071885589,
"currency": "ETH",
"amount": "0.01042",
"fee": "0.00958",
"hash": "0xfb0ba568213d11230cd34d62fddd1cc1fe11fdc173l4f2007b0e47a06ad73d20",
"address": "0xd959463c3fcb222124bb7bb642d6a6573a6c5aba",
"confirmations": 20
}
},
{
"id": 36896428,
"created_at": "2020-11-12T10:27:26.135Z",
"updated_at": "2020-11-12T10:42:29.065Z",
"status": "SUCCESS",
"type": "DEPOSIT",
"subtype": "BLOCKCHAIN",
"native": {
"tx_id": "a271ad64-5f34-4115-a63e-1cb5bbe4f67e",
"index": 429625504,
"currency": "BTC",
"amount": "0.04836614",
"hash": "4d7ae7c9d6fe84405ae167b3f0beacx8c68eb5a9d5189bckeb65d5e306427oe6",
"address": "3E8WKmTJzaTsBc4kvuEJVjPNtak6vQRcRv",
"confirmations": 2
}
}
],
"id": 7655
}
Method: get_transactions
All parameters are optional.
Parameters:
Name | Type | Description |
---|---|---|
from | DateTime | Interval initial value (inclusive). |
till | DateTime | Interval end value (inclusive). |
types | String | Comma-separated transaction types. |
subtypes | String | Comma-separated transaction subtypes. |
statuses | String | Comma-separated transaction statuses. Accepted values: CREATED , PENDING , FAILED , SUCCESS , ROLLED_BACK |
currencies | String | Comma-separated currency codes. |
id_from | Number | Index interval initial value. Accepted values: 0 or greater |
id_till | Number | Index interval end value. Accepted values: 0 or greater |
tx_ids | String | Comma-separated transaction identifiers. |
order_by | String | Defines order type. Accepted values: created_at , id Default value: created_at |
sort | String | Sort direction. Accepted values: DESC , ASC Default value: DESC |
limit | Number | Default value: 100 Maximum value: 1000 |
offset | Number | Default value: 0 Maximum value: 100000 |
Errors
The Crosstower API uses the following error codes:
Error code | HTTP Status Code | Message | Note |
---|---|---|---|
400 | 400 | Bad request | The request contains values that cannot be processed. |
429 | 429 | Too many requests | Action is being rate limited for the account. |
500 | 500 | Internal Server Error | The request cannot be fulfilled at the moment. Try submitting the request later. |
503 | 503 | Service Unavailable | Try sending the request again later. |
504 | 504 | Gateway Timeout | Check the result of a request later. |
600 | 400 | Action not allowed | Operation is not permitted. See the message field for more information. |
601 | 400 | The recipient's address is not on the whitelist | The whitelist has been activated. Any address that is not added there cannot be used. |
602 | 400 | Payout blacklisted | Try sending crypto later. See the message field for the exact timing. |
604 | 400 | Payout amount bigger than locked amount | Provide a smaller payout amount. |
800 | 404 | Resource Not Found | Check the submitted parameters to ensure they were entered correctly. |
1002 | 401 | Authorization required or has been failed | Check that authorization data were provided. |
1003 | 403 | Action forbidden for this API key | Check permissions for API key, whitelists, or any security feature that might block this request. |
1004 | 401 | Unsupported authorization method | Use a valid authentication method. |
1005 | 401 | Authorization is invalid | The device has not been recognized. Use a valid authorization token. |
1006 | 400 | Should upgrade scopes | Check permission scopes. |
2001 | 400 | Symbol not found | The symbol code does not exist. Use GET /api/3/public/symbol to get the list of all available symbols. |
2002 | 400 | Currency not found | The currency code does not exist or is not enabled on a platform. See the message field for more information. |
2003 | 400 | Unknown channel | The channel name value is incorrect. |
2010 | 400 | Quantity not a valid number | Quantity value has to be a positive number. |
2011 | 400 | Quantity too low | Quantity value has to be more than or equal to the quantity_increment parameter value of a symbol. |
2012 | 400 | Bad quantity | Pass the quantity value that can be divided by the quantity_increment value of the selected symbol with no remainder. |
2020 | 400 | Price not a valid number | Price value has to be a positive number no less than the tick_size value of the selected symbol. |
2022 | 400 | Bad price | Pass the price value that can be divided by the tick_size value of the selected symbol with no remainder. |
10001 | 400 | Validation error | Input is not valid or the number of orders in an order list is incorrect. See the message field for more information. |
10021 | 400 | User disabled | Either a wrong input format or a sub account is frozen or disabled. |
20001 | 400 | Insufficient funds | Insufficient funds for creating an order, placing an order list, or any account operations. Check that the funds are sufficient, given commissions. |
20002 | 400 | Order not found | Attempt to get an active order that does not exist or is filled, canceled, expired. Attempt to cancel a non-existing order. Attempt to cancel an already filled or expired order. |
20003 | 400 | Limit exceeded | Pass a lower limit value. See the message field for more information. |
20004 | 400 | Transaction not found | Requested transaction was not found. |
20005 | 400 | Payout not found | Check the submitted parameters. |
20006 | 400 | Payout already committed | Operation cannot be performed since the payout has already been committed. |
20007 | 400 | Payout already rolled back | Operation cannot be performed since the payout has already been rolled back. |
20008 | 400 | Duplicate clientOrderId | An order with the submitted ID already exists. |
20009 | 400 | Price and quantity not changed | The order has not been changed. Enter a new price/quantity to fix the error. |
20010 | 400 | Exchange temporary closed | Exchange market is temporary closed on the symbol. |
20011 | 400 | Payout address is invalid | Check the payout address format. |
20012 | 400 | Payout payment address is invalid | Check the payment ID format. |
20014 | 400 | Payout offchain unavailable | Address does not belong to exchange, belongs to the same user, or is unavailable for currency. |
20016 | 400 | Payout fee level invalid | Submit a valid fee value. |
20044 | 400 | Trading operation not allowed | Platform is unavailable. |
20045 | 400 | Fat finger limit exceeded | Order price differs from the market price more than for 10% (for stopLimit and takeProfitLimit orders, the restriction is also applied to the difference between the stop price and the limit price). Fix the value and re-submit the request. |
20080 | 400 | Internal order execution deadline exceeded | Order was not placed. |
20081 | 404 | Provider not found | Provider with the submitted parameters cannot be found. |
20082 | 404 | Source currency not found | Source currency submitted does not exist. Check the currency value or select another currency when creating an order. |
20083 | 404 | Target currency not found | Target currency submitted does not exist. Check the currency value or select another currency when creating an order. |
20084 | 400 | Source currency disabled | Source currency has been disabled in the system. Select another currency to create an order. |
20085 | 400 | Target currency disabled | Target currency has been disabled in the system. Select another currency to create an order. |
20086 | 404 | Payment method not found | Submitted payment method does not exist. Provide an existing payment method value. |
20087 | 400 | Payment methods is inactive | Submitted payment method is unavailable. Select another payment method. |
20088 | 400 | Source amount is invalid | Provide a string type float value as a source amount. |
20090 | 403 | KYC Required | Feature is available only after passing the identity verification (KYC) procedure. |
21001 | 404 | Cannot find sub account | A sub account with the specified ID cannot be found in the system. |
21003 | 400 | Sub account is already frozen | Operation cannot be performed since the sub account has already been frozen. |
21004 | 400 | Sub account is already frozen or disabled | Operation cannot be performed since the sub account has already been frozen or disabled. |
22000 | 404 | Payment icon is not found | Check whether the payment method icon with the passed parameters exist. |
22002 | 400 | Icon already set for payment type | Impossible to set a new payment method icon until the existing one is unset. |
22003 | 404 | User does not have a bank account | The user cannot commit operations requiring a bank account. |
22004 | 404 | User is not found | Check if the functionality is accessable. |
22005 | 400 | Source amount is less than minimum | Pass a larger source amount. |
22006 | 400 | Source amount is more than maximum | Pass a smaller source amount. |
22007 | 400 | Currency is disabled | Impossible to perform the request with the passed currency value. |