API documentation v1

General information

Method parameters are expected in GET or POST format (depending on the method type). All responses from the server come in JSON format.

Successful response:

{ "success": true, "code": 200, <...> }

Error response:

{"success": false, "code": <error code>, "errors": [<error message array>]} or {"success": false, "code": <error code>, "message": <error description>}
  • errors – description of errors when a request with non-valid input parameters is received
  • code – integer error code. All possible error codes and their description are presented below
  • message – error description

Authorization

Part of the API is generally accessible without authorization, but most require you to specify the API key. The API key is passed in the http header X-Api-Key in the format X-Api-Key: Bearer <API Key>
To get the API key, you need to POST the following request:

Address and request type:

POST request to https://demo.buyownex.com/api/v1/login

Headers:

Content-Type: application/x-www-form-urlencoded

Required parameters:

  • email – email specified by you during registration
  • password – your current password

Example:

[email protected]&password=qwerty

If the answer is successful the string in JSON format will be returned

{"success": true,"token": "<token>"}

where
token – API key to be passed in x-Api-Key header in personal API requests

Limitations

The following restrictions apply when working with the API:
No more than 60 requests per minute are allowed. Each response to your request returns two headers X-RateLimit-Limit and X-RateLimit-Remaining

  • X-RateLimit-Limit – allowed number of requests per minute
  • X-RateLimit-Remaining – remaining number of requests at the moment

HTTP response codes and API error codes

Possible HTTP response codes:

Response code Description
200 Successful return code
400 API request failed. In this case, an error code explaining the cause of the error is also returned. See below for all possible error codes
401 Authentication data is not specified or invalid
403 There is no access to the resource
422 Validation of incoming parameters failed
429 Request limit exceeded
500 Unknown system error

Possible error codes:

Error code Description
9 Insufficient funds
10 Error in validation of input parameters
12 Error while getting ticker information
13 A negative or zero amount is specified
14 Error while getting orderbook information
15 No currency pair found
16 The amount specified is too large
17 The amount of currency to be bought/sold when placing an order is less than the allowed one
18 A negative or zero price is specified when placing an order
19 The price is too high when placing an order
22 Invalid request API format
23 Error while getting a list of deals
24 Error while getting a list of orders
25 Order not found
26 Error in obtaining information on the order
27 Error in obtaining information on the balance
28 Error getting the list of transactions
29 Error getting the list of transfers
30 There is no information on the fee for this currency
31 Error while retrieving information for a fee
32 Incorrect parameters passed when placing an order
33 Error when placing an order/td>
34 Error when canceling an order

Public API

All APIs in this section do not require an X-Api-Key, but there is a limit of 60 requests per minute

Summary market data

GET request at https://demo.buyownex.com/api/v1/summary

Headers:
-

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/summary

If the answer is successful the string in JSON format will be returned

{
    "success": true,
    "code": 200,
    "ticker":
    {
        "BTC_USDT":
        {
            "id": 1,
            "last_price": "7234.45",
            "quote_volume": "891096.87103846",
            "base_volume": "121.840826",
            "isFrozen": 0,
            "highestBid": "7227.33",
            "lowestAsk": "7241.77",
            "high24hr": "7396",
            "low24hr": "7163.96",
            "percentChange": "-1.23",
            "margin": 0
        },
        "LTC_USDT":
        {
            "id": 2,
            "last_price": "43.98",
            "quote_volume": "770823.5363825",
            "base_volume": "17412.2085",
            "isFrozen": 0,
            "highestBid": "43.92",
            "lowestAsk": "44.03",
            "high24hr": "44.62",
            "low24hr": 	"43.6",
            "percentChange": "-0.91",
            "margin": 0
        }
    },
    "coins":
    {
        "BTC":
        {
            "id": 2,
            "type": "coin",
            "name": "Bitcoin",
            "withdraw": "On",
            "deposit": "On",
            "platform": null,
            "min_replenish": "0.0005",
            "min_withdraw": "0.0005",
            "fee_replenish": "0",
            "fee_withdraw": "0.0003",
            "max_day_withdraw": "1",
            "max_kyc_day_withdraw": "10"
        },
        "USDT":
        {
            "id": 1,
            "type": "token",
            "name": "Tether",
            "withdraw": "On",
            "deposit": "On",
            "platform": 3,
            "min_replenish": "1",
            "min_withdraw": "1",
            "fee_replenish": "0",
            "fee_withdraw": "1.2",
            "max_day_withdraw": "10000",
            "max_kyc_day_withdraw": "100000"
        }
    },
    "fiats":
    {
        "USD":
        {
            "id": 2,
            "name": "U.S. Dollar",
            "platforms":
            {
                "Payeer":
                {
                    "withdraw": "On",
                    "deposit": "On",
                    "min_replenish": "10",
                    "min_withdraw": "30",
                    "fee_replenish": "0.5",
                    "fee_withdraw": "1",
                    "max_day_withdraw": "500",
                    "max_kyc_day_withdraw": "3000"
                }
            }
        },
        "EUR":
        {
            "id": 3,
            "name": "European Euro",
            "platforms":
            {
                "Payeer":
                {
                    "withdraw": "On",
                    "deposit": "On",
                    "min_replenish": "10",
                    "min_withdraw": "20",
                    "fee_replenish": "0.5",
                    "fee_withdraw": "1",
                    "max_day_withdraw": "500",
                    "max_kyc_day_withdraw": "3000"
                }
            }
        }
    }
}
                

