Informational Commands

Get Basic Account Info

JavaScript

const apiKey = "api_key_here"; // Replace with your actual API key

// Create a data object with the API key
2 const data = {
    apiKey: apiKey
};

// Define the URL
3 const url = "https://api.revelont.net/get_account_info";

// Define the POST request options
4 const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

// Send the POST request and parse the response JSON 
5 fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        console.log("Response JSON:", data);
        // Handle the response data here 
    })
    .catch(error => {
        console.error("Error:", error);
    });

            

PHP


// Your API key
$apiKey = "api_key_here";

// API endpoint
$apiEndpoint = "https://api.revelont.net/get_account_info";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

    // Parse the JSON response 
    $responseData = json_decode($response, true);

    // Check if the JSON decoding was successful
    if ($responseData) {
        // Access the parsed data
        var_dump($responseData);
    } else {
        echo 'Failed to parse JSON response.';
    }
}


            

Get Live Currencies

JavaScript

                
                
 const apiKey = "api_key_here"; // Replace with your actual API key

// Create a data object with the API key
const data = {
    apiKey: apiKey
};

// Define the URL
const url = "https://api.revelon.net/get_livecurrencies";

// Define the POST request options
const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

// Send the POST request and display the JSON response
fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        console.log("Response JSON:", data);
        // Handle the response data here
    })
    .catch(error => {
        console.error("Error:", error);
    });

                
            

PHP


// Your API key
$apiKey = "api_key_here";

// API endpoint
$apiEndpoint = "https://api.revelon.net/get_livecurrencies";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

   // Display the JSON response
    header('Content-Type: application/json');
    echo $response;
}


                
            

Recieving Payments

Creating Invoice

JavaScript

      // Define Data 
const data = {
    apiKey: "Your_Api_Key",
    redirectUrl: "https://your_site.com/success",
    closeUrl: "https://your_site.com/failed",
    businessName: "Your Business Wallet",
    productName: "Product Name",
    currency: "USD",
    price: "10",
    notificationURL: "https://your_site.com/webhook",
    buyersEmail: "johndoe@example.com"
};

   // Define the URL
const url = "https://api.revelon.net/create_invoice";

   // Define the POST request options
const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

   // Send the POST request and handle the response
fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        if (data.status === "success") {
            console.log("Invoice ID:", data.result.invoice_id);
        } else {
            console.error("Invoice creation failed");
        }
    })
    .catch(error => {
        console.error("Error:", error);
    });


            

PHP

// Your API key
$apiKey = "Your_Api_Key";

// API endpoint
$apiEndpoint = "https://api.revelon.net/create_invoice";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey,
    'redirectUrl' => "https://your_site.com/success",
    'closeUrl' => "https://your_site.com/failed",
    'businessName' => "Your Business Wallet",
    'productName' => "Product Name",
    'currency' => "USD",
    'price' => "10",
    'notificationURL' => "https://your_site.com/webhook",
    'buyersEmail' => "johndoe@example.com",
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

    // Parse the JSON response
    $responseData = json_decode($response, true);

    // Check if the JSON decoding was successful
    if ($responseData && $responseData['status'] === 'success') {
        echo 'invoice_id: ' . $responseData['result']['invoice_id'];
    } else {
        echo 'Failed to create the invoice or the response status is not "success".';
    }
}


                
            

Get Deposit Address

JavaScript

                
                const apiKey = "Your_Api_Key"; // Replace with your actual API key
const coin = "BTC"; // Replace with the desired coin

const data = {
    apiKey: apiKey,
    coin: coin
};

// Define the URL
const url = "https://api.revelon.net/get_deposit_address";

// Define the POST request options
const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

// Send the POST request and handle the response
fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        if (data.status === "success") {
            const address = data.result.address;
            const payment_auth = data.result.payment_auth;
            console.log("Address:", address);
            console.log("Payment Auth:", payment_auth);
        } else {
            console.error("Error:", data.error);
        }
    })
    .catch(error => {
        console.error("Error:", error);
    });

                
                
            

PHP

     
// Your API key
$apiKey = "Your_Api_Key";

