Receiving Callbacks
You'll need some server-side code to handle the callbacks sent by our system when a payment is detected.
As mentioned before, each time a payment is received and forwarded to your Bitcoin address, your callback URL will be sent data about the payment. This is necessary for automated systems to know when a specific payment is sent. Our server will forward the payments and send these callbacks to your server immediately after payments are received and confirmed 1 times. After this, every time the confirmations value changes, we will send another callback, up to 20 confirmations or 20 bad callback requests.
Callbacks will always be sent as POST requests containing the details of the payment and the forwarded transaction, in addition to any parameters already present in the callback URL. Once again, please recall that callback URLs have a maximum length of 1024 characters.
Remember that for security, you should make sure that you include a unique, secret parameter in your callback URL. This secret string will be passed back to the callback script when the callback is sent, along with any other parameters already present in the callback URL. It should be checked against the original secret string to ensure that the callback is coming from us and is not forged.
Receive callback data
Do not POST this to us. This is the information we POST to your callback URL.

Example code

The following code will check that 3 confirmations have passed.
// Payment Settings
$my_address = "1LisLsZd3bx8U1NYzpNHqpo8Q6UCXKMJ4z";
$desiredConfirmations = 3;
// If you're using a secret, put it in here
$secret = "7j0ap91o99cxj8k9";
// Start of checks
if(!isset($_GET['secret'])) {
die('No secret found.');
if ($_GET["secret"] !== $secret) die();
// Make sure we have all the POST variables we want to get
if(!isset($_POST['input_address']) || !isset($_POST['input_transaction_hash']) || !isset($_POST['transaction_hash']) || !isset($_POST['value']) || !isset($_POST['confirmations']) || !isset($_POST['destination_address'])) {
die('One of more of the POST variables was not set in the request to our callback url.');
if ($_POST["destination_address"] !== $my_address) die();
// Now we can show them the 200 status code as they've passed our checks
$input_address = $_POST["input_address"];
$input_transaction_hash = $_POST["input_transaction_hash"];
$transaction_hash = $_POST["transaction_hash"];
$value_in_btc = $_POST["value"];
$confirmations = $_POST["confirmations"];
// Confirmation check to make sure the confirmations is above our desired amount
if($confirmations >= $desiredConfirmations) {
// We should store the payment as soon as we receive it inside this callback file
// We can later update details such as confirms if needed
// {{ Do your magic here }}
} else {
// Transaction has not reached our desired number of confirmations.
// Keep waiting for confirmations to be larger
Copy link
On this page
Receive callback data
Example code