Magic Receipts Postbacks

This page describes how Magic Receipts postback works.

Intro

A user can upload an image of a receipt that contains purchases for multiple items, for example Chocolate and Apples. Use Magic Receipts postbacks to receive notifications on your server whenever the status of each offer item in the receipt changes.

There are four possible statuses:

  • AWARD_PENDING

  • APPROVED

  • REJECTED

  • MANUAL_REVIEW

Once an offer is APPROVED, it cannot transition to another status.

Setting Up a Postback

In order to receive postbacks for Magic Receipts events, you must set a URL that we should fire within the AdGate dashboard on the Postbacks page.

  1. Log in to the AdGate dashboard and open the Postbacks page.

  2. In the Offer-Specific Postbacks section, click Add Offer Postback and search for "397622", which is the "Shopper Marketing" offer ID.

  3. Enter the URL you would like us to send postbacks to and press Submit.

Example Postback URL: http://yoururl.com/postback/?conversion_id={conversion_id}&user_id={s1}&point_value={points}&usd_value={payout}&shm_upload_id={shm_upload_id}&shm_upload_offer_id={shm_upload_offer_id}&shm_status={shm_status}&shm_event_id={shm_event_id}

The postback URL will be fired as a POST request.

We will replace all of the macros, such as {conversion_id}, with the actual value (such as "4d63afe33875ceeec17dd7eab41b8590a".) On your server, you will read the "conversion_id" GET variable to retrieve this macro's value.

Understanding IDs

  • Each receipt that is uploaded corresponds to a single Upload ID

  • Each Upload can have multiple Offer IDs associated with it

  • Each offer on the receipt has its own Upload Offer ID, which is unique to an Upload and Offer.

  • Whenever a status changes for an offer, there is a corresponding Event ID

  • A single Offer or Upload Offer may have multiple approvals or other statuses. For example, if an offer is for purchasing Apples, then 3 purchased apples result in one offer with multiple approval (and other) events.

Available Macros

You may add any of the following macros to your postback URLs. They will be replaced with the corresponding values.

All values are URL encoded.

With this postback, you can receive the receipt image URLs that can be retrieved from the POST request body. The image URLs have a limited lifetime of 7 days. The request body you can expect is a JSON object of this format:

{
  "images": [
    "https://example.com/img/7f213800-9260-4d54-815d-d59fd4310564_1.png",
    "https://example.com/img/7f213800-9260-4d54-815d-d59fd4310564_2.png"
  ]
}

Expected Response

AdGate Media's servers expect an HTTP Status Code 200 from your postback URL. If this response is not received from your URL, we will attempt to resend the postback up to 5 times. There is a 5 minute delay between each attempt.

Security Recommendations

To prevent tampering, it is important that the postback URL that is used is unique to AdGate Media. For additional security, you may whitelist the following server IP: 52.42.57.125

Troubleshooting

To troubleshoot any postback issues, you may visit your Postback Reports page here: https://dash.adgatemedia.com/affiliate/reports/postbacks

This page will show a 30 day history of all postbacks on your account.

Last updated