> ## Documentation Index
> Fetch the complete documentation index at: https://guide.daro.so/llms.txt
> Use this file to discover all available pages before exploring further.

# S2S Reward Callback API

> Receive server-to-server callbacks when users complete rewarded video ads to prevent fraud.

## Overview

DARO sends an HTTP/HTTPS GET request to your server when users complete rewarded video ads. Callbacks send immediately after completion but may delay up to several minutes depending on network conditions. Use the timestamp parameter to verify time difference between impression and callback.

**Retry Logic**: DARO retries up to 2 times if your server doesn't respond within 5 seconds.

<img src="https://mintcdn.com/delightroom-5a71a6a8/j3-znW7LKrbpP3mb/advanced/img/ad-unit-reward-callback_en.png?fit=max&auto=format&n=j3-znW7LKrbpP3mb&q=85&s=10d35b301aad5bdec5eb461fc2ed93ca" alt="Ad Unit Reward Callback" width="1156" height="868" data-path="advanced/img/ad-unit-reward-callback_en.png" />

**Setup**: Configure 'Callback URL' for your rewarded video ad unit on the Ad Units page.

## Callback URL Example

```
https://yourrewardedserver.com/rewards
```

## Callback URL Request Example

```
https://yourrewardedserver.com/rewards?ad_unit_id=fa1c6d2f-5016-467d-b54c-672299c7db4c&custom_data=yourcustomdata&key=b46635e51e76778ec15856720114c4edd6b6c3c7aeeb2a1b51dc346640cbca45&timestamp=1546300800&transaction_id=32ffe34770064d5c41c24deb3afd6a9fe072d2f423471851c869da6a9bc09ce3&user_id=youruserid
```

## Query Parameters

Parameters included as query strings in callback URL. Optional parameters (`custom_data` and `user_id`) pass as null if not set.

| Query Parameter         | Description                                                                                                                                                                                 | Example                                                          | Data Type |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------- |
| ad\_unit\_id            | Ad unit ID (UUID v4)                                                                                                                                                                        | fa1c6d2f-5016-467d-b54c-672299c7db4c                             | String    |
| custom\_data (optional) | Custom data (URL encoded). Recommended to keep string size under 8192 characters.                                                                                                           | my%20custom%20data                                               | String    |
| key                     | Verification key generated through the following process:<br />1. Initialize HMAC SHA256 with 'Callback Verification Key'\*<br />2. Generate digest with transaction\_id<br />3. Hex encode | b46635e51e76778ec15856720114c4edd6b6c3c7aeeb2a1b51dc346640cbca45 | String    |
| timestamp               | Timestamp when ad impression was recorded(integer, Epoch Time)                                                                                                                              | 1546300800                                                       | Int       |
| transaction\_id         | Unique transaction ID, 32-character hex                                                                                                                                                     | 0d0f748fcd0d4a4a9f6ac809216564b1                                 | String    |
| user\_id (optional)     | Publisher-defined user ID (URL encoded); maximum length 8192 characters                                                                                                                     | 7634657898                                                       | String    |

* Find your callback verification key at [https://dashboard.daro.so/service/account](https://dashboard.daro.so/service/account)

## Set Publisher-Defined User ID and Custom Data

Set `user_id` and `custom_data` on the client side using platform-specific SDK methods. These optional values send with the callback.

**Platform Guides:**

* [Android (Kotlin)](https://guide.daro.so/en/sdk-integration/android/ad-formats/rewarded#integrating-ads)
* [iOS (Swift)](https://guide.daro.so/en/sdk-integration/ios_new/ad-formats/rewarded#additional-features)
* [React Native](https://guide.daro.so/en/sdk-integration/react-native/ad-formats/rewarded#rewarded-video-ad-callback-methods)
