Get Kuna Code details by id [Private]

This method allows to get information about a Kuna Code by its id.

🚧

Available for Merchant accounts only!

📘

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

Data dictionary

NameTypeParameter typeRequiredRangeDescription
idstringQUERYYES-Kuna Code ID.
🚧

If you are not the creator of the Kuna Code, you will get an error in response:

code: 'KUNA_CODE_NOT_FOUND'

Exemplary request

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

const url = "https://api.kuna.io";
const path = "/v4/kuna-code/cc46c21c-ae43-4614-8629-2af74a32fd8e";
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/kuna-code/cc46c21c-ae43-4614-8629-2af74a32fd8e"
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": "d53881e8-2cfc-4fc1-a291-d68d217ddc11",                                    // Kuna Code ID.
    "amount": 10,                                                                    // Amount of the Kuna Сode.
    "asset": "usdt",                                                                 // Currency of the Kuna Code.
    "code": "hUx93-owczu-LCwSB-X7EQa-TEST1-Jqsit-hMHwJ-uvcBw-XZ5g8-USDT-KCode",      // Secret code key by which it is activated.
    "redeemedAt": null,                                                              // Activation date of the Kuna Code.
    "nonRefundableBefore": "2023-07-07T10:02:11.585Z",                               // Time until which a code cannot be activated by the owner.
    "recipientId": "kunaid-ya4pyttest",                                              // Kuna ID of the recipient. If "all" then anyone can activate it.
    "status": "ACTIVE",                                                              // Status.
    "comment": "Any string",                                                         // Public note.
    "privateComment": "Any string that is available only to the creator",            // Private note.
    "createdAt": "2023-07-07T08:39:28.649Z"                                          // Date of the Kuna Code creation.
}