signature parameter proves a postback came from us: only Offerzy and you know the secret key it’s made with.
How the signature is made
|.
1
Take the values exactly as received
Use
user_id, reward and offer_id as the strings in the request. Don’t convert reward to a number first: on a reversal it’s negative, for example -1500, and formatting it differently changes the hash.2
Join them with your secret key
For
user_id=user123, reward=1500, offer_id=offer_123 and the secret key sk_ofz_example, the string to hash is:3
Compare in constant time
Hash the string with MD5 and compare it with
signature using a constant-time comparison: crypto.timingSafeEqual in Node.js, hash_equals in PHP, hmac.compare_digest in Python. If they differ, answer 403 and don’t credit anything.Your secret key
Find it in the dashboard under Settings > Secret key. It starts withsk_ofz_, and one key signs the postbacks of all your placements.
- Keep it on your server only, in an environment variable or a secrets manager. Never put it in your website’s code or your app.
- If it leaks, click Regenerate key. The new key applies to all your placements at once and the old one stops working, so update your server right away. Postbacks your server rejects in the meantime are retried.
More good practice
- Use an
https://postback URL. - Credit users only from postbacks, never from anything the offerwall page or your app reports.
- Keep a record of every
transaction_id, so you can match reversals and answer support questions.