Generate a temporary crypto address for deposit [Private]
Generates and returns a temporary deposit address for cryptocurrencies.
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/deposit/private/crypto/generateMerchantAddress |
Request type: | POST |
Data dictionary
Name | Type | Parameter type | Required | Range | Description |
---|---|---|---|---|---|
currency | string | BODY | YES | - | Cryptocurrency code. All available cryptocurrency assets are available through "Get information about available currencies" endpoint. |
source | string | BODY | YES | - | Blockchain name for which you want to get the address to deposit into the account, e.g. BTC, ETH, TRX. |
callbackUrl | string | BODY | NO | - | After the deposit is completed, a POST request will be created to the callbackUrl . |
referenceId | string | BODY | NO | - | External reference id from merchant side. |
source
for TRC20 and ERC20 tokens:USDT TRC20 and other TRC20 tokens -
TRX
.
USDT ERC20 and other ERC20 tokens -ETH
.You can learn more about all the blockchains in our knowledge base.
If the cryptocurrency asset has only its own blockchain, then
currency
andsource
should repeat the name of the asset, for example for BTC:"currency": "BTC"
,"source": "BTC"
.
If the cryptocurrency asset has more than one blockchain, then thesource
should specify the name of the blockchain, for example for USDT in the TRC20 network:"currency": "USDT"
,"source": "TRX"
.
Exemplary request
const apiKey = "YOUR_API_KEY"; // put here your Api key
const url = "https://api.kuna.io";
const path = "/v4/deposit/private/crypto/generateMerchantAddress";
const body = {
"currency": "XRP",
"source": "XRP",
"callbackUrl": "https://webhook.site/93bb7724-8ef1-4464-9156-c0c10d7ca509",
"referenceId": "your-id-001"
}; // request to generate an address for XRP asset in XRP network
const options = {
method: "POST",
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/deposit/private/crypto/generateMerchantAddress"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"api-key": api_key,
}
body = {
"currency": "XRP",
"source": "XRP",
"callbackUrl": "https://webhook.site/93bb7724-8ef1-4464-9156-c0c10d7ca509",
"referenceId": "your-id-001"
} # request to generate an address for XRP asset in XRP network
request = requests.post(url + path, headers=headers, json=body)
print(request.json())
How to call private endpoints here
Response
You will get a JSON object as a response to the request:
{
"id": "c52b6646-fb91-4760-b147-a4f952e8652c", // ID of the address.
"source": "XRP", // Blockchain name for which you want to get the address to deposit into the account.
"address": "rEZnowWMyrY8YoGwLatyPBxx8QkJeimgAb", // Your deposit address.
"memo":"3531527918" // Memo tag
}
After the deposit is completed, a POST request will be created for the callbackUrl
and it will return a JSON object like this:
{
"id": "83c2a31c-c933-582a-835e-f4a0f871291c",
"fee": "0.38761",
"memo": "3531527918",
"txId": "40EE4697FD293A945E51161F081F9BA4A07F247609985F80A6A000FB0F624C17",
"type": "Deposit",
"asset": "XRP",
"amount": "38.761",
"reason": [],
"status": "Processed",
"userId": "13e6030c-52ef-4c67-bd89-fdad411c20eb",
"address": "rEZnowWMyrY8YoGwLatyPBxx8QkJeimgAb",
"createdAt": "2023-06-15T07:11:20.405Z",
"updatedAt": "2023-06-15T07:11:20.405Z",
"callbackId": "your-id-001",
"merchantId": "16214228-5c0c-5abc-be6a-c90259b21d4e",
"paymentCode": "XRP",
"processedAmount": "38.37339"
}
Also, if the deposit has not passed the AML check, then this transaction was credited to your generated wallet address but was not credited to your Kuna account because the transaction has a higher risk:
{
"id": "83c2a31c-c933-582a-835e-f4a0f871291c",
"fee": "0.38761",
"memo": "3531527918",
"txId": "40EE4697FD293A945E51161F081F9BA4A07F247609985F80A6A000FB0F624C17",
"type": "Deposit",
"asset": "XRP",
"amount": "38.761",
"reason": [],
"status": "Pending",
"userId": "13e6030c-52ef-4c67-bd89-fdad411c20eb",
"address": "rEZnowWMyrY8YoGwLatyPBxx8QkJeimgAb",
"createdAt": "2023-06-15T07:11:20.405Z",
"updatedAt": "2023-06-15T07:11:20.405Z",
"callbackId": "your-id-001",
"merchantId": "16214228-5c0c-5abc-be6a-c90259b21d4e",
"paymentCode": "XRP",
"processedAmount": "38.37339",
"alerts": [
{
"service": null,
"category": "sanctions",
"alertLevel": "SEVERE",
"categoryId": 3,
"externalId": "620174ae-587a-41a1-897c-836011767e4f",
"alertAmount": 3.25,
"riskPercent": 6.5,
"exposureType": "INDIRECT"
},
{
"service": null,
"category": "high risk jurisdiction",
"alertLevel": "HIGH",
"categoryId": 25,
"externalId": "3d00ddef-3f47-4b29-93f9-30a19cf3895a",
"alertAmount": 3.25,
"riskPercent": 6.5,
"exposureType": "INDIRECT"
}
],
"riskPerCent": 13
}
In this case, please contact our support.
For high-risk transactions we send several callbacks.
You can read more about it in the "Merchant API" guide.
Updated about 1 year ago