// API endpoint
$apiEndpoint = "https://api.revelon.net/get_deposit_address";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey,
    'coin' => 'BTC', // Replace 'BTC' with the desired cryptocurrency
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

    // Parse the JSON response
    $responseData = json_decode($response, true);

    // Check if the JSON decoding was successful and the response status is "success"
    if ($responseData && $responseData['status'] === 'success') {
        $address = $responseData['result']['address'];
        $payment_auth = $responseData['result']['payment_auth'];
        echo 'Address: ' . $address . '
'; echo 'Payment Auth: ' . $payment_auth; } else { echo 'Error: ' . $responseData['error']; } }

Check Deposit

JavaScript

 
            
const apiKey = "Your_Api_Key"; // Replace with your actual API key
const payment_auth = "Your_Auth_Code"; // Replace with your actual auth code

const data = {
    apiKey: apiKey,
    payemnt_auth: payment_auth
};

// Define the URL
const url = "https://api.revelon.net/check_deposit";

// Define the POST request options
const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

// Send the POST request and handle the response
fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        console.log("Response JSON:", data);
        // Handle the response data here
    })
    .catch(error => {
        console.error("Error:", error);
    });

            
            
            

PHP


// Your API key
$apiKey = "Your_Api_Key";

// Auth value
$auth = "Your_Auth_Value";

// API endpoint
$apiEndpoint = "https://api.revelon.net/check_deposit";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey,
    'auth' => $auth,
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

    // Display the JSON response
    echo $response;
}


                
            

Get Payment Info

JavaScript

                
const apiKey = "Your_Api_Key"; // Replace with your actual API key
const invoiceId = "Your_Invoice_Id"; // Replace with your actual invoice ID

const data = {
    apiKey: apiKey,
    invoice_id: invoiceId
};

// Define the URL
const url = "https://api.revelon.net/get_paymemt_info";

// Define the POST request options
const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

// Send the POST request and handle the response
fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        console.log("Response JSON:", data);
        // Handle the response data here
    })
    .catch(error => {
        console.error("Error:", error);
    });

                
                
            

PHP

                
// Your API key
$apiKey = "Your_Api_Key";

// Invoice ID
$invoice_id = "Your_Invoice_ID";

// API endpoint
$apiEndpoint = "https://api.revelon.net/get_paymemt_info";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey,
    'invoice_id' => $invoice_id,
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

    // Display the JSON response
    header('Content-Type: application/json');
    echo $response;
}

                
            

Wallet Commands

Get Coin Balance

JavaScript

                
const apiKey = "Your_Api_Key"; // Replace with your actual API key
const coin = "BTC"; // Replace with the desired coin

const data = {
    apiKey: apiKey,
    coin: coin
};

// Define the URL
const url = "https://api.revelon.net/balance";

Define the POST request options
const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

// Send the POST request and handle the response
fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        if (data.status === "success") {
            const balance = data.result.balance;
            console.log("Balance:", balance);
        } else {
            console.error("Error:", data.error);
        }
    })
    .catch(error => {
        console.error("Error:", error);
    });

                
            

PHP

            

// Your API key
$apiKey = "Your_Api_Key";

// Coin value
$coin = "Your_Coin_Value";

// API endpoint
$apiEndpoint = "https://api.revelon.net/balance";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey,
    'coin' => $coin,
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

    // Parse the JSON response
    $responseData = json_decode($response, true);

    // Check if the JSON decoding was successful
    if ($responseData && $responseData['status'] === 'success') {
        $balance = $responseData['result']['balance'];
        echo 'Balance: ' . $balance;
    } else {
        echo 'Error: ' . $responseData['error'];
    }
}


                
            

Create Withdrawal

JavaScript

                
const apiKey = "Your_Api_Key"; // Replace with your actual API key
const coin = "BTC"; // Replace with the desired coin (case sensitive)
const amount = "100"; // Replace with the withdrawal amount
const to = "wallet_address"; // Replace with the destination wallet address (case sensitive)

const data = {
    apiKey: apiKey,
    coin: coin,
    amount: amount,
    to: to
};

// Define the URL
const url = "https://api.revelon.net/create_withdrawal";

