# Magic Receipts Standalone

## What is Magic Receipts?

Magic Receipts is a product that allows your user to scan receipts of their recent purchases in exchange for rewards.

<figure><img src="/files/v1Iaw3UOycoBpg26zKYG" alt=""><figcaption></figcaption></figure>

## How to Integrate Magic Receipts as a Standalone Offering

The Magic Receipts offering is automatically included in the AdGate Rewards Offer Wall. However, publishers may also display Magic Receipts as a standalone offering within their website or app.

### Step 1: Create an AdGate Rewards Offer Wall

Follow the steps listed [here](https://docs.adgatemedia.com/adgate-rewards-monetization/untitled) to setup your AdGate Rewards offer wall. You may skip this step if you already have an AdGate Rewards offer wall created.

### Step 2: Obtain your wall code

You can find your wall code [here](https://panel.adgatemedia.com/affiliate/vc-walls/index). It will look like the following image:&#x20;

<figure><img src="/files/d7b0P3OjVoAPBxBjUQMu" alt=""><figcaption><p>You can see the wall code here is nq6Upw</p></figcaption></figure>

### Step 3: Create your unique link

Replace the **WALLCODE** text below with the value from the previous step. Replace **USERID** with the unique identifying value for each of your users.

<https://seek.gg/magic/**WALLCODE**/**USERID>\*\*

Optionally, you may also append additional tracking parameters to the url. ex: <https://seek.gg/magic/**WALLCODE**/**USERID**?s2=\\&s3=\\&s4=\\&s5=>

### Step 4: Append Offer Wall Information (Optional)

By default, all point and conversion information will be taken from your AdGate Rewards Wall settings as configured on the dashboard. However, if you wish to dynamically pass that information in, you can do so by following the steps below.

You may append the following offer wall information to the link:

| Parameter | Description         | Type    | Example |
| --------- | ------------------- | ------- | ------- |
| cr        | Conversion rate     | Integer | 100     |
| pp        | Plural points       | String  | Points  |
| ps        | Singular points     | String  | Point   |
| pa        | Points abbreviation | String  | Pts     |

**Example:**\
\
<https://seek.gg/magic/**WALLCODE**/**USERID**?cr=100\\&pp=Points\\&ps=Point\\&pa=Pts>

**NOTE:** If you want to append the conversion rate in the link, you need to hash the url for security purposes.

#### **Hashing**

To hash the link you need to encrypt everything after the domain name (<https://seek.gg>) with the HMAC SHA-256 hashing algorithm, and append the hash to the link. Here is a list of steps you need to follow to do the hashing:

Example URL:

`https://seek.gg/magic/WALLCODE/USERID?cr=100&pp=Points&ps=Point&pa=Pts`

1. Ask your account manager for your publisher secret key.
2. Generate a hash by encrypting the path and query using your secret key with this pseudo-code:\
   hash = *hmac\_256("/magic/WALLCODE/USERID?cr=100\&pp=Points\&ps=Point\&pa=Pts", secret\_key)*&#x20;
3. Append the hash to the url with the parameter "hash":\
   `https://seek.gg/magic/WALLCODE/USERID?cr=100&pp=Points&ps=Point&pa=Pts&hash=abcdefg123`

**PHP Script**

```php
// We hash only path and query.
// Root path "/" is always included in the data to sign.
// "?" included only if query string is not empty.
$path = parse_url($url, PHP_URL_PATH);
$query = parse_url($url, PHP_URL_QUERY);

$pathAndQuery = $path . ($query !== null ? ('?' . $query) : '');

$hash = hash_hmac(
    'sha256',
    utf8_encode($pathAndQuery),
    $secretKey,
);

$url .= "&hash={$hash}";
```

### Step 5: Send users through your link

Use your newly generated link to send users to the Magic Receipts product. You will receive a [postback](https://docs.adgatemedia.com/postbacks/postback-information) for each successfully scanned receipt.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.prodegeads.com/adgate-rewards-monetization/magic-receipts-standalone.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