where

  • id – identifier of the currency pair/currency/fiat currency
  • last_price – the latest price of the currency pair
  • quote_volume – trading volume for the last 24 hours in quoted currency
  • base_volume – trading volume for the last 24 hours in the base currency
  • isFrozen – the availability of trades. Possible values: 0 - trades are available, 1 - trades are suspended
  • highestBid – best buy price in a order book
  • lowestAsk – best sell price in a order book
  • high24hr – max deal price in the last 24 hours
  • low24hr – min deal price in the last 24 hours
  • percentChange – percentage change in price
  • margin – the availability of margin trading. Possible values: 0 - margin trading is not available, 1 - margin trading is available
  • type – type of cryptocurrency. Possible values: coin, token
  • name – name of currency/fiat currency
  • withdraw – the availability of the withdrawal of the currency/fiat currency. Possible values: On, Off
  • deposit – the availability of the deposit of the currency/fiat currency. Possible values: On, Off
  • platform – filled only if the cryptocurrency type is token. Indicates the id of the cryptocurrency on the basis of which the token is issued
  • platforms – list of available payment systems in fiat currency
  • min_replenish – minimum deposit amount
  • min_withdraw – minimum withdrawal amount
  • fee_replenish – amount of fee when depositing funds
  • fee_withdraw – the fee for withdrawal
  • max_day_withdraw – maximum allowed withdrawal amount per day for non-verified users
  • max_kyc_day_withdraw – maximum allowed withdrawal amount per day for KYC verified users

Assets info

GET request at https://demo.buyownex.com/api/v1/assets

Headers:
-

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/assets

If the answer is successful the string in JSON format will be returned

{
    "success": true,
    "code": 200,
    "assets":
    {
        "BTC":
        {
            "name": "Bitcoin",
            "unified_cryptoasset_id": 1,
            "type": "coin",
            "platform": null,
            "can_withdraw": true,
            "can_deposit": true,
            "min_replenish": "0.0005",
            "min_withdraw": "0.0005",
            "max_withdraw": "1",
            "max_kyc_withdraw": "10",
            "fee_replenish": "0",
            "fee_withdraw": "0.0003",
            "maker_fee": "0.2",
            "taker_fee": "0.2"
        },
        "ETH":
        {
            "name": "Ethereum",
            "unified_cryptoasset_id": 1027,
            "type": "coin",
            "platform": null,
            "can_withdraw": true,
            "can_deposit": true,
            "min_replenish": "0.008",
            "min_withdraw": "0.01",
            "max_withdraw": "100",
            "max_kyc_withdraw": "1000",
            "fee_replenish": "0",
            "fee_withdraw": "0.007",
            "maker_fee": "0.2",
            "taker_fee": "0.2"
        },
        "USDT":
        {
            "name": "Tether",
            "unified_cryptoasset_id": 825,
            "type": "token",
            "platform": 3,
            "can_withdraw": true,
            "can_deposit": true,
            "min_replenish": "1",
            "min_withdraw": "1",
            "max_withdraw": "10000",
            "max_kyc_withdraw": "100000",
            "fee_replenish": "0",
            "fee_withdraw": "1.2",
            "maker_fee": "0.2",
            "taker_fee": "0.2"
        },
        "USD":
        {
            "name": "U.S. Dollar",
            "unified_cryptoasset_id": null,
            "type": "fiat",
            "maker_fee": "0.2",
            "taker_fee": "0.2",
            "platforms":
            {
                "Payeer":
                {
                    "can_withdraw": true,
                    "can_deposit": true,
                    "min_replenish": "10",
                    "min_withdraw": "30",
                    "max_withdraw": "500",
                    "max_kyc_withdraw": "3000"
                    "fee_replenish": "0.5",
                    "fee_withdraw": "1"
                }
            }
        },
        "EUR":
        {
            "name": "European Euro",
            "unified_cryptoasset_id": null,
            "type": "fiat",
            "maker_fee": "0.2",
            "taker_fee": "0.2",
            "platforms":
            {
                "Payeer":
                {
                    "can_withdraw": true,
                    "can_deposit": true,
                    "min_replenish": "10",
                    "min_withdraw": "20",
                    "max_withdraw": "500",
                    "max_kyc_withdraw": "3000"
                    "fee_replenish": "0.5",
                    "fee_withdraw": "1"
                }
            }
        }
    }
}
                

