Activate a Kuna Code [Private]

This method allows to activate the Kuna Code and credit the funds to your account.

🚧

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/redeem
Request type:PUT

Data dictionary

NameTypeParameter typeRequiredRangeDescription
codestringBODYYES-You need to specify all the symbols of the Kuna Сode, for example: 857ny-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-KUN-KCode

Exemplary request

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

const url = "https://api.kuna.io";
const path = "/v4/kuna-code/redeem";
const body = {
  code: "XwBHu-42KCQ-qSuvd-eWmRF-Zonue-xzVwm-k47Jz-8p2uT-7t5kC-USDT-KCode",
};

const options = {
    method: "PUT",
    headers: {
        accept: "application/json",
        "Content-Type": "application/json",
        "api-key": apiKey,
    },
    body: JSON.stringify(body),
};

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/redeem"
headers = {
    "accept": "application/json",
    "Content-Type": "application/json",
    "api-key": api_key,
}
body = {
    "code": "XwBHu-42KCQ-qSuvd-eWmRF-Zonue-xzVwm-k47Jz-8p2uT-7t5kC-USDT-KCode"
}

request = requests.put(url + path, headers=headers, json=body)
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: "2023-07-06T16:53:28.999Z",                                        // 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: 'REDEEMED',                                                            // 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.
}