Get Single Order
Get a single order by orderId
.
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.
This endpoint can be used for more detailed information about orders.
Get Single Order
GET
https://api.btcturk.com/api/v1/order/{orderId}
Query Parameters
Name
Type
Description
orderId*
long
orderId
of the order
{
"data": {
"id": 61912740,
"price": "20000.00",
"amount": "0.12345678",
"quantity": "0.12345678",
"stopPrice": "20000",
"pairSymbol": "BTCTRY",
"pairSymbolNormalized": "BTC_TRY",
"type": "sell",
"method": "stopmarket",
"orderClientId": "BtcTurk API",
"time": 1647883449587,
"updateTime": 1647883449587,
"status": "Untouched",
"leftAmount": "0.1234567800000000"
},
"success": true,
"message": null,
"code": 0
}
<?php
$base = "https://api.btcturk.com";
$apiKey = "YOUR_API_PUBLIC_KEY";
$apiSecret = "YOUR_API_SECRET";
$method = "/api/v1/order/ORDERID_HERE";
$uri = $base.$method;
$nonce = time()*1000;
$message = $apiKey.$nonce;
$signatureBytes = hash_hmac("sha256", $message, base64_decode($apiSecret), true);
$signature = base64_encode($signatureBytes);
$headers = array(
"X-PCK: ".$apiKey,
"X-Stamp: ".$nonce,
"X-Signature: ".$signature,
"Cache-Control: no-cache",
"Content-Type: application/json");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_HTTP_VERSION, "CURL_HTTP_VERSION_1_2");
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
print_r(curl_error($ch));
}
$answer = json_decode($result);
print_r($answer);
Last updated
Was this helpful?