where

  • unified_cryptoasset_id – unique currency identifier assigned by the CoinMarketCap aggregator
  • name – name of currency/fiat currency
  • type – type of cryptocurrency. Possible values: coin, token, fiat
  • maker_fee – maker fee (%)
  • taker_fee – taker fee (%)
  • platform – filled only if the cryptocurrency type is token. Indicates the id of the cryptocurrency on the basis of which the token is issued
  • platforms – list of available payment systems in fiat currency
  • can_withdraw – the availability of the withdrawal of the currency/fiat currency. Possible values: true, false
  • can_deposit – availability of funds replenishment by currency/fiat currency. Possible values: true, false
  • min_replenish – minimum deposit amount
  • min_withdraw – minimum withdrawal amount
  • fee_replenish – amount of fee when depositing funds
  • fee_withdraw – the fee for withdrawal
  • max_withdraw – maximum allowed withdrawal amount per day for non-verified users
  • max_kyc_withdraw – maximum allowed withdrawal amount per day for KYC verified users

Ticker

GET request at https://demo.buyownex.com/api/v1/ticker

Headers:
-

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/ticker

If the answer is successful the string in JSON format will be returned

{
    "success": true,
    "code": 200,
    "ticker":
    {
        "BTC_USDT":
        {
            "base_id": 1,
            "quote_id": 825,
            "last_price": "7234.45",
            "quote_volume": "891096.87103846",
            "base_volume": "121.840826",
            "isFrozen": 0,
            "highestBid": "7227.33",
            "lowestAsk": "7241.77",
            "high24hr": "7396",
            "low24hr": "7163.96",
            "percentChange": "-1.23",
            "margin": 0
        },
        "LTC_USDT":
        {
            "base_id": 2,
            "quote_id": 825,
            "last_price": "43.98",
            "quote_volume": "770823.5363825",
            "base_volume": "17412.2085",
            "isFrozen": 0,
            "highestBid": "43.92",
            "lowestAsk": "44.03",
            "high24hr": "44.62",
            "low24hr": 	"43.6",
            "percentChange": "-0.91",
            "margin": 0
        }
    }
}
                

where

  • base_id – unique identifier of the base currency assigned by the CoinMarketCap aggregator. null if not exist
  • quote_id – unique identifier of the quoted currency assigned by the CoinMarketCap aggregator. null if not exist
  • last_price – the latest price of the currency pair
  • quote_volume – trading volume for the last 24 hours in quoted currency
  • base_volume – trading volume for the last 24 hours in the base currency
  • isFrozen – the availability of trades. Possible values: 0 - trades are available, 1 - trades are suspended
  • highestBid – best buy price in a order book
  • lowestAsk – best sell price in a order book
  • high24hr – max deal price in the last 24 hours
  • low24hr – min deal price in the last 24 hours
  • percentChange – percentage change in price
  • margin – the availability of margin trading. Possible values: 0 - margin trading is not available, 1 - margin trading is available

Order book

GET request at https://demo.buyownex.com/api/v1/orderbook/{pair}?depth=<depth>

Headers:
-

Required parameters:

  • pair – currency pair in the format <code of the base currency>_<code of the quote currency>

Optional parameters:

  • depth – the depth of order book. Possible values: 5,10,20,50,100,500. If not specified, 50 levels are returned

Example:

https://demo.buyownex.com/api/v1/orderbook/BTC_USDT?depth=5

If the answer is successful the string in JSON format will be returned

