# Affiliate Platform API

Wynta follows the JSON format of API integration. A REST Full API is our preferred type.

## Redirect Link

A typical Wynta Tracking Link contains these parameters which are essential for tagging players to their corresponding affiliates/ traffic sources:

* Affiliate ID (`affid`)
* Campaign ID (`cid`)

A sample Tracking Link:

<https://demo.wynta.com/affiliate/redirect?cid=4152&aid=1417>

Wynta provides you with a unique Click ID (`click_id`) for every redirect when a Tracking Link is clicked on. This is a 32-digit alphanumerical entity that you will need to save and send relevant data during the API response for each respective Click ID.

A sample Redirect Link:

<https://www.casino.com/?clickid=55847fb164f0423993d0daafdf5260b0>

## Authentication

The Request and Response between the Software Provider and Wynta can be handled with a basic token based authentication.

#### Example:

```
headers = {

'Authorization': "Basic kuhygttvt195gasd7a6",

'content-type': "application/json",

'cache-control': "no-cache",

}
```

where "kuhygttvt195gasd7a6" is the token

## APIs

Two APIs need to be integrated in order for Wynta to receive and display holistic information to its users:

* Player Registration
* Player Activity

### Player Registration

Request Web API is a GET REST service that receives requests and returns responses in JSON format. In one Request call, we will be requesting data per White Label/ Brand/ Site for a given date.

#### Example:

### Request:

