Transfer [Private]

This endpoint allows you to withdraw cryptocurrency assets.

Method name:/v2/transfer
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 type of operation allows you to transfer funds between clients of the same institution (partner) or between the institution wallets. Transfers between institutional wallets and customer wallets are forbidden.

To make a transfer, it is enough to specify the amount and currency of such a transfer and also determine walletId of the wallet from which the funds should be debited and the walletId of the wallet to which the funds will be credited.

Fees values for this type of payment, as well as the minimum and maximum values of the transfer amount are displayed when requesting /v2/transfer/pre-request.

Transfer can acquire the following statuses:

CreatedOperation created.
ProcessingOperation in processing.
OnHoldThe operation is blocked (for example, for checking AML).
DeclinedThe operation is rejected.
CompletedThe operation is successful.

To provide information about the status of the operation, a callback service is implemented. The link for receiving callbacks should be provided in the transfer request.

The duration of execution of a transfer is instant.

Information about the amount of operation fees will be indicated along with other operation details.

Data dictionary

NameTypeParameter typeRequiredRangeDescription
fromWalletIdstringBODYYES-The unique identifier of the sender's wallet in Kuna Core.
toWalletIdstringBODYYES-The unique identifier of the recipient's wallet in Kuna Core.
amountstringBODYYES1-...Amount of funds to withdraw.
externalIdstringBODYYES-Unique Id of operation in your system.
callbackUrlstringBODYNO-After the withdraw is completed, a POST request will be created to the callbackUrl.
assetstringBODYYES-Asset(Currency) code, e.g. BTC - Bitcoin, ETH - Ethereum.

Exemplary request

const url = BASE_URL;
const path = "/v2/transfer";

const body = {
    fromWalletId: "5590cbd3-bce6-45c6-9e42-cc5e69b5ef86",
    toWalletId: "2c8f11c4-1c57-4d3a-a6b5-4d3ab0783d82",
    amount: "2",
    asset: "USDT",
    externalId: "transfer-001",
    callbackUrl: "https://webhook.site/12495b92-cbe4-4e88-a645-19b1ae5f4c97"
  };

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/transfer"
headers = {
    "accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer " + data.accessToken # data.accessToken - generated a JWT token via /v2/auth/login.
}
body = {
  "fromWalletId": "5590cbd3-bce6-45c6-9e42-cc5e69b5ef86",
  "toWalletId": "2c8f11c4-1c57-4d3a-a6b5-4d3ab0783d82",
  "amount": "2",
  "asset": "USDT",
  "externalId": "transfer-001",
  "callbackUrl": "https://webhook.site/12495b92-cbe4-4e88-a645-19b1ae5f4c97"
}

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

How to call private endpoints here

Swagger here

Response

{
  "data": [
    {
      "id": "f9640400-3dd1-4bab-8d61-0876177b1ea5",                                           // Internal operation ID.
      "walletId": "1f44b1c7-9fd4-4d20-b9a4-7aca3646d0d5",                                     // Customer wallet ID.
      "type": "Transfer",                                                                     // Operation type.
      "status": "Processing",                                                                 // Operation status.
      "sourceAsset": "USDT",                                                                  // Asset of the amount spent.
      "targetAsset": "USDT",                                                                  // Amount received.
      "targetAmount": "1.96",                                                                 // Asset of the amount received.
      "rate": null,                                                                           // Exchange rate.
      "reason": null,                                                                         // Reason for stopping the operation.
      "address": "00f157aa-96a3-4783-987c-d1342b4ca94a",                                      // Cryptocurrency withdrawal address.
      "blockchainTxId": null,                                                                 // 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": null,                                                                    // Operation сompletion time.
      "feeDepositAsset": null,                                                                // Fee asset of deposit.
      "feeTradeAsset": null,                                                                  // Fee asset of trade.
      "feeWithdrawAsset": "USDT",                                                             // Fee asset of withdrawal.
      "externalId": "transfer-001",                                                           // External operation ID.       
      "feeDeposit": null,                                                                     // Deposit fee.
      "feeTrade": null,                                                                       // Trade fee.
      "feeWithdraw": "0.04",                                                                  // Withdrawal fee.
      "memo": null,                                                                           // Memo of the cryptocurrency withdrawal address.
      "network": null,                                                                        // Cryptocurrency withdrawal address network.
      "totalFeeSourceAsset": "0.04",                                                          // Total fees of the base (Source) asset.
      "totalFeeTargetAsset": null                                                             // Total fees of the quote (Target) asset.
    }
  ]
}

Calback

{
  "data": {
    "id": "f9640400-3dd1-4bab-8d61-0876177b1ea5",
    "memo": null,
    "rate": null,
    "type": "Transfer",
    "reason": null,
    "status": "Created | OnHold | Processing | Completed | Declined",
    "address": "00f157aa-96a3-4783-987c-d1342b4ca94a",
    "network": null,
    "feeTrade": null,
    "metadata": {},
    "walletId": "1f44b1c7-9fd4-4d20-b9a4-7aca3646d0d5",
    "createdAt": "2024-03-19T15:57:46.666Z",
    "externalId": "transfer-001",
    "feeDeposit": null,
    "callbackUrl": "https://webhook.site/12495b92-cbe4-4e88-a645-19b1ae5f4c97",
    "completedAt": "2024-03-19T15:57:47.132Z",
    "feeWithdraw": "0.04",
    "sourceAsset": "USDT",
    "targetAsset": "USDT",
    "sourceAmount": "2",
    "targetAmount": "1.96",
    "feeTradeAsset": null,
    "initialAmount": "2",
    "blockchainTxId": null,
    "feeDepositAsset": null,
    "feeWithdrawAsset": "USDT",
    "totalFeeSourceAsset": "0.04",
    "totalFeeTargetAsset": null
  }
}