Get history of created Kuna Сodes [Private]
This method allows to get a list of Kuna Codes that have been issued from 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/issued-by-me |
Request type: | GET |
Data dictionary
Name | Type | Parameter type | Required | Range | Description |
---|---|---|---|---|---|
sortField | enum | QUERY | NO | amount , createdAt , redeemedAt | amount - sort by amount; createdAt - sort by Kuna Code creation date; redeemedAt - sort by Kuna Code activation date.Parameter sortField defaults to redeemedAt if not provided. |
sortOrder | enum | QUERY | NO | asc , desc | Sort the resulting list newest-on-top (desc ) or oldest-on-top (asc ). Parameter sortOrder defaults to desc if not provided. |
take | int | QUERY | NO | 1 - 100 | Select the number of activated Kuna Сodes. The default return is 20 activated Kuna Сodes. |
skip | int | QUERY | NO | 1 - ... | Select the number of activated Kuna Сodes to skip. The default is 0 activated Kuna Сodes to skip. |
status | enum | QUERY | NO | WAIT_CONFIRMATION , CANCEL , ACTIVE , REDEEMED , FREEZE | Filter by status. |
take
andskip
fields:The maximum number of transactions you can get at one time is 100. If you have more than 100 transactions, you need to use the
take
andskip
fields.For example, you have 300 transactions:
- at the first call, we get the first 100 transactions:
/v4/kuna-code/issued-by-me?take=100&skip=0
;- to get the second array of the next 100 transactions:
/v4/kuna-code/issued-by-me?take=100&skip=100
;- to get the third array of 100 transactions:
/v4/kuna-code/issued-by-me?take=100&skip=200
.
Exemplary request
const apiKey = "YOUR_API_KEY"; // put here your Api key
const url = "https://api.kuna.io";
const path = "/v4/kuna-code/issued-by-me?sortField=amount&sortOrder=asc&take=5&status=ACTIVE";
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/issued-by-me?sortField=amount&sortOrder=asc&take=5&status=ACTIVE"
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
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.
}
]
Updated 3 months ago