{
    "success": true,
    "code": 200,
    "timestamp": 1576080362,
    "bids": [
                [7151.1,0.06188],
                [7148.04,0.000202],
                [7146.57,0.23855],
                [7143.5,0.3281],
                [7140.44,0.3688]
            ],
    "asks": [
                [7167.28,0.001589],
                [7169.32,0.03134],
                [7171.96,0.30115],
                [7175.03,0.3191],
                [7178.11,0.3258]
            ],
    "bids_vol": 10337.81995758,
    "asks_vol":9672.98765772,
    "bids_amount":1.447986,
    "asks_amount":1.346869,
    "bids_num":7,
    "asks_num":6
}
                

where

  • timestamp – time of formation of the order book for a given currency pair in UNIX timestamp format
  • bids – an array containing two values: buy price and quantity. The data is aggregated and sorted by price.
  • asks – an array containing two values: sell price and quantity. The data is aggregated and sorted by price.
  • bids_vol – the total volume in the glass to buy in the quoted currency regardless of the depth value
  • asks_vol – the total volume in the glass for sale in the quoted currency regardless of the depth value
  • bids_amount – the total volume in the glass to buy in the base currency regardless of the depth value
  • asks_amount – the total volume in the glass for sale in the base currency regardless of the depth value
  • bids_num – total number of orders placed in the buy direction
  • asks_num – total number of orders placed in the sell direction

Trades list

GET request at https://demo.buyownex.com/api/v1/trades/{pair}?&limit=<limit>&type=<type>

Headers:
-

Required parameters:

  • pair – currency pair in the format <code of the base currency>_<code of the quote currency>

Optional parameters:

  • limit – limit of returned data. Possible values: 5,10,20,50,100,500. If not specified, 20 records are returned
  • type – trade direction. Possible values: buy/sell. If not specified, multidirectional trades are returned

Example:

https://demo.buyownex.com/api/v1/trades/BTC_USDT?limit=5&type=sell

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "trades": [
        {
            "trade_id": 5627122,
            "price":"7206.25",
            "base_volume":"0.017624",
            "quote_volume":"127.00295",
            "trade_timestamp":1576083062,
            "type":"sell"
        },
        {
            "trade_id":5627108,
            "price":"7207.14",
            "base_volume":"0.019604",
            "quote_volume":"141.28877256",
            "trade_timestamp":1576083058,
            "type":"sell"
        },
        {
            "trade_id":5627079,
            "price":"7207.42",
            "base_volume":"0.01802",
            "quote_volume":"129.8777084",
            "trade_timestamp":1576083037,
            "type":"sell"
        },
        {
            "trade_id":5627062,
            "price":"7207.74",
            "base_volume":"0.014654",
            "quote_volume":"105.62222196",
            "trade_timestamp":1576083002,
            "type":"sell"
        },
        {
            "trade_id":5627051,
            "price":"7208",
            "base_volume":"0.00614",
            "quote_volume":"44.25712",
            "trade_timestamp":1576082998,
            "type":"sell"
        }
    ]
}
                

where

  • trades – an array of trades
  • trade_id – unique identifier of the trade
  • price – trade price
  • base_volume – trade volume in base currency
  • quote_volume – trade volume in quoted currency
  • trade_timestamp – trade execution time in UNIX timestamp format
  • type – trade direction

Personal API

All of the following API requests in this section require personal token in the header "X-Api-Key"

Deals list

GET request at https://demo.buyownex.com/api/v1/deals/{pair}?&limit=<limit>&type=<type>

Headers:

  • X-Api-Key – Bearer <token>

Required parameters:

  • pair – currency pair in the format <code of the base currency>_<code of the quote currency>

Optional parameters:

  • limit – limit of returned data. Possible values: 5,10,20,50,100,500. If not specified, 20 records are returned
  • type – trade direction. Possible values: buy/sell. If not specified, multidirectional trades are returned

Example:

https://demo.buyownex.com/api/v1/deals/BTC_USDT?limit=5&type=sell

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "trades": [
        {
            "trade_id": 5627122,
            "price":"7206.25",
            "base_volume":"0.017624",
            "quote_volume":"127.00295",
            "trade_timestamp":1576083062,
            "type":"sell"
        },
        {
            "trade_id":5627108,
            "price":"7207.14",
            "base_volume":"0.019604",
            "quote_volume":"141.28877256",
            "trade_timestamp":1576083058,
            "type":"sell"
        },
        {
            "trade_id":5627079,
            "price":"7207.42",
            "base_volume":"0.01802",
            "quote_volume":"129.8777084",
            "trade_timestamp":1576083037,
            "type":"sell"
        },
        {
            "trade_id":5627062,
            "price":"7207.74",
            "base_volume":"0.014654",
            "quote_volume":"105.62222196",
            "trade_timestamp":1576083002,
            "type":"sell"
        },
        {
            "trade_id":5627051,
            "price":"7208",
            "base_volume":"0.00614",
            "quote_volume":"44.25712",
            "trade_timestamp":1576082998,
            "type":"sell"
        }
    ]
}
                

