⚙️Postback
Experience a seamless journey towards setting up your own Postback as we walk you through each step, providing comprehensive guidance along the way.
Postback Parameter
Parameter
DESCRIPTION
EXAMPLE
{user_id}
This is the unique identifier code of the user who completed action on your platform.
varchar (25)
{offer_name}
The Name of the offer completed.
varchar (255)
{amount}
The amount of your virtual currency to be credited to your user.
99999
{payout}
Amount in USD that you earned for this conversion.
100.5
{user_ip}
IP address of the user that completed the offer.
1.1.1.1
{txid}
Unique ID of the conversion generated by ClickWall.
sdf8sd7fs
{offer_id}
Display number in our system
varchar (50)
Example Postback URL
https://example.com/postback/clickwall.php?user_id={user_id}&payout={payout}&amount={amount}&offer_name={offer_name}&user_ip={user_ip}&txid={txid}
We expect a response with a status code of Ok or 1 to indicate that the retransmission was received successfully.
PHP Example
<?php
/*!
* ClickWall LLC
* http://clickwall.net
* [email protected]
* Demo: https://example.com/postback/clickwall.php?user_id={user_id}&amount={amount}&offer_name={offer_name}&user_ip={user_ip}
*/
// Include the initialization file
include_once("../admin/core/init.inc.php");
// Get data from the request
$user_id = $_REQUEST['user_id'];
$amount = $_REQUEST['amount'];
$offerName = $_REQUEST['offer_name'];
$user_ip = $_REQUEST['user_ip'];
// Get the current timestamp
$timeCurrent = time();
// Initialize the functions object
$configs = new functions($dbo);
// Define the event type
$type = "ClickWall: Offername: $offerName . IP: $user_ip";
// Create an account object and retrieve user data
$account = new account($dbo, 1);
$userdata = $account->getuserdata($user_id);
// Calculate the new user balance
$newBalance = $userdata['points'] + $amount;
// Update user Points
$sql = "UPDATE users SET points = '$newBalance' WHERE login = '$user_id'";
$stmt = $dbo->prepare($sql);
$stmt->execute();
// Update user Tracker
$sql = "INSERT INTO tracker(username, points, type, date) values ('$user_id', '$amount', '$type', '$timeCurrent')";
$stmt = $dbo->prepare($sql);
$stmt->execute();
if ($stmt) {
echo "OK";
}
?>
Last updated
Was this helpful?