PHP code example of paycryptoone / paycrypto-payouts-php-client
1. Go to this page and download the library: Download paycryptoone/paycrypto-payouts-php-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
paycryptoone / paycrypto-payouts-php-client example snippets
use PayCrypto\Payouts\Client\PayoutClient;
$client = new PayoutClient(
getenv('PAYCRYPTO_PAYOUT_API_KEY'),
getenv('PAYCRYPTO_PAYOUT_BASE_URL') ?: 'https://api.paycrypto.one/api/v1/'
);
$services = $client->services();
var_dump($services['data']);
$calcDirect = $client->calc([
'amount' => '10',
'address' => 'TNVq3iEcaGWbbsR34MTdg1JMTxvYFU8Qir',
'currency' => 'USDT',
'network' => 'TRON',
]);
var_dump($calcDirect['data']);
$calcWithPriority = $client->calc([
'amount' => '25',
'address' => '0x1111111111111111111111111111111111111111',
'currency' => 'USDT',
'network' => 'ETH',
'priority' => 'high',
]);
var_dump($calcWithPriority['data']);
$calcConvert = $client->calc([
'amount' => '100',
'address' => 'TNVq3iEcaGWbbsR34MTdg1JMTxvYFU8Qir',
'currency' => 'USD',
'to_currency' => 'USDT',
'network' => 'TRON',
]);
var_dump($calcConvert['data']);
$created = $client->createPayout([
'amount' => '0.01',
'address' => 'TNVq3iEcaGWbbsR34MTdg1JMTxvYFU8Qir',
'currency' => 'USDT',
'network' => 'TRON',
'order_id' => 'order_'.time(),
],
getenv('PAYCRYPTO_PAYOUT_MASTER_PASSWORD')
);
var_dump($created['data']);
$createdConvert = $client->createPayout([
'amount' => '150',
'address' => '0x1111111111111111111111111111111111111111',
'currency' => 'USD',
'to_currency' => 'USDT',
'network' => 'ETH',
'order_id' => 'order_convert_'.time(),
],
getenv('PAYCRYPTO_PAYOUT_MASTER_PASSWORD')
);
var_dump($createdConvert['data']);
$createdLegacy = $client->createPayout([
'amount' => '5',
'address' => 'TNVq3iEcaGWbbsR34MTdg1JMTxvYFU8Qir',
'currency' => 'USDT',
'network' => 'TRON',
'order_id' => 'order_body_mp_'.time(),
'masterPassword' => getenv('PAYCRYPTO_PAYOUT_MASTER_PASSWORD'),
]);
var_dump($createdLegacy['data']);
$info = $client->info('00000000-0000-4000-8000-000000000001');
var_dump($info['data']);
$historyAll = $client->list();
var_dump($historyAll['data']);
$historyWithDates = $client->list([
'date_from' => '2026-05-01 00:00:00',
'date_to' => '2026-05-08 23:59:59',
]);
var_dump($historyWithDates['data']);
$page1 = $client->list();
$nextCursor = $page1['data']['paginate']['nextCursor'] ?? null;
if ($nextCursor) {
$page2 = $client->list(['cursor' => $nextCursor]);
var_dump($page2['data']);
}
$resent = $client->resend('00000000-0000-4000-8000-000000000001');
var_dump($resent['data']);
use PayCrypto\Payouts\Client\PayoutApiException;
try {
$client->services();
} catch (PayoutApiException $e) {
var_dump($e->statusCode, $e->getMessage(), $e->responseBody);
}
use PayCrypto\Payouts\Client\Webhook;
$ok = Webhook::verify($decodedJsonArray, $webhookSecretFromSettings);
if (!$ok) {
throw new RuntimeException('Invalid payout webhook sign');
}
bash
git clone https://github.com/PayCryptoOne/paycrypto-payouts-php-client.git
cd paycrypto-payouts-php-client
composer install