Get order details by id [Private]
Get order details by order id (e.g. 4802bc23-45e9-4299-b878-48a41432ef17
). Returns an order object. Also, may include an array of trades if withTrades = true
.
To call any private endpoint, headers should include authorization key(s).
You may use a single API key or a public-private key pair based on your current tasks. Here you may find typical Header configurations for both options.
Method name: | /v4/order/private/details/{id}?withTrades={withTrades} |
Request type: | GET |
Data dictionary
Name | Type | Parameter type | Required | Range | Description |
---|---|---|---|---|---|
id | string | PATH | YES | - | The UUID of the order to show details. |
withTrades | bool | QUERY | NO | true , false | Specify if the response should include trades associated with the order. |
Exemplary request
First you will need to create a new order using Create a new order endpoint. After an order is successfully created, we return the id
, which can be used in this request.
If an order has already been created you can get its id using Get private orders history or Get active client orders. After that, please try these requests:
Example path | Description |
---|---|
/v4/order/private/details/4802bc23-45e9-4299-b878-48a41432ef17 | Returns information about your order without its trades. |
/v4/order/private/details/4802bc23-45e9-4299-b878-48a41432ef17?withTrades=true | Returns information about your order with its trades. |
const apiKey = "YOUR_API_KEY"; // put here your Api key
const url = "https://api.kuna.io";
const path = "/v4/order/private/details/4802bc23-45e9-4299-b878-48a41432ef17";
const options = {
method: "GET",
headers: {
accept: "application/json",
"Content-Type": "application/json",
"api-key": apiKey,
},
};
fetch(url + path, options)
.then((response) => response.json())
.then((showResponse) => console.log(showResponse.data));
import requests
api_key = "YOUR_API_KEY" # put here your Api key
url = "https://api.kuna.io"
path = "/v4/order/private/details/4802bc23-45e9-4299-b878-48a41432ef17"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"api-key": api_key,
}
request = requests.get(url + path, headers=headers)
print(request.json())
How to call private endpoints here
Response
{
"id": "4b9b9705-e85f-4180-bdec-219fbf025fa3", // Unique identifier of an order
"type": "Limit", // Type of an order
"quantity": "0.00054", // Original order quantity
"executedQuantity": "0.00054", // Traded quantity in stock (>0 if traded)
"cumulativeQuoteQty": "14.99580", // Traded quantity in money (>0 if traded)
"cost": "14.9958", // Total amount
"side": "Bid", // Bid for buying base asset, Ask for selling base asset. FYI: For BTC_USDT trading pair, BTC is the base asset
"pair": "BTC_USDT", // Traded pair
"price": "27770", // Price of the trade
"status": "Closed", // The status of the order
"createdAt": "2023-05-08T08:39:46.708Z", // Date-time of order creation, UTC
"updatedAt": "2023-05-08T08:53:58.332Z", // Date-time of the last update of the order, UTC
"closedAt": "2023-05-08T08:53:58.333Z" // Date-time of order finish time, UTC
}
If you also add withTrades=true
and trades were executed for the order, then the data
object will include trades
array, for example:
{
"id": "4b9b9705-e85f-4180-bdec-219fbf025fa3",
"type": "Limit",
"quantity": "0.00054",
"executedQuantity": "0.00054",
"cumulativeQuoteQty": "14.99580",
"cost": "14.9958",
"side": "Bid",
"pair": "BTC_USDT",
"price": "27770",
"status": "Closed",
"createdAt": "2023-05-08T08:39:46.708Z",
"updatedAt": "2023-05-08T08:53:58.332Z",
"closedAt": "2023-05-08T08:53:58.333Z",
"trades": [
{
"id": "15ff497c-8d25-4155-8184-bb1f905cce1e", // Unique identifier of a trade
"orderId": "4b9b9705-e85f-4180-bdec-219fbf025fa3", // Unique identifier of an associated order
"pair": "BTC_USDT", // Traded pair
"quantity": "0.00054", // Traded quantity
"price": "27770", // Traded price
"isTaker": false, // Various fees for Makers and Takers; "Market" orders are always `true`
"fee": "0.000001350", // Exchange commission fee
"feeCurrency": "BTC", // Currency of the commission
"isBuyer": true, // Buy or sell the base asset
"quoteQuantity": "14.9958", // Quote asset quantity
"createdAt": "2023-05-08T08:53:58.332Z" // Date-time of trade execution, UTC
}
]
}
Updated over 1 year ago