Search of operations [Private]

Search for all operations (exchange, deposits, withdrawals, transfers).

Method name:/v2/operation/find
Request type:POST

📘

To call private endpoints, you need to get a JWT token or an API key for authentication.

Here you can learn in detail how to successfully authenticate.

This endpoint is designed to search for one or more operations based on the specified parameters.

In response to a request to this endpoint, the details of the found operations are returned (fields analogous to those returned when creating operations), their current statuses, and their IDs.

Data dictionary

NameTypeParameter typeRequiredRangeDescription
typestringBODYNODeposit, Withdraw, DepositWithExchange, WithdrawWithExchange, CryptoExchange, Transfer, BuyToSendCryptoOperation type.
statusstringBODYNOCreated, Processing, OnHold, Declined, CompletedOperation status.
walletIdstringBODYNO-Unique identifier of customer wallet in KunaCore.
externalIdstringBODYNO-Unique Id of operation in your system.
targetAssetstringBODYNO-Target or quote Asset code.
sourceAssetstringBODYNO-Source or base Asset code.
dateFromstringBODYNO-ISO 8601 date string. Search records by field “createdAt” that were created after this date.
dateTostringBODYNO-ISO 8601 date string. Search records by field “createdAt” that were created before this date.
skipintQUERYNO1 - ...Number of records to skip.
takeintQUERYNO1 - ...Number of records to take.

Exemplary request

const url = BASE_URL;
const path = "/v2/operation/find?skip=2&take=1";

const body = {
  walletId: "1f44b1c7-9fd4-4d20-b9a4-7aca3646d0d5",
  type: "BuyToSendCrypto",
  status: "Completed",
  targetAsset: "USDT"
};

const options = {
  method: "POST",
  headers: {
    accept: "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${data.accessToken}` // data.accessToken - generated a JWT token via /v2/auth/login.
  },
  body: JSON.stringify(body),
};

fetch(url + path, options)
  .then((response) => response.json())
  .then((showResponse) => console.log(showResponse.data));
import requests

url = BASE_URL
path = "/v2/operation/find?skip=2&take=1"
headers = {
    "accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer " + data.accessToken # data.accessToken - generated a JWT token via /v2/auth/login.
}
body = {
  "walletId": "1f44b1c7-9fd4-4d20-b9a4-7aca3646d0d5",
  "type": "BuyToSendCrypto",
  "status": "Completed",
  "targetAsset": "USDT"
}

request = requests.post(url + path, headers=headers, json=body)
print(request.json())

How to call private endpoints here

Swagger here

Response

{
  "data": [
    {
      "id": "41c039a2-0efd-4f8a-9015-b60a1c668d27",                                           // Internal operation ID.
      "walletId": "1f44b1c7-9fd4-4d20-b9a4-7aca3646d0d5",                                     // Customer wallet ID.
      "type": "BuyToSendCrypto",                                                              // Operation type.
      "status": "Completed",                                                                  // Operation status.
      "sourceAsset": "EUR",                                                                   // Asset of the amount spent.
      "targetAsset": "USDT",                                                                  // Amount received.
      "targetAmount": "15.07768",                                                             // Asset of the amount received.
      "rate": "1.015332",                                                                     // Exchange rate.
      "reason": null,                                                                         // Reason for stopping the operation.
      "address": "T9zGcAgLTSQdwqiebc4miqreaUZ68HrhiF",                                        // Cryptocurrency withdrawal address.
      "blockchainTxId": "7adb36e22f686e3fcc92af79353fbd83dc47b5f14e60aa404090b8b1c67d8761",   // Withdrawal transaction hash.
      "callbackUrl": "https://webhook.site/12495b92-cbe4-4e88-a645-19b1ae5f4c97",             // Link to the callback handler.
      "createdAt": "2024-03-13T17:22:32.664Z",                                                // Operation сreation time.
      "completedAt": "2024-03-13T17:39:58.949Z",                                              // Operation сompletion time.
      "feeDepositAsset": "EUR",                                                               // Fee asset of deposit.
      "feeTradeAsset": "USDT",                                                                // Fee asset of trade.
      "feeWithdrawAsset": "USDT",                                                             // Fee asset of withdrawal.
      "externalId": "buy-send-001",                                                           // External operation ID.       
      "feeDeposit": "0.15",                                                                   // Deposit fee.
      "feeTrade": "0",                                                                        // Trade fee.
      "feeWithdraw": "0",                                                                     // Withdrawal fee.
      "memo": null,                                                                           // Memo of the cryptocurrency withdrawal address.
      "network": null,                                                                        // Cryptocurrency withdrawal address network.
      "totalFeeSourceAsset": "0.15",                                                          // Total fees of the base (Source) asset.
      "totalFeeTargetAsset": "0.1523"                                                         // Total fees of the quote (Target) asset.
    }
  ]
}