Skip to main content

Rewards & Postback Setup

This guide covers two things: how to configure currency and reward display in your app, and how Prime Earn sends postback notifications to your server when users complete surveys, games, or offers.

Currency & Reward Setup

You can configure how rewards are displayed in your app separately for surveys, screenouts, and games/offers.

Move Decimal Point Examples

The reward amount is always rounded to a full number. Set a minimum value of 10 to avoid rounding issues.

Postback Setup — Surveys

When a user completes a survey action, Prime Earn sends a server-to-server postback to your configured callback URL.

Postback Parameters

All postback types are essential for accurate reward distribution, including type = 3. Ensure your system is configured to handle this type.

When is type = 3 used?

  • Manual reward distribution — when a user is not rewarded due to an error or technical issue, we send a manual postback (type=3) to ensure they receive their reward.
  • Challenge-based promotions — for users who complete promotional challenges. This is only available for the Surveys IFrame Integration.
  • Pre-qualification rewards — for users who successfully complete pre-qualification questions.

Postback Setup — Games & Offers

Postback Parameters

Make sure you only process each {tx_id} once.

When is type = 3 used?

type=3 is sent when a reward is issued outside the normal completion flow:
  • Bonus rewards — promotions or challenge-based incentives applied to an offer.
  • Customer support rewards — a support agent manually issues a reward to resolve a user dispute.
Credit the user immediately when you receive type=3. It is never reversed.

Transaction ID Prefixes — Games & Offers

Every postback status is encoded in the {tx_id} prefix. Use the prefix to identify the event type and to correlate related postbacks for the same underlying transaction.
PENDING and PENDING_RECONCILED are newer statuses introduced alongside Credit Delay 7. Make sure your postback handler accounts for all four.

Matching transactions across statuses

When you receive multiple postbacks for the same event, they share the same base hash — only the prefix differs. To link them together:
1

Strip the prefix

Remove r-, p-, or c- from the start of the tx_id.
2

Match on the base hash

Use the remaining value to look up the original transaction in your database.
Example — three postbacks, one transaction: All three refer to the same underlying transaction: 93879ba3-0b72...

Credit Delay 7 — Pending Rewards

Credit Delay 7 applies to games & offers only.
Some offers use a 7-day credit delay. Here is how the flow works:

Step 1 — Pending postback (immediate)

When the user completes a task, you immediately receive a PENDING postback:
Hold the reward. Do not credit the user yet.

Step 2 — Final postback (after 7 days)

After verification, you receive one of two outcomes:
User is verified as legitimate. Credit the reward now.

Reconciliation & Webhooks


User Status Webhooks

Prime Earn can notify your server whenever a user is banned for fraudulent activity. Once active, Prime Earn will send a server-to-server request to the URL configured in your app settings as webhook_url_user_status_change. This feature is disabled by default. Contact your account manager to enable it.
When you receive a ban notification, revoke any pending or unverified rewards and restrict the user’s access to Prime Earn features.

Verifying Postback Authenticity

Each postback Prime Earn sends to your server includes a hash query parameter. You should validate this hash before processing the postback to ensure the request has not been tampered with.

How the Hash Works

The hash is a SHA-1 digest of the full postback URL — including all query parameters except hash and shash — concatenated with a secret salt unique to your app:
Your appSecurityHashSalt is available in your publisher dashboard. Keep it secret — never expose it in client-side code or public repositories.
shash is deprecated and will be removed in a future release. Use only hash for validation.

Validation Example (PHP)

Implementation Notes

  • Always validate the hash first. Do not process the postback if validation fails.
  • Store the salt securely. Use environment variables or a secrets manager — never hardcode it in publicly accessible code.
  • Log failed validations. Logging urlWithoutHashes, the received hash, and the computed hash makes it straightforward to diagnose misconfigurations or detect tampering.
  • The logic handles optional query parameters correctly — only hash and shash are excluded from the computation.
If your integration is already live, do not reject postbacks immediately when a hash fails. Instead, log the relevant values (urlWithoutHashes, received hash, computed hash) and use those logs to debug without disrupting live traffic.

IP Whitelist

Ensure your server accepts postback requests from these Prime Earn IP addresses only. Reject all other sources to prevent reward fraud.