Баланс
Метод POST
https://fast-pay.top/api/balance
Заголовки
Accept | application/json |
Content-Type | application/json |
Запрос параметры
api_id | int | API ID |
api_key | string | API ключ |
ПРИМЕР НА PHP
include('FastPayApi.php');
$apiId = 583;
$apiKey = 'nSqjryEhvZMy8DlgCaYdVPoHyRJxgxWN';
$fastPayApi = new FastPayApi();
$fastPayApi->setApiId($apiId);
$fastPayApi->setApiKey($apiKey);
$response = $fastPayApi->getUserBalance();
$data = json_decode ($response, true);
if ($data['status'] === 'success') {
$balance_trx = $data['data']['balance_trx']; // Баланс TRX
$balance_usdt = $data['data']['balance_usdt']; // Баланс USDT
$balance_usdc = $data['data']['balance_usdc']; // Баланс USDC
}
$apiId = 583;
$apiKey = 'nSqjryEhvZMy8DlgCaYdVPoHyRJxgxWN';
$fastPayApi = new FastPayApi();
$fastPayApi->setApiId($apiId);
$fastPayApi->setApiKey($apiKey);
$response = $fastPayApi->getUserBalance();
$data = json_decode ($response, true);
if ($data['status'] === 'success') {
$balance_trx = $data['data']['balance_trx']; // Баланс TRX
$balance_usdt = $data['data']['balance_usdt']; // Баланс USDT
$balance_usdc = $data['data']['balance_usdc']; // Баланс USDC
}
УСПЕШНЫЙ ОТВЕТ JSON:
{
"status": "success",
"data": {
"balance_trx": "7482.478212",
"balance_usdt": "1475.124721",
"balance_usdc": "9214.872164"
}
}
ОТВЕТ С ОШИБКОЙ JSON:
{
"status": "error",
"errors": {
"error": "User Not found!"
}
}