// Define the POST request options
const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

// Send the POST request and handle the response
fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        if (data.status === "success") {
            const txHash = data.result.txHash;
            console.log("TxHash:", txHash);
        } else {
            console.error("Error:", data.error);
        }
    })
    .catch(error => {
        console.error("Error:", error);
    });

                
                
            

PHP

            

// Your API key
$apiKey = "Your_Api_Key";

// API endpoint
$apiEndpoint = "https://api.revelon.net/create_withdrawal";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey,
    'coin' => "BTC", // Replace with the cryptocurrency (case sensitive)
    'amount' => "100",
    'to' => "wallet_address", // Replace with the wallet address (case sensitive)
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

    // Parse the JSON response
    $responseData = json_decode($response, true);

    // Check if the JSON decoding was successful
    if ($responseData && $responseData['status'] === 'success') {
        $txHash = $responseData['result']['txHash'];
        echo 'txHash: ' . $txHash;
    } else {
        echo 'Error: ' . $responseData['error'];
    }
}


                
            

Create Transfer

JavaScript


const apiKey = "Your_Api_Key"; // Replace with your actual API key
const coin = "BTC"; // Replace with the desired coin
const identifier = "email or username"; // Replace with the identifier (case sensitive)
const amount = "100"; // Replace with the transfer amount
const to = "username or email"; // Replace with the recipient (case sensitive)

const data = {
    apiKey: apiKey,
    coin: coin,
    identifier: identifier,
    amount: amount,
    to: to
};

// Define the URL
const url = "https://api.revelon.net/create_transfer";

// Define the POST request options
const options = {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(data)
};

// Send the POST request and handle the response
fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => {
        if (data.status === "success") {
            const txHash = data.result.txHash;
            console.log("TxHash:", txHash);
        } else {
            console.error("Error:", data.error);
        }
    })
    .catch(error => {
        console.error("Error:", error);
    });
                
                
            

PHP


// Your API key
$apiKey = "Your_Api_Key";

// API endpoint
$apiEndpoint = "https://api.revelon.net/create_transfer";

// Data to be sent in the POST request
$data = array(
    'apiKey' => $apiKey,
    'coin' => "BTC",
    'identifier' => "email or username", // Replace with the identifier (case sensitive)
    'amount' => "100",
    'to' => "username or email", // Replace with the recipient (case sensitive)
);

// Initialize cURL session
$ch = curl_init($apiEndpoint);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Close the cURL session
    curl_close($ch);

    // Parse the JSON response
    $responseData = json_decode($response, true);

    // Check if the JSON decoding was successful
    if ($responseData && $responseData['status'] === 'success') {
        $txHash = $responseData['result']['txHash'];
        echo 'txHash: ' . $txHash;
    } else {
        echo 'Error: ' . $responseData['error'];
    }
}

                
            

Webhook Code Sample

Webhook Notification

Node Js


const express = require('express');
const app = express();
const port = 3000; // Change this to your desired port

app.use(express.json());

app.post('/processPayment', (req, res) => {
    const { invoice_id, pay_amount, payCoin, price, buyersEmail, productName, currency } = req.body;

    // You can process the data as needed here

    // Send a 200 status code response
    res.status(200).json({
        message: 'Payment data received successfully',
        invoice_id,
        pay_amount,
        payCoin,
        price,
        buyersEmail,
    });
});

app.listen(port, () => {
    console.log(`Server is running on port ${port}`);
});

            

PHP

// Receive the POST data
$invoice_id = $_POST['invoice_id'];
$pay_amount = $_POST['pay_amount'];
$payCoin = $_POST['pay_coin'];
$currency = $_POST['currency'];
$productName = $_POST['productName'];
$price = $_POST['price'];
$buyersEmail = $_POST['buyersEmail'];

// You can process the data as needed here

// Send a 200 status code response
http_response_code(200);
echo json_encode(array(
    'message' => 'Payment data received successfully',
    'invoice_id' => $invoice_id,
    'pay_amount' => $pay_amount,
    'pay_coin' => $payCoin,
    'price' => $price,
    'buyersEmail' => buyersEmail
));