MoonetixMoonetixDocs Support Log in

Quick start

Four steps from a live app to rewarded users. Copy the code, change the names, and test.

Using a coding agent? Copy a ready-made prompt for your app from your dashboard. See AI agent setup.

Before you start

Your publisher account must be approved; every app you add is live right away. Open your dashboard, Apps, your app, Integration. You need the values below from there:

ValueWhere you use it
App IDIn the offerwall link and in the mobile SDKs.
Link hash saltOn your server, to sign the offerwall link.
Postback secret keyOn your server, to check that postbacks come from us.
API keyOn your server, for the Offers API, the Reporting API, and mobile SDK sessions.

Set your currency on the Currency tab of your app too. It decides what your users get for every offer. See Rewards and currency.

Keep the salt, the secret key, and the API key on your server. Never put them in JavaScript or in an app.

Choose how to integrate

Every app can use all three ways at once. Rewards reach your server the same way with each of them, through your postback.

IntegrationBest forDocs
Offerwall linkWebsites, and the quickest way to go live: open the link, embed it, show it in a pop-up, or add a floating button.Offerwall link
Offers APIShowing offers in your own design, for example next to offers from other networks.Offers API
Mobile SDKsApps and games: the offerwall opens as a native screen, and no key ships in your app.Android, iOS, Flutter, React Native, Unity

The steps below use the offerwall link. For the Offers API or a mobile SDK, follow its page for step 1, then continue with step 2 here.

1. Show the offerwall

Build the link on your server for the signed-in user, then open it, embed it on a page, or open it in a pop-up.

$userId = (string)$currentUser->id;
$hash   = hash_hmac('sha256', $userId, $linkHashSalt);
$link   = 'https://wall.moonetix.com/' . $appId . '?user_id=' . rawurlencode($userId) . '&hash=' . $hash;
<iframe src="LINK" style="border:0;width:100%;height:100vh" title="Offerwall"></iframe>

You can also add a floating button that opens the offerwall in a pop-up.

Every embed option, and the same code in Node.js and Python: Offerwall link.

The offerwall is one of three ways to integrate. Want offers in your own design? Use the Offers API. Building a mobile app or game? The mobile SDKs show the offerwall as a native screen: Android, iOS, Flutter, React Native, and Unity. Rewards reach your server the same way with all three.

2. Add your postback URL

In the Postback tab, enter the URL of a script on your server, with the macros you want:

https://yoursite.com/moonetix-postback.php?user={user_id}&tx={transaction_id}&status={status}&reward={reward}&hash={hash}

3. Handle the postback

Check the hash, then act on the status. Every transaction keeps the same ID from start to end, so store the last status you handled.

$tx     = $_GET['tx'] ?? '';
$userId = $_GET['user'] ?? '';
$reward = $_GET['reward'] ?? '0';
$status = (int)($_GET['status'] ?? 0);

$expected = hash_hmac('sha256', "$tx:$userId:$reward:$status", $postbackSecretKey);
if (!hash_equals($expected, $_GET['hash'] ?? '')) {
    http_response_code(403);
    exit;
}

$last = get_last_status($tx);
if ($status === 1 && $last !== 1 && $last !== 2) {
    add_to_balance($userId, $reward);
    save_status($tx, 1);
} elseif ($status === 2 && $last === 1) {
    subtract_from_balance($userId, $reward);
    save_status($tx, 2);
}
http_response_code(200);
StatusMeaningYour server
1CreditedAdd the reward.
2ReversedTake the reward back.

4. Test it

  1. Click Open as a test user in Integration status on the Integration tab to see your offerwall.
  2. Click Send a test postback there. By default it sends status 1 for test_user.
  3. Open Reports, Postbacks in your dashboard and check that your server answered 200.
  4. Check that test_user got the reward in your system, then remove it.

Test from a normal home or mobile connection. On a VPN, a proxy, or a cloud server, the offerwall shows a block page, such as VPN detected, instead of offers. See Test from a normal connection. If something does not work, see Testing and troubleshooting.