where

  • trades – an array of trades
  • trade_id – unique identifier of the trade
  • price – trade price
  • base_volume – trade volume in base currency
  • quote_volume – trade volume in quoted currency
  • trade_timestamp – trade execution time in UNIX timestamp format
  • type – trade direction

Orders list

GET request at https://demo.buyownex.com/api/v1/orders/{pair}

Headers:

  • X-Api-Key – Bearer <token>

Required parameters:

  • pair – currency pair in the format <code of the base currency>_<code of the quote currency>

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/orders/BTC_USDT

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "buy_limit": [
        {
            "id": 344322,
            "originalAmount": "0.5",
            "actualAmount": "0.2",
            "price": "7207.14",
            "time": 1576083062,
        },
        {
            "id": 344323,
            "originalAmount": "0.2",
            "actualAmount": "0.11",
            "price": "7205.22",
            "time": 1576084077,
        }
    ],
    "sell_limit": [
        {
            "id": 344324,
            "originalAmount": "0.5",
            "actualAmount": "0.2",
            "price": "7217.14",
            "time": 1576085062,
        },
        {
            "id": 344325,
            "originalAmount": "0.2",
            "actualAmount": "0.11",
            "price": "7215.22",
            "time": 1576085077,
        }
    ],
    "buy_sl": [],
    "sell_sl": [],
    "buy_tp": [],
    "sell_tp": [],
    "buy_ts": [],
    "sell_ts": []
}
                

where

  • buy_limit – an array of buy limit orders
  • sell_limit – an array of sell limit orders
  • buy_sl – an array of buy stop loss orders
  • sell_sl – an array of sell stop loss orders
  • buy_tp – an array of buy take profit orders
  • sell_tp – an array of sell take profit orders
  • buy_ts – an array of buy trailing stop orders
  • sell_ts – an array of sell trailing stop orders
  • id – unique identifier of the order
  • originalAmount – the initial amount of currency in the order
  • actualAmount – the current amount of currency in the order
  • price – buy/sell order price
  • time – order placing time in UNIX timestamp format

Order info

GET request at https://demo.buyownex.com/api/v1/order_info?order={order}

Headers:

  • X-Api-Key – Bearer <token>

Required parameters:

  • order – unique identifier of the order

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/order_info?order=344325

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "id": 344325,
    "status": "partiallyFilled",
    "pair": "BTC_USDT",
    "type": "LIMIT",
    "side": "sell",
    "price": "7215.22",
    "size": "0.2",
    "actualSize": "0.11",
    "trades": [
        {
            "id": 5627162,
            "size": "0.02",
            "price": "7215.22",
            "time": 1576084062
        },
        {
            "id": 5627173,
            "size": "0.07",
            "price": "7215.22",
            "time": 1576089055
        }
    ]
}
                

where

  • id – unique identifier of the order
  • status – current order status. Possible values: accepted, partiallyFilled, filled
  • pair – currency pair
  • type – order type. Possible values: LIMIT, MARKET, STOPLOSS, TAKEPROFIT, TRAILINGSTOP
  • side – order direction. Possible values: sell, buy
  • price – order buy/sell price
  • size – the initial amount of currency in the order
  • actualSize – the current amount of currency in the order
  • trades – array of trades on this order

Balance

GET request at https://demo.buyownex.com/api/v1/balance?currency={currency}

Headers:

  • X-Api-Key – Bearer <token>

Required parameters:

  • currency – currency code

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/balance?currency=BTC

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "currency": "BTC",
    "safe": "1.723",
    "withdraw": "1.2",
    "trade": "3.7455",
    "blocked": "2.7",
}
                

where

  • currency – currency code
  • safe – available funds to an external account
  • withdraw – blocked funds for withdrawal
  • trade – available funds on the trading account
  • blocked – funds blocked under orders

Transactions list

GET request at https://demo.buyownex.com/api/v1/transactions?currency={currency}

Headers:

  • X-Api-Key – Bearer <token>

