# Integration for the Game Aggregator

## Trueplay endpoint <a href="#trueplay-endpoints" id="trueplay-endpoints"></a>

### Send game transactions

<mark style="color:green;">`POST`</mark> `https://{operator-name}.proxy.trueplay.io/api/v1/accept`

The method to send game traffic from operator to Trueplay.

### Headers

| Name                                        | Type   | Description                                            |
| ------------------------------------------- | ------ | ------------------------------------------------------ |
| X-API-KEY<mark style="color:red;">\*</mark> | String | Operator key issued by TruePlay to access TruePlay API |

### Request Body

<table><thead><tr><th width="205">Name</th><th width="93">Type</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>operatorUserId<mark style="color:red;">*</mark></td><td>String</td><td>Id of user on Operator side</td><td>"121242"</td></tr><tr><td>transactionId<mark style="color:red;">*</mark></td><td>String</td><td>Id of user transaction</td><td>"fa732e77-db74-44b8-b6723-be9d37a13b40"</td></tr><tr><td>referenceTransactionId<mark style="color:red;">*</mark></td><td>String</td><td>Id of game transactions (BET | WIN) .  <br>This is required to be sent for such types of game transactions as ( REFUND | ROLLBACK )</td><td>null</td></tr><tr><td>type<mark style="color:red;">*</mark></td><td>String</td><td>Type of game transaction (BET | WIN | ROLLBACK | BONUS_BET | BONUS_WIN)</td><td>"BET"</td></tr><tr><td>gameProvider<mark style="color:red;">*</mark></td><td>String</td><td>-</td><td>"PRAGMATIC"</td></tr><tr><td>gameCode<mark style="color:red;">*</mark></td><td>String</td><td>-</td><td>"165"</td></tr><tr><td>gameName<mark style="color:red;">*</mark></td><td>String</td><td>-</td><td>"Pharaohs Gold 20"</td></tr><tr><td>gameType<mark style="color:red;">*</mark></td><td>String</td><td>-</td><td>"Slot"</td></tr><tr><td>currency<mark style="color:red;">*</mark></td><td>String</td><td>currency of game transaction</td><td>"USD"</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>Integer</td><td>amount of game transaction</td><td>2</td></tr></tbody></table>

## Game Aggregator endpoint <a href="#trueplay-endpoints" id="trueplay-endpoints"></a>

### Send Copy Stake transactions&#x20;

<mark style="color:green;">`POST`</mark> `https://{operatorbaseurl}/player-event`

The method to send game transactions in functionality "Copy Stake" from Trueplay side to Game Aggregator

### Headers

| Name                                                  | Type   | Description                                                                                                               |
| ----------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| X-REQUEST-SIGNATURE<mark style="color:red;">\*</mark> | String | <p>Request signature, Base64(HmacSHA512(SecretKey, MD5(request body)))<br>Event "data" is individual for each request</p> |

### Request Body

<table><thead><tr><th width="172">Name</th><th width="124">Type</th><th width="183">Description</th><th>Example</th></tr></thead><tbody><tr><td>operatorUserId<mark style="color:red;">*</mark></td><td>String</td><td>Id of user on Operator side</td><td>"john12345"</td></tr><tr><td>requestId<mark style="color:red;">*</mark></td><td>String</td><td>Id of request</td><td>"uuid"</td></tr><tr><td>createdAt<mark style="color:red;">*</mark></td><td>String</td><td>Date of game transactions</td><td>"2022-08-18 06:42:45"</td></tr><tr><td>type<mark style="color:red;">*</mark></td><td>String</td><td>Type of Event (COPY_BET | COPY_WIN | COPY_ROLLBACK )</td><td>COPY_BET</td></tr><tr><td>data<mark style="color:red;">*</mark></td><td>String</td><td>-</td><td>{<br>"eventParam":"eventValue"<br>}</td></tr></tbody></table>

### Type of "Copy Stake" events

<table data-full-width="true"><thead><tr><th width="299">Event type</th><th>Event data</th></tr></thead><tbody><tr><td>COPY_BET</td><td><p>{ </p><p>"type": "COPY_BET", </p><p>"data": {<br>  "gameProvider": Pragmatic,<br>  "gameCode": 123,<br>  "gameName":  Banana,<br>  "gameType": Slot,<br>  "currency": Usd,<br>  "amount": 10 <br>  } <br>}</p></td></tr><tr><td>COPY_WIN</td><td><p>{ </p><p>"type": "COPY_WIN", </p><p>"data": {<br>  "gameProvider": Pragmatic,<br>  "gameCode": 123,<br>  "gameName":  Banana,<br>  "gameType": Slot,<br>  "currency": Usd,<br>  "amount": 10 <br>  } <br>}</p></td></tr><tr><td>COPY_ROLLBACK</td><td><p>{ </p><p>"type": "COPY_ROLLBACK", </p><p>"data": {<br>  "gameProvider": Pragmatic,<br>  "gameCode": 123,<br>  "gameName":  Banana,<br>  "gameType": Slot,<br>  "currency": Usd,<br>  "amount": 10 <br>  } <br>}</p></td></tr></tbody></table>


---

# 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.trueplay.io/tech/integration-for-the-game-aggregator.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.
