Get trades by order id [Private]

Get all the trades, associated with the order id. Returns an array of trades, if any were executed per the order.

📘

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/{id}/trades
Request type:GET

Data dictionary

NameTypeParameter typeRequiredRangeDescription
idstringPATHYES-The UUID of the order to show details.

Exemplary request

To fully utilize this endpoint, the checked order must have executed trades. You should receive an order id in the response when creating orders or you can get its id using Get private orders history or Get active client orders, please add it to the path of this request::

const apiKey = "YOUR_API_KEY"; // put here your Api key

const url = "https://api.kuna.io";
const path = "/v4/order/private/2c0f666c-19f3-4af2-a796-ea8ac5a92e80/trades";
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/2c0f666c-19f3-4af2-a796-ea8ac5a92e80/trades"
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

Swagger here

Response

[
        {
            "id": "dc360a87-17a9-406f-89ff-c24a1ce0bd7a",            // Unique identifier of an associated order
            "orderId": "2c0f666c-19f3-4af2-a796-ea8ac5a92e80",       // Unique identifier of a trade
            "pair": "TRX_UAH",                                       // Traded pair
            "quantity": "40",                                        // Traded quantity
            "price": "2.67",                                         // Order price
            "isTaker": false,                                        // Various fees for Makers and Takers; "Market" orders are always `true`
            "fee": "0.2670",                                         // Exchange commission fee
            "feeCurrency": "UAH",                                    // Currency of the commission
            "isBuyer": false,                                        // Buy or sell the base asset
            "quoteQuantity": "106.8",                                // Quote asset quantity
            "createdAt": "2023-04-23T09:58:49.706Z"                  // Date-time of trade execution, UTC
        },
        {
            "id": "4dcc908c-1cf6-4706-b9e6-684532850e3c",
            "orderId": "2c0f666c-19f3-4af2-a796-ea8ac5a92e80",
            "pair": "TRX_UAH",
            "quantity": "18.7265",
            "price": "2.67",
            "isTaker": true,
            "fee": "0.1249993875",
            "feeCurrency": "UAH",
            "isBuyer": false,
            "quoteQuantity": "49.999755",
            "createdAt": "2023-04-23T09:20:17.106Z"
        },
        {
            "id": "c90f5013-4456-492a-b518-48eaa0d20eb9",
            "orderId": "2c0f666c-19f3-4af2-a796-ea8ac5a92e80",
            "pair": "TRX_UAH",
            "quantity": "41.2735",
            "price": "2.67",
            "isTaker": false,
            "fee": "0.2755006125",
            "feeCurrency": "UAH",
            "isBuyer": false,
            "quoteQuantity": "110.200245",
            "createdAt": "2023-04-23T09:59:04.326Z"
        }
]