Postback Security

You should verify the signature received in the postback to ensure that the call comes from our servers. Signature parameter should match MD5 of subId transactionId reward secret key. You can find your Secret Key of your website in My Apps. Here is a detailed page for getting your API and Secret Key.

Postback Examples:

<?php
$secret = "YOUR_SECRET_KEY"; // Get it from app placement

// Receive all data
$subId = $_REQUEST['subId'] ?? null;
$payout = $_REQUEST['payout'] ?? null;
$reward = $_REQUEST['reward'] ?? null;
$reward_name = $_REQUEST['reward_name'] ?? null;
$reward_value = $_REQUEST['reward_value'] ?? null;
$offer_name = $_REQUEST['offer_name'] ?? null;
$offer_type = $_REQUEST['offer_type'] ?? null;
$transId = $_REQUEST['transId'] ?? null;
$userIp = $_REQUEST['userIp'] ?? null;
$country = $_REQUEST['country'] ?? null;
$status = $_REQUEST['status'] ?? null;
$debug = $_REQUEST['debug'] ?? null;
$signature = $_REQUEST['signature'] ?? null;

// Validation Example
if (!$subId || !$transId || !$payout || !$reward) {
    $response = [
        'success' => false,
        'message' => 'Missing required parameters'
    ];
    echo json_encode($response);
    exit;
}

// Debug validation (only use in production)
if($debug == "true") {
    $response = [
        'success' => false,
        'message' => 'Test postbacks are not allowed'
    ];
    echo json_encode($response);
    exit;
}

// Validate Signature
   if(md5($subId . $transId . $reward . $secret) != $signature)
   {
       $response = [
        'success' => false,
        'message' => 'Signature validation failed'
    ];
    echo json_encode($response);
    exit;;
   }

// Process the data
// Your business logic goes here

We have not included IP address validation in the examples above for certain reasons. We advise verifying the whitelisted IP addresses; however, it is entirely up to you to use this feature as it is optional and not mandatory.

Don’t forget to check the transId against your database to ensure it doesn’t already exist.

Our servers wait for a response for a maximum time of 60 seconds before the timeout. In this case, postback will be marked as failed. Please, check if the transaction ID sent to you was already entered in your database, this will prevent to give twice the same amount of virtual currency to the user.

IPs to whitelist

We will be sending the postbacks from any of the following IP address(es). Please make sure they are whitelisted if needed to be in your server.

195.35.39.220

Respond to Postback

Our servers will expect your website to respond with "ok". If your postback doesn't return "ok" as response, postback will be marked as failed (even if postback was successfully called) and you will be able to resend it manually from Revtoo.

Last updated