### Getting Available Payment Services (Request) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of calling the `getPaymentServices` method to retrieve a list of available payment methods and their details. ```javascript const paymentServices = await heleket.getPaymentServices(); ``` -------------------------------- ### Installing Heleket SDK with npm Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Command to install the Heleket SDK package using the npm package manager. ```bash $ npm install heleket-api-sdk ``` -------------------------------- ### Getting Available Payment Services (Response) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example JSON response listing available payment services, including network, currency, availability, transaction limits, and commission details for each service. ```json { "state": 0, "result": [ { "network": "TRON", "currency": "USDT", "is_available": true, "limit": { "min_amount": "1.00000000", "max_amount": "1000000.00000000" }, "commission": { "fee_amount": "0.00", "percent": "3.00" } }, { "network": "ETH", "currency": "ETH", "is_available": true, "limit": { "min_amount": "0.01000000", "max_amount": "10000.00000000" }, "commission": { "fee_amount": "0.00", "percent": "3.00" } } ] } ``` -------------------------------- ### Getting Payment Information (Response) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example JSON response containing detailed information about a specific payment retrieved using the `getPaymentInfo` method. ```json { "state": 0, "result": { "uuid": "3901446a-4b74-4796-b50a-14e14dafe3ed", "order_id": "5", "amount": "45.0000", "payment_amount": null, "payer_amount": "0.74067734", "payer_currency": "USDT", "currency": "USD", "comments": null, "network": null, "address": null, "from": null, "txid": null, "payment_status": "check", "url": "https://pay.heleket.com/pay/3901446a-4b74-4796-b50a-14e14dafe3ed", "expired_at": 1660826040, "status": "check", "is_final": false } } ``` -------------------------------- ### Successful Get Payout Info Response - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of a successful response object containing the status and details of a specific payout. ```json { "state": 0, "result": { "uuid": "a7c0caec-a594-4aaa-b1c4-77d511857594", "amount": "3", "currency": "USDT", "network": "tron_trc20", "address": "TJ...", "txid":"AM...", "status": "process", "is_final": false, "balance": 129 } } ``` -------------------------------- ### Successful Get Balance Response - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of a successful response object containing merchant and user balance details for various currencies. ```json { "state": 0, "result": [ { "balance": { "merchant": [ { "uuid": "abcdabcd-abcd-1234-1234-abcdabcd", "balance": "0.00000000", "currency_code": "ETH" }, { "uuid": "abcdabcd-abcd-1234-1234-abcdabcd", "balance": "0.57000000", "currency_code": "BTC" } ], "user": [ { "uuid": "abcdabcd-abcd-1234-1234-abcdabcd", "balance": "0.40000000", "currency_code": "BTC" }, { "uuid": "abcdabcd-abcd-1234-1234-abcdabcd", "balance": "52.00000000", "currency_code": "USDT" } ] } } ] } ``` -------------------------------- ### Importing Heleket SDK (Node.js require) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of importing the Heleket SDK into a Node.js project using the `require()` syntax. ```javascript // Using Node.js `require()` const Heleket = require("heleket-api-sdk"); ``` -------------------------------- ### Importing Heleket SDK (ES6 import) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of importing the Heleket SDK into a project using the ES6 `import` syntax. ```javascript // Using ES6 imports import { Heleket } from "heleket-api-sdk"; ``` -------------------------------- ### Successful Get Payout History Response - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of a successful response object containing a list of payout items and pagination information. ```json { "state": 0, "result": { "merchant_uuid": "cb2131ff-a3d4-46dd-94c6-3714fae65f89", "items": [ { "uuid": "c8734e30-0a8b-47e3-a5e4-375684395245", "amount": "0.00000100", "currency": "USDT", "network": "TRON", "address": "DW...", "txid": "AJ...", "order_id": 1, "status": "paid", "is_final": true, "balance": "98259.99997600" } ], "paginate": { "count": 15, "hasPages": true, "nextCursor": "eyJpZCI6NTEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0", "previousCursor": null, "perPage": 15 } } } ``` -------------------------------- ### Getting Payment History (Response) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example JSON response containing a list of payment items and pagination information retrieved using the `getPaymentHistory` method. ```json { "state": 0, "result": { "items": [ { "uuid": "19b37230-d65d-4a9c-8213-980bfb349144", "order_id": null, "amount": "457.00000000", "payment_amount": null, "payer_amount": null, "payer_currency": null, "currency": "USDT", "comments": null, "network": null, "address": null, "from": null, "txid": null, "payment_status": "check", "url": "https://pay.heleket.com/pay/19b37230-d65d-4a9c-8213-980bfb349144", "expired_at": 1654873897, "status": "check", "is_final": false, "created_at": "2025-05-02T13:52:28+03:00", "updated_at": "2025-05-02T14:54:15+03:00" } ], "paginate": { "count": 15, "hasPages": true, "nextCursor": "eyJpZCI6MTk3LCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9", "previousCursor": "eyJpZCI6MjExLCJfcG9pbnRzVG9OZXh0SXRlbXMiOmZhbHNlfQ", "perPage": 15 } } } ``` -------------------------------- ### Getting Payment Information (Request) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of calling the `getPaymentInfo` method to retrieve details for a specific payment. You must provide either the `uuid` or the `order_id` to identify the payment. ```javascript const checkPayment = await heleket.getPaymentInfo({ // To get the account status, you need to pass one of the required parameters, // if you pass both, the account will be identified using the order_id uuid: "1234567890", order_id: "0987654321" }); ``` -------------------------------- ### Successful Create Static Wallet Response - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of a successful response object containing details of the newly created static wallet, including its UUIDs, address, network, and currency. ```json { "state": 0, "result": { "wallet_uuid": "9f64a7ce-...", "uuid": "8241bd2f-...", "address": "TK8...", "network": "TRON", "currency": "USDT" } } ``` -------------------------------- ### Getting Payment History (Request) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of calling the `getPaymentHistory` method to retrieve a list of payments within a specified date range. The dates should be provided in 'YYYY-MM-DD HH:MM:SS' format. ```javascript const paymentList = await heleket.getPaymentHistory({ date_from: "2025-03-25 00:00:00", date_to: "2025-03-25 23:59:59" }); ``` -------------------------------- ### Creating a Payment Invoice (Request) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of calling the `createPayment` method to generate a new payment invoice. It requires specifying the payment amount, currency, and a unique order identifier. ```javascript const paymentForm = await heleket.createPayment({ amount: "10", currency: "USDT", order_id: heleket.generateUUID() }); ``` -------------------------------- ### Successful Refund Response - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of a successful response object returned after a refund request. ```json { "state": 0 } ``` -------------------------------- ### Creating a Payment Invoice (Response) Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example JSON response received after successfully creating a payment invoice using the `createPayment` method. It contains details about the generated invoice, including its UUID, URL, and status. ```json { "state": 0, "result": { "uuid": "f1386fb5-ecfa-41d4-a85d-b151d98df5e1", "order_id": "test-28", "amount": "10.00000000", "payment_amount": "11.95000000", "payer_amount": "10.00000000", "payer_currency": "USDT", "currency": "USDT", "comments": null, "network": "tron_trc20", "address": null, "from": null, "txid": null, "payment_status": "refund_process", "url": "https://pay.heleket.com/pay/f1386fb5-ecfa-41d4-a85d-b151d98df5e1", "expired_at": 1655196355, "status": "check", "is_final": false, "additional_data": null, "currencies": [ { "currency": "USDT", "network": "tron_trc20" }, { "currency": "USDT", "network": "eth_erc20" }] } } ``` -------------------------------- ### Successful Create Payout Response - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of a successful response object containing details of the created payout, including its UUID, amount, currency, network, address, status, and balance information. ```json { "state": 0, "result": { "uuid": "a7c0caec-a594-4aaa-b1c4-77d511857594", "amount": "3", "currency": "USDT", "network": "TRON", "address": "TJ...", "txid": null, "status": "process", "is_final": false, "balance": 129, "payer_currency": "USD", "payer_amount": 3 } } ``` -------------------------------- ### Sending Get Balance Request - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Retrieves the current balance for the merchant and user accounts using the Heleket SDK. ```javascript const balance = await heleket.getBalance(); ``` -------------------------------- ### Sending Get Payout History Request - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Retrieves a list of past payout transactions for the account. ```javascript const payoutList = await heleket.getPayoutHistory(); ``` -------------------------------- ### Successful Resend Webhook Response - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of a successful response object returned after a resend webhook request. ```json { "state": 0 } ``` -------------------------------- ### Refund Response with Error - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of an error response object returned after a refund request, including a state indicating failure and a descriptive message. ```json { "state": 1, "message": "Payment was not found" } ``` -------------------------------- ### Successful Block Static Wallet Response - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of a successful response object confirming the blocking of a static wallet, including its UUID and updated status. ```json { "state": 0, "result": { "uuid": "8241bd2f-...", "status": "blocked" } } ``` -------------------------------- ### Transfer Funds to Wallet - heleket SDK - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Initiates a transfer of funds to a specified wallet type ('personal' in this example) using the heleket API. Requires the amount and currency to transfer. The response includes transaction details and the updated wallet balance. ```javascript const transferToWallet = await heleket.transferToWallet("personal", { amount: "3", currency: "USDT" }); ``` ```json { "state": 0, "result": { "user_wallet_transaction_uuid": "a7c0caec-a594-4aaa-b1c4-77d511857594", "user_wallet_balance": "3", "merchant_transaction_uuid": "a7c0caec-a594-4aaa-b1c4-77d511857594", "amount": "3" } } ``` -------------------------------- ### Resend Webhook Response with Error - JSON Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Example of an error response object returned after a resend webhook request, indicating failure and providing a message. ```json { "state": 1, "message": "Payment was not found" } ``` -------------------------------- ### Sending Get Payout Info Request - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Retrieves detailed information about a specific payout. The payout is identified by either 'uuid' or 'order_id'. If both are provided, 'order_id' takes precedence. ```javascript const wallet = await heleket.getPayoutInfo({ // One of the mandatory parameters must be passed in order to receive the payout status, if you pass both, the payout will be identified by order_id uuid: "1234567890", order_id: "0987654321" }); ``` -------------------------------- ### Get Available Payout Services - heleket SDK - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Retrieves a list of available payout services from the heleket API. This method is asynchronous and returns a promise that resolves with the service data, including network, currency, availability, limits, and commission details. ```javascript const services = await heleket.getPayoutServices(); ``` ```json { "state": 0, "result": [ { "network": "TRON", "currency": "USDT", "is_available": true, "limit": { "min_amount": "1.00000000", "max_amount": "1000000.00000000" }, "commission": { "fee_amount": "0.00", "percent": "3.00" } }, { "network": "ETH", "currency": "ETH", "is_available": true, "limit": { "min_amount": "0.01000000", "max_amount": "10000.00000000" }, "commission": { "fee_amount": "0.00", "percent": "3.00" } }, { "network": "ETH", "currency": "USDT", "is_available": true, "limit": { "min_amount": "1.00000000", "max_amount": "1000000.00000000" }, "commission": { "fee_amount": "0.00", "percent": "3.00" } } ] } ``` -------------------------------- ### Initializing Heleket SDK Instance Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Demonstrates how to create a new instance of the Heleket SDK using your Merchant, Payment, and Payout API keys. These keys are required for authentication and accessing API features. ```javascript const MERCHANT_KEY = "123123"; const PAYMENT_KEY = "asdasd"; const PAYOUT_KEY = "qwerty"; const heleket = new Heleket(MERCHANT_KEY, PAYMENT_KEY, PAYOUT_KEY); ``` -------------------------------- ### Sending Create Static Wallet Request - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Creates a new static wallet for receiving payments. Requires specifying the network, currency, a unique order ID (short UUID recommended), and a callback URL. ```javascript const wallet = await heleket.createWallet({ network: "tron", currency: "USDT", order_id: heleket.generateShortUUID(), // Use only short UUID for a wallet methods url_callback: "https://your.site/callback" }); ``` -------------------------------- ### Sending Create Payout Request - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Initiates a payout request to a specified address. Requires amount, currency, network, a unique order ID (short UUID recommended), destination address, and whether commission is subtracted from the sender. ```javascript const wallet = await heleket.createPayout({ amount: "5", currency: "USDT", network: "TRON", order_id: heleket.generateShortUUID(), // Use only short UUID for a payout methods address: "TDD97yguPESTpcrJMqU6h2ozZbibv4Vaqm", is_subtract: true }); ``` -------------------------------- ### Generate Short UUID - heleket SDK - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Generates a shorter, URL-friendly UUID using the heleket SDK. This is recommended for use with wallet or payout methods. ```javascript const order_id = heleket.generateShortUUID(); // example: mhvXdrZT4jP5T8vBxuvm75 ``` -------------------------------- ### Sending Refund Request - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Initiates a refund request using the Heleket SDK. The invoice is identified by either 'order_id' or 'uuid'. The 'is_subtract' parameter determines who pays the commission. ```javascript const refund = await heleket.refund({ // Invoice is identified by order_id or uuid, if you pass both, the account will be identified by uuid uuid: "0987654321", order_id: "1234567890", address: "2139129askldkas", is_subtract: true // Determines whether the commission is to be charged to the merchant or to the client (true - to the merchant, false - to the client) }); ``` -------------------------------- ### Sending Block Static Wallet Request - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Blocks an existing static wallet. The wallet is identified by either 'uuid' or 'order_id'. If both are provided, 'order_id' takes precedence. ```javascript const wallet = await heleket.blockWallet({ // You need to pass one of the required parameters, if you pass both, the account will be identified by order_id uuid: "1234567890", order_id: "0987654321" }); ``` -------------------------------- ### Generate Standard UUID - heleket SDK - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Generates a standard UUID (Universally Unique Identifier) using the heleket SDK. This can be used for unique identifiers like order IDs. ```javascript const order_id = heleket.generateUUID(); // example: a7c0caec-a594-4aaa-b1c4-77d511857594 ``` -------------------------------- ### Sending Resend Webhook Request - JavaScript Source: https://github.com/bagwellv/heleket-api-sdk/blob/main/README.md Requests the resending of a webhook for a specific payment. The payment is identified by either 'uuid' or 'order_id'. If both are provided, 'order_id' takes precedence. ```javascript const resend = await heleket.resendWebhook({ // You need to pass one of the required parameters, if you pass both, the account will be identified by order_id uuid: "0987654321", order_id: "1234567890" }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.