Get Open Orders

List your current open orders. Only open or un-settled orders are returned by default. As soon as an order is no longer open and settled, it will no longer appear in the default request.

For all transactions related to the private endpoint, you must authorize before sending your request.

For more information you can check our Authentication V1 article.

  • pairSymbol parameter can be used for the /api/v1/openOrders endpoint.

  • To access your open orders, you need to enter the pairSymbol parameter.

Request Example:

https://api.btcturk.com/api/v1/openOrders?pairSymbol=BTCUSDT

Open Orders for BTCUSDT are listed

Open Orders

GET https://api.btcturk.com/api/v1/openOrders

Query Parameters

NameTypeDescription

pairSymbol

string

BTCTRY, ETHTRY etc.

Headers

NameTypeDescription

X-PCK*

string

API public key. You can create the API key from the Account > API Access page in your exchange account.

X-Stamp*

integer

Nonce must be current timestamp in miliseconds. It is a must to sync your current time with API server time which is in miliseconds format. Our servers are using UTC timezone.

X-Signature*

string

Signature is a HMAC-SHA256 encoded message. The HMAC-SHA256 code must be generated using a private key that contains a timestamp as nonce and your API key.

{   "success": true,
    "message": null,
    "code": 0,
    "data": {
        "asks": [{
            "id": 16060235,
            "price": "66800.00",
            "amount": "0.09733687",
            "quantity": "0.09733687",
            "stopPrice": "0.00",
            "pairSymbol": "BTCTRY",
            "pairSymbolNormalized": "BTC_TRY",
            "type": "sell",
            "method": "limit",
            "orderClientId": "da593000-6eb3-4a1c-ba26-c616122a0210",
            "time": 0,
            "updateTime": 1591286401373,
            "status": "Untouched",
            "leftAmount": "0.09733687"
        },
        {
            "id": 16060237,
            "price": "66867.00",
            "amount": "0.04971904",
            "quantity": "0.04971904",
            "stopPrice": "0.00",
            "pairSymbol": "BTCTRY",
            "pairSymbolNormalized": "BTC_TRY",
            "type": "sell",
            "method": "limit",
            "orderClientId": "da593000-6eb3-4a1c-ba26-c616122a0210",
            "time": 0,
            "updateTime": 1591286411913,
            "status": "Partial",
            "leftAmount": "0.0412345"
        },
],
        "bids": [{
            "id": 16071095,
            "price": "65817.00",
            "amount": "0.08956055",
            "quantity": "0.08956055",
            "stopPrice": "0.00",
            "pairSymbol": "BTCTRY",
            "pairSymbolNormalized": "BTC_TRY",
            "type": "buy",
            "method": "limit",
            "orderClientId": "da593000-6eb3-4a1c-ba26-c616122a0210",
            "time": 0,
            "updateTime": 1591352311273,
            "status": "Untouched",
            "leftAmount": "0.08956055"
        },
        {
            "id": 14703840,
            "price": "30451.00",
            "amount": "0.06140209",
            "quantity": "0.06140209",
            "stopPrice": "0.00",
            "pairSymbol": "BTCTRY",
            "pairSymbolNormalized": "BTC_TRY",
            "type": "buy",
            "method": "limit",
            "orderClientId": "da593000-6eb3-4a1c-ba26-c616122a0210",
            "time": 0,
            "updateTime": 1584426660947,
            "status": "Partial",
            "leftAmount": "0.04909774"
        }]
    }
}

Open Orders Code Example

// You can download ApiClient .net core complete library from github https://github.com/BTCTrader/broker-api-csharp-v2

var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

var publicKey = configuration["publicKey"];
var privateKey = configuration["privateKey"];
var resourceUrl = configuration["resourceUrl"];
var apiClientV1 = new ApiClientV1(publicKey, privateKey, resourceUrl);

var openOrders = apiClientV1.GetOpenOrders();

if (openOrders.Result != null && openOrders.Result.Success)
{
    foreach (var askOrder in openOrders.Result.Data.Asks)
    {
        Console.WriteLine(askOrder);
    }

    foreach (var bidOrder in openOrders.Result.Data.Bids)
    {
        Console.WriteLine(bidOrder);
    }
}

Last updated