[https://reports.api.softwareprovider.com/api/player-register-data?whitelabelid=1& registrationDate=2020-03-07](https://reports.api.softwareprovider.com/api/player-register-data?whitelabelid=1&%20registrationDate=2020-03-07)

### Response:

```
[
  {
    "Alias": "Oliver Contestabile",
    "CasinoName": "MrVegasCasino",
    "City": "Horneburg",
    "ClickID": "55847fb164f0423993d0daafdf5260b0",
    "Country": "United Kingdom",
    "Currency": "GBP",
    "DateOfBirth": "1980-12-14T00:00:00",
    "Gender": "Male",
    "IP": "77.20.249.111",
    "PlayerID": 5486949,
    "RegisteredDate": "2020-07-30T01:55:36.42",
    "RegisteredPlatform": "WEB",
    "WhitelabelId": 1,
    "Bonuscode": "kk49zz",
    "EmailHash": "9b8769a4a742959a2d0227c30d56d229d1ebc394f36cb09830810c307646b530",
    "PhoneHash": "4020c9f1807d4787a41469e38f6ca3c0f380145f06f932822a16d5667e6c4217"
  }
]
```

| Name               | Type     | Required | Additional Information                                                                                                                                                                                                   |
| ------------------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Alias              | String   | False    | Username entered by the player during registration                                                                                                                                                                       |
| CasinoName         | String   | False    | Name of the brand                                                                                                                                                                                                        |
| City               | String   | False    | City entered by the player during the registration process or updated into their account at a later stage                                                                                                                |
| ClickID            | String   | True     | Unique 32-digit alphanumerical ID generated by Wynta on every click, used as unique identifier of each player                                                                                                            |
| Country            | String   | True     | Country entered by the player during the registration process or updated into their account at a later stage                                                                                                             |
| Currency           | String   | False    | Currency that the player makes transactions in                                                                                                                                                                           |
| DateOfBirth        | DateTime | False    | Date if birth entered by the player during the registration process or updated into their account at a later stage                                                                                                       |
| Gender             | String   | False    | Gender entered by the player during the registration process or updated into their account at a later stage                                                                                                              |
| IP                 | String   | False    | IP of the player recorded during registration                                                                                                                                                                            |
| LastUpdated        | DateTime | False    | Date and time of the last update                                                                                                                                                                                         |
| PlayerID           | Integer  | True     | Unique numerical ID generated by the software provider as a unique identifier of each player in their system                                                                                                             |
| RegisteredDate     | DateTime | True     | Date and time when the player has registered on the brand                                                                                                                                                                |
| RegisteredPlatform | String   | False    | Indicator of what device the player registered on; values can be one of: Mobile/ Tablet/ Web                                                                                                                             |
| WhitelabelId       | Integer  | True     | Unique ID given by the software provider for a particular brand or skin (white label) used as a distinguisher between various brands on the same software provider                                                       |
| Bonuscode          | String   | False    | Bonus codes can be used as unique identifiers for affiliates, and will allow Wynta to track and assign players using specific bonus codes to their appropriate affiliate. This parameter is useful for Offline Tracking. |
| EmailHash          | String   | False    | **SHA256 hashed** email address. Required for audience matching. Data must be lowercased before hashing.                                                                                                                 |
| PhoneHash          | String   | False    | **SHA256 hashed** phone number. Required for audience matching. Must include country code with no spaces/symbols (e.g., +447912345678) before hashing.                                                                   |

### Player Activity

Request Web API is a GET REST service that receives requests and returns responses in JSON format. In one Request call, we will be requesting data per White Label/ Brand/ Site for a given date.

#### Example:

### Request:

[https://reports.api.softwareprovider.com/api/player-activity-data?whitelabelid=1& activityDate=2020-03-07](https://reports.api.softwareprovider.com/api/player-activity-data?whitelabelid=1&%20activityDate=2020-03-07)

### Response:

```
[
  {
    "Bonuses": 0,
    "Chargebacks": 0,
    "Date": "2020-07-30T00:00:00",
    "Deposits": 30,
    "Expiredbonuses": 0,
    "FirstDepositDate": "2020-07-30T03:29:12",
    "FirstDepositAmount": 0,
    "Jackpotcontribution": 0,
    "Paidcashouts": 0,
    "Playerid": 5485025,
    "Revenue": 23.38,
    "Reversechargebacks": 0,
    "Sidegamesbets": 199.4,
    "Sidegamesrefunds": 0,
    "Sidegameswins": 179.41,
    "Voids": 0,
    "WhitelabelId": 1,
    "ClickID": "55847fb164f0423993d0daafdf5260b0",
    "Bonuscode": "kk49zz",
    "EmailHash": "9b8769a4a742959a2d0227c30d56d229d1ebc394f36cb09830810c307646b530",
    "PhoneHash": "4020c9f1807d4787a41469e38f6ca3c0f380145f06f932822a16d5667e6c4217",
    "product_activity": [
      {
        "provider": "Playtech",
        "product": "Casino",
        "category": "Slots",
        "sub_category": "Progressive Jackpot",
        "financials": {
          "bet_amount": 5,
          "win_amount": 1500,
          "revenue_amount": 0
        }
      },
      {
        "provider": "Playtech",
        "product": "Live Casino",
        "category": "Table Games",
        "sub_category": "Blackjack",
        "financials": {
          "bet_amount": 50,
          "win_amount": 0,
          "revenue_amount": 0
        }
      },
      {
        "provider": "Playtech",
        "product": "Sportsbook",
        "category": "Soccer",
        "sub_category": "English Premier League",
        "financials": {
          "bet_amount": 100,
          "win_amount": 0,
          "revenue_amount": 0
        }
      },
      {
        "provider": "Playtech",
        "product": "P2P Poker",
        "category": "Tournament",
        "sub_category": "Sit & Go",
        "financials": {
          "bet_amount": 10,
          "win_amount": 50,
          "revenue_amount": 1
        }
      },
      {
        "provider": "Playtech",
        "product": "Bingo",
        "category": "90-Ball",
        "sub_category": "Network Room",
        "financials": {
          "bet_amount": 2,
          "win_amount": 0,
          "revenue_amount": 0
        }
      },
      {
        "provider": "Playtech",
        "product": "Virtual Sports",
        "category": "Horse Racing",
        "sub_category": "Flat Racing",
        "financials": {
          "bet_amount": 15,
          "win_amount": 45,
          "revenue_amount": 0
        }
      }
    ]
  }
]
```

| Name                | Type             | Required | Additional Information                                                                                                                                                                                                   |
| ------------------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Bonuses             | Decimal          | False    | Value of bonus money credited into the player account by the brand operator                                                                                                                                              |
| Chargebacks         | Decimal          | False    | Deposits that are reversed by player                                                                                                                                                                                     |
| Date                | DateTime         | True     | Date and time of transaction                                                                                                                                                                                             |
| Deposits            | Decimal          | True     | Value of deposits made by player                                                                                                                                                                                         |
| Expiredbonuses      | Decimal          | False    | Value of time-bound bonuses that have expired                                                                                                                                                                            |
| FirstDepositDate    | Datetime         | True     | Date and time of first deposit made by player                                                                                                                                                                            |
| FirstDepositAmount  | Decimal          | True     | Amount of first deposit made by player                                                                                                                                                                                   |
| Jackpotcontribution | Decimal          | False    | This is a charge from the providers for jackpot games, a percentage of the total charge acts as insurance in the case of a jackpot win                                                                                   |
| Paidcashouts        | Decimal          | False    | Amount of withdrawal made by player                                                                                                                                                                                      |
| Playerid            | Integer          | True     | Unique numerical ID generated by the software provider as a unique identifier of each player in their system                                                                                                             |
| Revenue             | Decimal          | True     | Amount of revenue generated by player                                                                                                                                                                                    |
| Reversechargebacks  | Decimal          | False    | Amount of chargebacks that are put back into the system by player                                                                                                                                                        |
| Sidegamesbets       | Decimal          | True     | Total bets placed on a game (slots, live table, sports etc.)                                                                                                                                                             |
| Sidegamesrefunds    | Decimal          | False    | Refunds in the case of a round having an error, or in the case of sports, the game being cancelled, and the players stake returned.                                                                                      |
| Sidegameswins       | Decimal          | False    | Wins on any game.                                                                                                                                                                                                        |
| Voids               | Decimal          | False    | Voided transaction or game round                                                                                                                                                                                         |
| WhitelabelId        | Integer          | True     | Unique ID given by the software provider for a particular brand or skin (white label) used as a distinguisher between various brands on the same software provider                                                       |
| ClickID             | String           | True     | Unique 32-digit alphanumerical ID generated by Wynta on every click, used as unique identifier of each player                                                                                                            |
| Bonuscode           | String           | False    | Bonus codes can be used as unique identifiers for affiliates, and will allow Wynta to track and assign players using specific bonus codes to their appropriate affiliate. This parameter is useful for Offline Tracking. |
| EmailHash           | String           | False    | **SHA256 hashed** email address. Used for cross-referencing activity. Data must be lowercased before hashing.                                                                                                            |
| PhoneHash           | String           | False    | **SHA256 hashed** phone number. Used for cross-referencing activity. Must include country code with no spaces/symbols (e.g., +447912345678) before hashing.                                                              |
| `product_activity`  | Array of Objects | No       | Detailed breakdown of the player's activity split across different products and game categories.                                                                                                                         |

### Product Activity Breakdown

The **`product_activity`** object allows detailed reporting by product, category, and sub-category without changing the API schema in future. It expects an array of flattened objects.

```
product_activity [Array of Objects]
 ├── provider
 ├── product
 ├── category
 ├── sub_category
 └── financials
     ├── bet_amount
     ├── win_amount
     └── revenue_amount
```

#### Parameters Definition

| Metric          | Type    | Description                                                           |
| --------------- | ------- | --------------------------------------------------------------------- |
| provider        | String  | Name of the game provider (e.g., Playtech, Evolution)                 |
| product         | String  | Main product vertical (e.g., Casino, Sportsbook, P2P Poker)           |
| category        | String  | Game category (e.g., Slots, Soccer, Tournament)                       |
| sub\_category   | String  | Game sub-category (e.g., Progressive Jackpot, English Premier League) |
| bet\_amount     | Decimal | Total wagered amount                                                  |
| win\_amount     | Decimal | Total amount won by the player                                        |
| revenue\_amount | Decimal | Net revenue, rake amount, or platform fee                             |

## Data Privacy & Hashing

All Personally Identifiable Information (PII) such as Email and Phone numbers **must be hashed using the SHA256 algorithm** before being sent to Wynta via the API parameters. To ensure our systems can successfully match records, you must normalize the data before hashing:

* **Emails:** Must be converted entirely to lowercase.

  *Example: `Name@Example.com` → `name@example.com` → \[SHA256 Hash]*
* **Phone Numbers:** Must include the country code with a plus sign (`+`), and contain NO spaces, dashes, or parentheses.

  *Example: `+44 791-234 5678` → `+447912345678` → \[SHA256 Hash]*

**IMPORTANT – Organic Data Requirement**

To enable accurate reporting, fraud detection, and behavioral analysis, provider must send Player Activity data for all players, including **organic (non-affiliate) traffic**.

* Organic players must be sent with `ClickID` as null or empty
* All financial and product activity metrics remain mandatory

This data is required for:

* Revenue reconciliation
* Conversion benchmarking
* Advanced player behavior analysis

## Additional Notes

In the Player Activity response, you will need to send cumulative values in every response for a given player for the requested date.

For e.g. For a sequence of the following three events for Player A over two days:

* Player A makes a deposit of $10 at 10:00AM on 16th feb 2017

Request: activity data at 10:30AM on 16th feb 2017

Response: player A {deposit 10}

* Player A makes a deposit of $15 at 11:00AM on 16th feb 2017

Request: activity data at 11:30AM on 16th feb 2017

Response: player A {deposit 25}

* Player A makes a deposit of $10 at 10:00AM on 17th feb 2017

Request: activity data at 10:30AM on 17th feb 2017

Response: player A {deposit 10}


---

# 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.wynta.com/affiliate-platform-api.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.
