Configure app-specific postback URLs to receive conversion notifications.
App-level postbacks allow you to set a unique postback URL for each of your apps or websites. When a user completes an offer, we'll send a server-to-server notification to your specified URL with conversion details.
To set up app postback:
Your postback URL should accept GET requests with the following parameters as macros:
https://yourdomain.com/postback?user_id={user_id}&payout={payout}&status={status}&txn_id={transaction_id}
| Macro | Description | Example Value | |
|---|---|---|---|
{user_id} |
Your user ID that was passed to the offerwall | USER123 | |
{payout} |
Reward amount in USD | 0.50 | |
{status} |
Conversion status (1, 0) | approved : 1 | reversed : 0 |
{transaction_id} |
Unique transaction identifier | TXN_abc123def456 |
https://yourdomain.com/postback?user_id={user_id}&payout={payout}&status={status}&txn_id={transaction_id}
Your server should respond with:
1.2.3.4, 5.6.7.8
You can test your postback URL directly from your app's integration page using the "Test Postback" button. This sends a test conversion with sample data.
<?php
// postback.php
$user_id = $_GET['user_id'] ?? null;
$transaction_id = $_GET['txn_id'] ?? null;
$payout = $_GET['payout'] ?? 0;
$status = $_GET['status'] ?? null;
if ($user_id && $transaction_id) {
// status: 1 = approved, 0 = reversed
if ($status === '1') {
// Credit user account
creditUserBalance($user_id, $payout);
// Log transaction
logTransaction($user_id, $transaction_id, $payout, $status);
http_response_code(200);
echo "OK";
} else {
http_response_code(200);
echo "Ignored";
}
} else {
http_response_code(400);
echo "Missing parameters";
}
?>
app.get('/postback', (req, res) => {
const { user_id, txn_id, payout, status } = req.query;
if (user_id && txn_id) {
// status: 1 = approved, 0 = reversed
if (status === '1') {
// Credit user account
creditUserBalance(user_id, payout);
// Log transaction
logTransaction(user_id, txn_id, payout, status);
return res.status(200).send('OK');
}
return res.status(200).send('Ignored');
}
return res.status(400).send('Missing parameters');
});
// pages/api/postback.js
export default function handler(req, res) {
const { user_id, txn_id, payout, status } = req.query;
if (!user_id || !txn_id) {
return res.status(400).send('Missing parameters');
}
// status: 1 = approved, 0 = reversed
if (status === '1') {
// Credit user account
creditUserBalance(user_id, payout);
// Log transaction
logTransaction(user_id, txn_id, payout, status);
return res.status(200).send('OK');
}
return res.status(200).send('Ignored');
}
from flask import Flask, request
app = Flask(__name__)
@app.route('/postback', methods=['GET'])
def postback():
user_id = request.args.get('user_id')
transaction_id = request.args.get('txn_id')
payout = request.args.get('payout', 0)
status = request.args.get('status')
if user_id and transaction_id:
# status: 1 = approved, 0 = reversed
if status == '1':
# Credit user account
credit_user_balance(user_id, payout)
# Log transaction
log_transaction(user_id, transaction_id, payout, status)
return 'OK', 200
return 'Ignored', 200
return 'Missing parameters', 400