PayWallet API

PayWallet API is the best solution for accepting payments in cryptocurrency. We are constantly trying to improve our service. If you are have not find some method that you need - write to us and we will add it.

  • Simple connection
  • Integration with any scripts
  • Detailed documentation

*Add this IP address to your server settings whitelist: 193.70.3.41, 2001:41d0:401:3200::4052

Documentation

Learn detailed PayWallet API

Read a documentation
Composer package

Install Composer PHP package with all available API methods

View on GitHub
PHP Class

PHP class with main methods for the cooperation with PayWallet

Download a class

Examples of connection

Get an address for payments in cryptocurrency

                    
<?php 
/*
* Documentation URL: https://paywallet.pro/api/docs/create-deposit-address
*/

require_once('PayWallet.php');

$payWallet = new PayWallet(
    '18Qqk2pFcB29MU7S8iVUUyNykvacgezH', //Api public key
    'rV5dzFiiaPCKmEisX9uGyO5ueu4VDr3D', //Api private key
);

$merchantKey = 'SdISfti6xpbSCmh0u2YnyTGIHo3wBbtC';  //Merchant public key
$orderId = 'order_12';  //Unique order ID in your system
$currency = strtolower('BTC');  //Currency ID in PayWallet. Available values: btc, ltc, doge, zec, xrp, usdt_trc20, usdc_trc20, dash, bch, trx, xlm
$amount = 0.05;
$comment = 'Test comment';

$response = $payWallet->create_deposit_address($merchantKey, $orderId, $currency, $amount, $comment);

if($response['error']){
    echo $response['message'];
}else{
    $transactionId = $response['data']['deposit_id'];   //Unique deposit ID in PayWallet system
    $orderId = $response['data']['order_id'];   //Unique order ID in your system
    $wallet = $response['data']['wallet'];   //Payment address
    $amount = $response['data']['amount'];   //Deposit amount
    $currency = $response['data']['currency'];   //Deposit currency
    $tag = $response['data']['tag'];   //Tag (Memo ID) only for XLM and XRP currencies.
    $url = $response['data']['url'];   //Payment page link

    echo 'Send '.$amount.' '.strtoupper($currency).' to this address '.$wallet.'.';
}
                    
                

Invoicing for payment

                    
<?php 
/*
* Documentation URL: https://paywallet.pro/api/docs/create-deposit-address
*/

require_once('PayWallet.php');

$payWallet = new PayWallet(
    '18Qqk2pFcB29MU7S8iVUUyNykvacgezH', //Api public key
    'rV5dzFiiaPCKmEisX9uGyO5ueu4VDr3D', //Api private key
);

$merchantKey = 'SdISfti6xpbSCmh0u2YnyTGIHo3wBbtC';  //Merchant public key
$orderId = 'order_12';  //Unique order ID in your system
$currency = strtolower('BTC');  //Currency ID in PayWallet. Available values: btc, ltc, doge, zec, xrp, usdt_trc20, usdc_trc20, dash, bch, trx, xlm
$amount = 0.05;
$comment = 'Test comment';

$response = $payWallet->create_deposit_address($merchantKey, $orderId, $currency, $amount, $comment);

if($response['error']){
    echo $response['message'];
}else{
    ?>
    <form action="<?php echo $response["data"]["url"]; ?>" method="GET">
        <button type="submit">Pay</button>
    </form>
    <?php
}
                    
                

Processing notifications for incoming transactions

                    
<?php 
/*
* Documentation URL: https://paywallet.pro/api/docs/merchant-ipn
*/

$merchantPrivateKey = 'zmdpYNTqLjYRozbY4VeWN22YjEEvHZusd';
if(!isset($_POST['token']) || !password_verify($merchantPrivateKey, $_POST['token'])) return; 

$order_id = $_POST['order_id']; //Unique order ID in your system.
$transaction_id = $_POST['transaction_id']; //Unique deposit ID in the PayWallet system.
$expected_amount = $_POST['expected_amount']; //Expected deposit amount.
$receive_amount = $_POST['receive_amount']; //The amount transferred by the client and received by the merchant.
$wallet = $_POST['address']; //The address to which the transfer was made.
$txid = $_POST['txid']; //Blockchain transaction ID.
$currency = $_POST['currency']; //Currency symbol. For example usdt
$system = $_POST['system']; //Unique currency ID in the PayWallet system. For example usdt_trc20.
$any_amount = $_POST['any_amount']; //Indicates whether the merchant can accept any payment amount.
$test = $_POST['test']; //Indicates whether test mode is enabled.

//Your code...

echo 'success|'.$order_id;
                    
                

Instant payments

                    
<?php 
/*
* Documentation URL: https://paywallet.pro/api/docs/instant-payment
*/

require_once('PayWallet.php');

$payWallet = new PayWallet(
    '18Qqk2pFcB29MU7S8iVUUyNykvacgezH', //Api public key
    'rV5dzFiiaPCKmEisX9uGyO5ueu4VDr3D', //Api private key
);

$merchantKey = 'SdISfti6xpbSCmh0u2YnyTGIHo3wBbtC';  //Merchant public key
$currency = strtolower('DOGE');  //Currency ID in PayWallet. Available values: btc, ltc, doge, zec, xrp, usdt_trc20, usdc_trc20, dash, bch, trx, xlm
$amount = 3;
$wallet = 'DFh4kuHcSFEJ7yChn6XVQiMSHqi28x2CMk'; //Cryptocurrency address
$comment = 'Test comment';
$tag = null; //Required if currency=xlm or currency=xrp

$response = $payWallet->instant_payment($merchantKey, $currency, $amount, $wallet, $comment, $tag);

if($response['error']){
    echo $response['message'];
}else{
    $payment_id = $response['data']['payment_id']; //Withdraw ID in PayWallet
    $wallet = $response['data']['wallet']; //Withdraw address
    $tag = $response['data']['tag']; //Withdraw tag. Required if currency=xlm or currency=xrp
    $amount = $response['data']['amount']; //Withdraw amount
    $commission = $response['data']['commission']; //Withdraw commission.
    $currency = $response['data']['currency']; //Currency.
    $txid = $response['data']['txid']; //Transaction ID.

    echo 'Payment successful. Transaction ID: '.$txid;
}