Required parameters:

  • currency – currency code

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/transactions?currency=BTC

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "currency": "BTC",
    "count": 2,
    "transactions": [
        {
            "id": 16625,
            "amount": "0.2",
            "currency": "BTC",
            "type": true,
            "status": "done",
            "time": 1576091055
        },
        {
            "id": 16634,
            "amount": "0.11",
            "currency": "BTC",
            "type": false,
            "status": "wait",
            "time": 1576091055
        }
    ]
}
                

where

  • currency – currency code
  • count – total number of currency transactions
  • transactions – an array of transactions
  • id – unique transaction ID
  • amount – transaction amount
  • type – transaction type (true - deposit, false - withdrawal)
  • status – transaction status. Possible values: accepted, wait - in the process of execution, done - executed
  • time – the time that a transaction was created in UNIX timestamp format

Transfers list

GET request at https://demo.buyownex.com/api/v1/transfers?currency={currency}

Headers:

  • X-Api-Key – Bearer <token>

Required parameters:

  • currency – currency code

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/transfers?currency=BTC

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "currency": "BTC",
    "count": 2,
    "transfers": [
        {
            "id": 36123,
            "amount": "0.2",
            "currency": "BTC",
            "side": true,
            "time": 1576091055
        },
        {
            "id": 36222,
            "amount": "0.11",
            "currency": "BTC",
            "side": false,
            "time": 1576091055
        }
    ]
}
                

where

  • currency – currency code
  • count – total number of internal currency transfers
  • transfers – an array of transfers
  • id – unique transfer ID
  • amount – transfer amount
  • side – transfer type (true - from external account to trading account, false - from trading account to an external)
  • time – the time that a transfer was created in UNIX timestamp format

Current fee info

GET request at https://demo.buyownex.com/api/v1/fee?currency={currency}

Headers:

  • X-Api-Key – Bearer <token>

Required parameters:

  • currency – currency code

Optional parameters:
-

Example:

https://demo.buyownex.com/api/v1/fee?currency=BTC

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "currency": "BTC",
    "fee": "0.2"
}
                

where

  • currency – currency code
  • fee – current trade fee for specified currency

Place order

POST request at https://demo.buyownex.com/api/v1/makeOrder

Headers:

  • X-Api-Key – Bearer <token>
  • Content-Type – application/x-www-form-urlencoded

Required parameters:

  • type – order type. Can take only two values: LIMIT or MARKET
  • currency – code of the base currency
  • market – code of the quote currency
  • side – direction of the order: 0 - buy order, 1 - sell order
  • amount – quantity of currency bought/sold
  • rate – buy/sell price

Optional parameters:

  • sl_rate – the stop loss price level at which a back-directed market order will be created for the executed volume
  • tp_rate – the take profit price level at which a back-directed market order will be created for the executed volume
  • ts_offset – trailing stop price offset, at which a back-directed market order will be created for the executed volume

Example:

type=LIMIT¤cy=BTC&market=USDT&side=0&amount=0.5&rate=7112.1&tp_rate=7200

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "orders": {
        "order_id": 344711,
        "tp_order_id": 344712
    }
}
                

where

  • orders – list of created orders
  • order_id – unique identifier of the order (LIMIT or MARKET)
  • tp_order_id – unique identifier of take profit order (if tp_rate parameter was set)
  • sl_order_id – unique identifier of stop loss order (if sl_rate parameter was set)
  • ts_order_id – unique identifier of trailing stop order (if ts_offset parameter was set)

Cancel order

POST request at https://demo.buyownex.com/api/v1/cancelOrder

Headers:

  • X-Api-Key – Bearer <token>
  • Content-Type – application/x-www-form-urlencoded

Required parameters:

  • order_id – unique identifier of the order (limit or conditional order)
  • currency – code of the base currency
  • market – code of the quote currency

Optional parameters:
-

If a LIMIT order that was placed with additional parameters sl_rate, tp_rate or ts_offset is canceled and this order has not yet started to be executed, then all conditional orders are canceled as well. If there are already deals on the cancelled limit order, only the limit order is cancelled. Conditional orders tied to the limit should be canceled by a separate request.

Example:

order_id=344711¤cy=BTC&market=USDT

If the answer is successful the string in JSON format will be returned

{
    "success":true,
    "code":200,
    "orders": {
        "order_id": 344711,
        "tp_order_id": 344712
    }
}
                

where

  • orders – list of cancelled orders
  • order_id – unique identifier of the cancelled order with LIMIT type
  • tp_order_id – unique identifier of the cancelled take profit order
  • sl_order_id – unique identifier of the cancelled stop loss order
  • ts_order_id – unique identifier of the cancelled trailing stop order