Reward your users
Each time a user finishes an offer, we call your postback URL from our server. Your server then adds the reward to that user.
Set it up
- Make a page on your server that receives the call
A PHP example is at the end of this page.
- Build your postback URL
Use the builder below: your page's address plus the values you want from us.
- Add it to your app
In your dashboard open Apps → your app → Edit, paste it into Postback URL and save.
- Send a test
Open Test postback in the dashboard. It sends a test conversion and shows what your server answered. Tests never count as earnings.
Build your postback URL
Type your page's address, then tap the values you want. We swap each {macro} for the real value before calling you.
Add a secret of your own at the end, like &key=YOUR_OWN_SECRET, and turn away calls without it. Anyone who finds your postback page could call it otherwise.
All macros
| Macro | Value | Example |
|---|---|---|
{user_id} | Your user's ID from the wall link or API request | 48213 |
{transaction_id} | Unique ID of this conversion. Use it so you never credit twice. | TXN_65a8f1c2 |
{reward} | What to give your user, in your app currency. {amount} is the same. | 1250 |
{payout} | What you earn, in USD | 1.25 |
{currency} | Your app currency's short code | POI |
{status} | approved, pending or rejected. Rejected means a reversal: take the reward back. | approved |
{offer_id} | The offer's ID, 0 for tests. {campaign_id} is the same. | 12345 |
{offer_name} | The offer's name, URL-encoded. {campaign_name} is the same. | Raid%3A+Shadow+Legends |
{ip} | The user's IP address | 203.0.113.25 |
{country} | The user's country code | US |
{device} | The user's device | android |
{aff_sub} … {aff_sub4} | Your sub IDs from the wall link or API request, empty when not sent | homepage |
How your page should answer
- Answer with HTTP 200 (any 2xx) within 10 seconds. The body can be anything, such as
OK. - Anything else (4xx, 5xx, no answer in time) marks the postback as failed. Failed postbacks aren't retried on their own: fix your page and send a test, or ask support to resend real ones.
- If the same
{transaction_id}arrives again with the same status, answer 200 and don't credit again.
Example page in PHP
For the URL https://your-site.com/postback.php?uid={user_id}&amount={reward}&txn={transaction_id}&status={status}&key=YOUR_OWN_SECRET:
<?php
if (!hash_equals('YOUR_OWN_SECRET', $_GET['key'] ?? '')) {
http_response_code(403);
exit('Forbidden');
}
$userId = $_GET['uid'] ?? '';
$amount = (float) ($_GET['amount'] ?? 0);
$txn = $_GET['txn'] ?? '';
$status = $_GET['status'] ?? 'approved';
if ($userId === '' || $txn === '') {
http_response_code(400);
exit('Missing parameters');
}
// already handled this transaction with this status? answer OK, credit nothing
if (alreadyProcessed($txn, $status)) {
exit('OK');
}
if ($status === 'approved') {
creditUser($userId, $amount);
} elseif ($status === 'rejected') {
debitUser($userId, $amount); // a reversal
}
saveTransaction($txn, $status, $userId, $amount);
echo 'OK';alreadyProcessed, creditUser, debitUser and saveTransaction are your own functions that read and write your database.
EliteWall