# Introduction

Betstack is a platform for FRICTIONLESS Betting across a variety of channels including Web, Mobile in-app, Messenger Bots, USSD, SMS and in retail outlets in cashier or betting terminals. In this developers portal you find documentation needed to setup Betstack to offer FRICTIONLESS Betting to your players.&#x20;

Betstack services is easy to integrate with any Player Account Management (PAM) platforms and works alongside other game content such as Sportsbook, Casino games, Virtual Sports and Lotteries and other game systems. &#x20;

In this Developer Portal we have prepared important information to get you quickly started with Betstack.&#x20;


# Getting Started

Get started with Betstack learn about the differnet modules and simple steps to get started.

{% hint style="info" %}
Only authorized users can access the Betstack APIs. If you haven't received your account information please reach out to your account manager.
{% endhint %}

Betstack is a powerful and modular solution for managing Micro Bets. In simple steps you can offer different types of micro bets to your customers. This Getting started section provides an overview of the different modules and APIs you need to integrate Betstack to your platform.

There are 3 APIs developers need to get familiar with when working with Betstack.

<table><thead><tr><th width="180">API</th><th>Usage</th></tr></thead><tbody><tr><td>Bet Cards API</td><td>Bet Cards contains information about the Micro Bet configuration, such as teams, odds, stake and other playable settings</td></tr><tr><td>Bet Engine API</td><td>Processing engine for Micro Bets </td></tr><tr><td>PAM API</td><td>Ticketing for Player Account Management (PAM) Platforms </td></tr></tbody></table>


# Signature

Generate HMAC hash signature to access Betstack APIs

Some APIs require signature in incoming requests (like BetEngine API).

The Signature is calculated based on the `timestamp`, `request body` and your `Secret Key` with HMAC hash using SHA256 Algorithm.&#x20;

Here is an example on how to generate the Signature for create `/ticket` request with `Secret Key=12345ABCDE`, `timestamp=1706090303` and following request body:

```json
{
    "operator": "site",
    "token": "UnIqUe-ToKeN",
    "price": 5000,
    "currency": "KES",
    "atag": "affiliate-1",
    "source": "mobile",
    "type": "superbet",
    "event": 100001,
    "bets": [101, 102, 103, 104, 105, 106]
}
```

In order to generate the Signature all spaces must be removed from the request body:

```json
{"operator":"site","token":"UnIqUe-ToKeN","price":5000,"currency":"KES","atag":"affiliate-1","source":"mobile","type":"superbet","event":100001,"bets":[101,102,103,104,105,106]}
```

{% hint style="info" %}
Please note that the order of the fields matters for calculating the signature. Fields must be in the same order they are listed on doc pages for requests.
{% endhint %}

{% hint style="info" %}
Please note that optional fields, like `atag` must also be included in signature generation, even if they have `null` values. For example, if `atag` field has `null` value then it must be included in signature generation like so:

```
{...,"atag":null,...}
```

{% endhint %}

Then message for HMAC algorithm has to be formed using following template:

```
{timestamp}{request body with removed spaces}
```

{% hint style="info" %}
Please note that for requests that have no body, like GET requests, above template will only consist of `{timestamp}`.
{% endhint %}

So the message should look like the following:

```
1706090303{"operator":"site","token":"UnIqUe-ToKeN","price":5000,"currency":"KES","atag":"affiliate-1","source":"mobile","type":"superbet","event":100001,"bets":[101,102,103,104,105,106]}
```

The computed Signature for this request is:

```
f99aee9f77eef1ee8b64c78e7f8612e3234f03cce5fecdebd7ea27f2b9081423
```

A free online HMAC Generator for testing is available on <https://www.freeformatter.com/hmac-generator.html#before-output>.&#x20;

Here is how we calculated the Signature from above example using **Free Formatter**

<figure><img src="https://2027057513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKuxm6ysd27rN14uEAtGy%2Fuploads%2F9OVxZZO7fMiuiQsAL0w8%2Fimage.png?alt=media&amp;token=6f164db9-11ae-4a52-9bee-3345e04b85e3" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Your `Secret Key` is located on your API Settings page. Login to Betstack to access your `Secret Key`
{% endhint %}

<figure><img src="https://2027057513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKuxm6ysd27rN14uEAtGy%2Fuploads%2Fe5aGzX5mkTtACXh9j4Ee%2Fsecret-Key.png?alt=media&amp;token=7a7a76a8-c5ea-4821-986f-e015fb624c4b" alt=""><figcaption><p>Secret Key is locate in API Settings profile page</p></figcaption></figure>


# Bet Card API


# Calculator


# Finance details

GET \`/bc/calculator/finance-details\` endpoint

Calculates detailed finance info: taxes and payouts.

Query parameters:

<table><thead><tr><th>Parameter name</th><th width="175">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Operator name. For example, for operator <code>acme</code> the value should be <code>operator=acme</code></td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value should be <code>price=3500</code></td></tr><tr><td>odds</td><td>list of floats</td><td>List of event odds at time of ticket submission. Should be in decimal format with 2 digits after comma. For example, for odds <code>1.24</code> and <code>2.76</code> the value should be <code>odds=1.24&#x26;odds=2.76</code></td></tr></tbody></table>

Response example:

```json
{
  "price": 1000,
  "total_odds": 3.42,
  "stake": 889,
  "ext": 12.5,
  "ext_amount": 111,
  "ext_type": "inclusive",
  "wht": 20,
  "wht_amount": 430,
  "gross_payout": 3040,
  "net_payout": 2610
}
```

If operator was not found error response is returned with status code `400`

```json
{
  "code": 106,
  "message": "Operator wrong-name was not found"
}
```


# Jackpot


# Get Jackpot Cards

Returns the list of available Jackpot cards for specific operator.

Returns only 10 earliest cards.

`GET` [https://api.betstack.io/bc/jackpots?operator=](https://api.betstack.io/bc/jackpots?operator=acme){operator}

&#x20;Response example:

```json
[
    {
        "code": "B599E0",
        "operator": "acme",
        "prices": [
            1000
        ],
        "stakes": [
            889
        ],
        "ext": 12.5,
        "wht": 20.0,
        "ext_amounts": [
            111
        ],
        "is_free": false,
        "enabled": true,
        "title": "Cool bet",
        "description": "Jackpot description",
        "sitename": null,
        "domain": null,
        "preview_img": null,
        "created": "2024-08-28T17:04:28.509000",
        "operator_time_created": "2024-08-28T17:04:28.509000",
        "expires": "2024-10-10T22:00:00.000000",
        "operator_time_expires": "2024-10-10T22:00:00.000000",
        "events": [
            {
                "id": 269875,
                "starts": "2024-05-16T14:10:00.000000",
                "operator_time_starts": "2024-05-16T14:10:00.000000",
                "category": {
                    "league_id": 11710000,
                    "league_slug": "football/united-arab-emirates/premier-league",
                    "league_name": "Premier League",
                    "country_id": 1630000,
                    "country_slug": "united-arab-emirates",
                    "country_name": "United Arab Emirates"
                },
                "home_team": {
                    "slug": "al-ain-fc",
                    "name": "Al-Ain FC",
                    "id": 1062100000
                },
                "away_team": {
                    "slug": "al-ittihad-kalba",
                    "name": "Al Ittihad Kalba",
                    "id": 1062150000
                },
                "market": {
                    "market_code": "MRFT",
                    "market_name": "Match Result Full Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 1,
                            "bet_code": "1",
                            "bet_name": "Home",
                            "odds": 2.35,
                            "updated": "2024-05-16T13:56:04"
                        },
                        {
                            "id": 2,
                            "bet_code": "X",
                            "bet_name": "Draw",
                            "odds": 3.8,
                            "updated": "2024-05-16T12:26:10"
                        },
                        {
                            "id": 3,
                            "bet_code": "2",
                            "bet_name": "Away",
                            "odds": 2.4,
                            "updated": "2024-05-16T13:56:04"
                        }
                    ]
                }
            },
            {
                "id": 269876,
                "starts": "2024-05-10T22:00:00.000000",
                "operator_time_starts": "2024-05-10T22:00:00.000000",
                "category": {
                    "league_id": 14260000,
                    "league_slug": "football/panama/liga-prom",
                    "league_name": "Liga Prom",
                    "country_id": 1980000,
                    "country_slug": "panama",
                    "country_name": "Panama"
                },
                "home_team": {
                    "slug": "aguilas-de-la-u",
                    "name": "Aguilas de la U",
                    "id": 1213460000
                },
                "away_team": {
                    "slug": "panama-city-fc",
                    "name": "Panama City FC",
                    "id": 1095130000
                },
                "market": {
                    "market_code": "MRFT",
                    "market_name": "Match Result Full Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 1,
                            "bet_code": "1",
                            "bet_name": "Home",
                            "odds": 2.34,
                            "updated": "2024-05-10T20:46:41"
                        },
                        {
                            "id": 2,
                            "bet_code": "X",
                            "bet_name": "Draw",
                            "odds": 3.25,
                            "updated": "2024-05-09T20:01:22"
                        },
                        {
                            "id": 3,
                            "bet_code": "2",
                            "bet_name": "Away",
                            "odds": 2.85,
                            "updated": "2024-05-10T20:46:41"
                        }
                    ]
                }
            },
            {
                "id": 269877,
                "starts": "2024-05-12T10:00:00.000000",
                "operator_time_starts": "2024-05-12T10:00:00.000000",
                "category": {
                    "league_id": 19210000,
                    "league_slug": "football/rep-ireland/leinster-senior-league",
                    "league_name": "Leinster Senior League",
                    "country_id": 1500000,
                    "country_slug": "rep-ireland",
                    "country_name": "Rep. Ireland"
                },
                "home_team": {
                    "slug": "donnycarney",
                    "name": "Donnycarney",
                    "id": 1147460000
                },
                "away_team": {
                    "slug": "bluebell-united",
                    "name": "Bluebell United",
                    "id": 1151840000
                },
                "market": {
                    "market_code": "MRFT",
                    "market_name": "Match Result Full Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 1,
                            "bet_code": "1",
                            "bet_name": "Home",
                            "odds": 2.06,
                            "updated": "2024-05-12T09:40:34"
                        },
                        {
                            "id": 2,
                            "bet_code": "X",
                            "bet_name": "Draw",
                            "odds": 3.55,
                            "updated": "2024-05-12T09:40:34"
                        },
                        {
                            "id": 3,
                            "bet_code": "2",
                            "bet_name": "Away",
                            "odds": 3.15,
                            "updated": "2024-05-12T09:40:34"
                        }
                    ]
                }
            }
        ]
    }
]
```


# Get Jackpot Card by code

Returns Jackpot card by specified code

`GET` [https://api.betstack.io/bc/jackpots/](https://api.betstack.io/bc/jackpots/DEL001){code}

Response example:

```json
{
    "code": "B599E0",
    "operator": "acme",
    "prices": [
        1000
    ],
    "stakes": [
        889
    ],
    "ext": 12.5,
    "wht": 20.0,
    "ext_amounts": [
        111
    ],
    "is_free": false,
    "enabled": true,
    "title": "Cool bet",
    "description": "Jackpot description",
    "sitename": null,
    "domain": null,
    "preview_img": null,
    "created": "2024-08-28T17:04:28.509000",
    "operator_time_created": "2024-08-28T17:04:28.509000",
    "expires": "2024-10-10T22:00:00.000000",
    "operator_time_expires": "2024-10-10T22:00:00.000000",
    "events": [
        {
            "id": 269875,
            "starts": "2024-05-16T14:10:00.000000",
            "operator_time_starts": "2024-05-16T14:10:00.000000",
            "category": {
                "league_id": 11710000,
                "league_slug": "football/united-arab-emirates/premier-league",
                "league_name": "Premier League",
                "country_id": 1630000,
                "country_slug": "united-arab-emirates",
                "country_name": "United Arab Emirates"
            },
            "home_team": {
                "slug": "al-ain-fc",
                "name": "Al-Ain FC",
                "id": 1062100000
            },
            "away_team": {
                "slug": "al-ittihad-kalba",
                "name": "Al Ittihad Kalba",
                "id": 1062150000
            },
            "market": {
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 1,
                        "bet_code": "1",
                        "bet_name": "Home",
                        "odds": 2.35,
                        "updated": "2024-05-16T13:56:04"
                    },
                    {
                        "id": 2,
                        "bet_code": "X",
                        "bet_name": "Draw",
                        "odds": 3.8,
                        "updated": "2024-05-16T12:26:10"
                    },
                    {
                        "id": 3,
                        "bet_code": "2",
                        "bet_name": "Away",
                        "odds": 2.4,
                        "updated": "2024-05-16T13:56:04"
                    }
                ]
            }
        },
        {
            "id": 269876,
            "starts": "2024-05-10T22:00:00.000000",
            "operator_time_starts": "2024-05-10T22:00:00.000000",
            "category": {
                "league_id": 14260000,
                "league_slug": "football/panama/liga-prom",
                "league_name": "Liga Prom",
                "country_id": 1980000,
                "country_slug": "panama",
                "country_name": "Panama"
            },
            "home_team": {
                "slug": "aguilas-de-la-u",
                "name": "Aguilas de la U",
                "id": 1213460000
            },
            "away_team": {
                "slug": "panama-city-fc",
                "name": "Panama City FC",
                "id": 1095130000
            },
            "market": {
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 1,
                        "bet_code": "1",
                        "bet_name": "Home",
                        "odds": 2.34,
                        "updated": "2024-05-10T20:46:41"
                    },
                    {
                        "id": 2,
                        "bet_code": "X",
                        "bet_name": "Draw",
                        "odds": 3.25,
                        "updated": "2024-05-09T20:01:22"
                    },
                    {
                        "id": 3,
                        "bet_code": "2",
                        "bet_name": "Away",
                        "odds": 2.85,
                        "updated": "2024-05-10T20:46:41"
                    }
                ]
            }
        },
        {
            "id": 269877,
            "starts": "2024-05-12T10:00:00.000000",
            "operator_time_starts": "2024-05-12T10:00:00.000000",
            "category": {
                "league_id": 19210000,
                "league_slug": "football/rep-ireland/leinster-senior-league",
                "league_name": "Leinster Senior League",
                "country_id": 1500000,
                "country_slug": "rep-ireland",
                "country_name": "Rep. Ireland"
            },
            "home_team": {
                "slug": "donnycarney",
                "name": "Donnycarney",
                "id": 1147460000
            },
            "away_team": {
                "slug": "bluebell-united",
                "name": "Bluebell United",
                "id": 1151840000
            },
            "market": {
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 1,
                        "bet_code": "1",
                        "bet_name": "Home",
                        "odds": 2.06,
                        "updated": "2024-05-12T09:40:34"
                    },
                    {
                        "id": 2,
                        "bet_code": "X",
                        "bet_name": "Draw",
                        "odds": 3.55,
                        "updated": "2024-05-12T09:40:34"
                    },
                    {
                        "id": 3,
                        "bet_code": "2",
                        "bet_name": "Away",
                        "odds": 3.15,
                        "updated": "2024-05-12T09:40:34"
                    }
                ]
            }
        }
    ]
}
```


# Pick Jackpot Bets

`POST` [https://api.betstack.io/bc/jackpots/pick-bets?mode](https://api.betstack.io/bc/jackpots/pick-bets?mode=favourite)={mode}

Modes available: `random` or `favourite`.

`random` mode will pick up one random bet for each event. All requests to this endpoint with the same body should generate different shuffles.

`favourite` mode will pick up one bet with lowest odds for each event. All requests to this endpoint with the same body should generate the same shuffle (if odds didn't change).

Request example:

```json
[
    {
        "event_id": 269875,
        "bets": [
            {
                "id": 1,
                "odds": 2.35
            },
            {
                "id": 2,
                "odds": 3.8
            },
            {
                "id": 3,
                "odds": 1.4
            }
        ]
    },
    {
        "event_id": 269876,
        "bets": [
            {
                "id": 4,
                "odds": 2.34
            },
            {
                "id": 5,
                "odds": 3.25
            },
            {
                "id": 6,
                "odds": 1.85
            }
        ]
    },
    {
        "event_id": 269877,
        "bets": [
            {
                "id": 7,
                "odds": 2.06
            }
        ]
    }
]
```

Response example (for `mode=random`):

```json
[
    {
        "event_id": 269875,
        "bet_id": 1
    },
    {
        "event_id": 269876,
        "bet_id": 4
    },
    {
        "event_id": 269877,
        "bet_id": 7
    }
]
```

Response example (for `mode=favourite`):

```json
[
    {
        "event_id": 269875,
        "bet_id": 3
    },
    {
        "event_id": 269876,
        "bet_id": 6
    },
    {
        "event_id": 269877,
        "bet_id": 7
    }
]
```


# Quicktip


# Get Quicktip Cards

Returns the list of available Quicktip cards for specific operator.

Returns only 10 latest cards.

`GET` [https://api.betstack.io/bc/quicktips?operator=](https://api.betstack.io/bc/quicktips?operator=acme){operator}

&#x20;Response example:

```json
[
    {
        "code": "54FE26",
        "total_odds": 13.29,
        "prices": [
            50000,
            100000,
            150000,
            200000
        ],
        "stakes": [
            44444,
            88889,
            133333,
            177778
        ],
        "ext": 12.5,
        "ext_amounts": [
            5556,
            11111,
            16667,
            22222
        ],
        "wht": 20,
        "wht_amounts": [
            109243,
            218489,
            327733,
            436978
        ],
        "net_payouts": [
            481418,
            962846,
            1444263,
            1925692
        ],
        "gross_payouts": [
            590661,
            1181335,
            1771996,
            2362670
        ],
        "operator": "acme",
        "enabled": true,
        "title": "Cool bet",
        "description": "Quicktip description",
        "sitename": null,
        "domain": null,
        "preview_img": null,
        "created": "2024-06-24T20:10:52.605000",
        "operator_time_created": "2024-06-24T22:10:52.605000",
        "expires": "2024-08-17T11:30:00.000000",
        "operator_time_expires": "2024-08-17T13:30:00.000000",
        "events": [
            {
                "starts": "2024-08-17T11:30:00.000000",
                "operator_time_starts": "2024-08-17T13:30:00.000000",
                "category": {
                    "league_id": 1053,
                    "league_slug": "football/england/premier-league",
                    "league_name": "Premier League",
                    "country_id": 2340000,
                    "country_slug": "england",
                    "country_name": "England"
                },
                "home_team": {
                    "slug": "ipswich-town",
                    "name": "Ipswich Town",
                    "id": 100567
                },
                "away_team": {
                    "slug": "liverpool-fc-montevideo",
                    "name": "Liverpool FC Montevideo",
                    "id": 1053630000
                },
                "bet": {
                    "id": 1,
                    "bet_code": "1",
                    "bet_name": "Home",
                    "market_code": "MRFT",
                    "market_name": "Match Result Full Time",
                    "line_code": null,
                    "line_name": null,
                    "odds": 8.8,
                    "updated": "2024-06-18T09:00:56"
                },
                "id": 284095
            },
            {
                "starts": "2024-08-17T11:30:00.000000",
                "operator_time_starts": "2024-08-17T13:30:00.000000",
                "category": {
                    "league_id": 1053,
                    "league_slug": "football/england/premier-league",
                    "league_name": "Premier League",
                    "country_id": 2340000,
                    "country_slug": "england",
                    "country_name": "England"
                },
                "home_team": {
                    "slug": "ipswich-town",
                    "name": "Ipswich Town",
                    "id": 100567
                },
                "away_team": {
                    "slug": "liverpool",
                    "name": "Liverpool",
                    "id": 100521
                },
                "bet": {
                    "id": 14,
                    "bet_code": "O",
                    "bet_name": "Over",
                    "market_code": "OUFT",
                    "market_name": "Over/Under Full Time",
                    "line_code": "25",
                    "line_name": "2.5",
                    "odds": 1.51,
                    "updated": "2024-07-01T05:10:45"
                },
                "id": 284126
            }
        ]
    }
]
```


# Get Quicktip Card by code

Returns Quicktip card by specified code

`GET` [https://api.betstack.io/bc/quicktips/](https://api.betstack.io/bc/quicktips/B57AFB){code}

Response example:

```json
{
    "code": "54FE26",
    "total_odds": 13.29,
    "prices": [
        50000,
        100000,
        150000,
        200000
    ],
    "stakes": [
        44444,
        88889,
        133333,
        177778
    ],
    "ext": 12.5,
    "ext_amounts": [
        5556,
        11111,
        16667,
        22222
    ],
    "wht": 20,
    "wht_amounts": [
        109243,
        218489,
        327733,
        436978
    ],
    "net_payouts": [
        481418,
        962846,
        1444263,
        1925692
    ],
    "gross_payouts": [
        590661,
        1181335,
        1771996,
        2362670
    ],
    "operator": "acme",
    "enabled": true,
    "title": "Cool bet",
    "description": "Quicktip description",
    "sitename": null,
    "domain": null,
    "preview_img": null,
    "created": "2024-06-24T21:10:52.605000",
    "operator_time_created": "2024-06-24T23:10:52.605000",
    "expires": "2024-08-17T10:30:00.000000",
    "operator_time_expires": "2024-08-17T12:30:00.000000",
    "events": [
        {
            "starts": "2024-08-17T11:30:00.000000",
            "operator_time_starts": "2024-08-17T13:30:00.000000",
            "category": {
                "league_id": 1053,
                "league_slug": "football/england/premier-league",
                "league_name": "Premier League",
                "country_id": 2340000,
                "country_slug": "england",
                "country_name": "England"
            },
            "home_team": {
                "slug": "ipswich-town",
                "name": "Ipswich Town",
                "id": 100567
            },
            "away_team": {
                "slug": "liverpool-fc-montevideo",
                "name": "Liverpool FC Montevideo",
                "id": 1053630000
            },
            "bet": {
                "id": 1,
                "bet_code": "1",
                "bet_name": "Home",
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "odds": 8.8,
                "updated": "2024-06-18T09:00:56"
            },
            "id": 284095
        },
        {
            "starts": "2024-08-17T11:30:00.000000",
            "operator_time_starts": "2024-08-17T13:30:00.000000",
            "category": {
                "league_id": 1053,
                "league_slug": "football/england/premier-league",
                "league_name": "Premier League",
                "country_id": 2340000,
                "country_slug": "england",
                "country_name": "England"
            },
            "home_team": {
                "slug": "ipswich-town",
                "name": "Ipswich Town",
                "id": 100567
            },
            "away_team": {
                "slug": "liverpool",
                "name": "Liverpool",
                "id": 100521
            },
            "bet": {
                "id": 14,
                "bet_code": "O",
                "bet_name": "Over",
                "market_code": "OUFT",
                "market_name": "Over/Under Full Time",
                "line_code": "25",
                "line_name": "2.5",
                "odds": 1.51,
                "updated": "2024-07-01T05:10:45"
            },
            "id": 284126
        }
    ]
}
```

If the card with specified code was not found error response is returned with status code `400`

```json
{
  "code": 102,
  "message": "Betcard `B57AFBa` was not found"
}
```

If the card is expired an error response is returned with status code `400`

```json
{
  "code": 103,
  "message": "Betcard `C3E370` expired"
}
```


# Smartbet


# Get Smartbert cards

Returns the list of available Smartbet cards for specific operator.

Returns only 50 earliest cards.

`GET` [https://api.betstack.io/bc/smartbets?operator=](https://api.betstack.io/bc/smartbets?operator=acme){operator}

Response example:

```json
[
    {
        "code": "F2964C",
        "title": "World",
        "description": "Smartbet description",
        "sitename": null,
        "domain": null,
        "preview_img": null,
        "operator": "acme",
        "prices": [
            500,
            1000,
            1500,
            2000
        ],
        "ext": 12.5,
        "ext_amounts": [
            56,
            111,
            167,
            222
        ],
        "stakes": [
            444,
            889,
            1333,
            1778
        ],
        "wht": 20,
        "potential_net_payouts": [
            2500000,
            5000000,
            7500000,
            10000000
        ],
        "potential_gross_payouts": [
            3125000,
            6250000,
            9375000,
            12500000
        ],
        "multibonus_odds": 1.25,
        "min_odds": 1.25,
        "max_odds": 4.99,
        "medium_risk_tips": {
            "min_odds": 1.9,
            "max_odds": 4.99
        },
        "low_risk_tips": {
            "min_odds": 1.25,
            "max_odds": 4.99
        },
        "markets": [
            {
                "code": "MRHT",
                "lines": [],
                "bets": [
                    "1"
                ]
            },
            {
                "code": "MRSH",
                "lines": [],
                "bets": [
                    "2",
                    "X"
                ]
            },
            {
                "code": "MRFT",
                "lines": [],
                "bets": [
                    "2"
                ]
            },
            {
                "code": "AHHT",
                "lines": [
                    "-275"
                ],
                "bets": [
                    "1"
                ]
            },
            {
                "code": "AHSH",
                "lines": [
                    "-225"
                ],
                "bets": [
                    "1"
                ]
            },
            {
                "code": "AHFT",
                "lines": [
                    "-3"
                ],
                "bets": [
                    "1"
                ]
            }
        ],
        "events_start_before": 1000,
        "enabled": true,
        "leagues": [],
        "created": "2024-07-15T13:28:20.877540",
        "operator_time_created": "2024-07-15T15:28:20.877540"
    }
]
```


# Get Smartbet  Card by code

Returns Smartbet card by specified code

`GET` [https://api.betstack.io/bc/smartbets/](https://api.betstack.io/bc/smartbets/C34826){code}

Response example

```json
{
    "code": "F2964C",
    "title": "World",
    "description": "Smartbet description",
    "sitename": null,
    "domain": null,
    "preview_img": null,
    "operator": "acme",
    "prices": [
        500,
        1000,
        1500,
        2000
    ],
    "ext": 12.5,
    "ext_amounts": [
        56,
        111,
        167,
        222
    ],
    "stakes": [
        444,
        889,
        1333,
        1778
    ],
    "wht": 20,
    "potential_net_payouts": [
        2500000,
        5000000,
        7500000,
        10000000
    ],
    "potential_gross_payouts": [
        3125000,
        6250000,
        9375000,
        12500000
    ],
    "multibonus_odds": 1.25,
    "min_odds": 1.25,
    "max_odds": 4.99,
    "medium_risk_tips": {
        "min_odds": 1.9,
        "max_odds": 4.99
    },
    "low_risk_tips": {
        "min_odds": 1.25,
        "max_odds": 4.99
    },
    "markets": [
        {
            "code": "MRHT",
            "lines": [],
            "bets": [
                "1"
            ]
        },
        {
            "code": "MRSH",
            "lines": [],
            "bets": [
                "2",
                "X"
            ]
        },
        {
            "code": "MRFT",
            "lines": [],
            "bets": [
                "2"
            ]
        },
        {
            "code": "AHHT",
            "lines": [
                "-275"
            ],
            "bets": [
                "1"
            ]
        },
        {
            "code": "AHSH",
            "lines": [
                "-225"
            ],
            "bets": [
                "1"
            ]
        },
        {
            "code": "AHFT",
            "lines": [
                "-3"
            ],
            "bets": [
                "1"
            ]
        }
    ],
    "events_start_before": 1000,
    "enabled": true,
    "leagues": [],
    "created": "2024-07-15T13:28:20.877540",
    "operator_time_created": "2024-07-15T15:28:20.877540"
}
```

If the card with specified code was not found error response is returned with status code `400`

```json
{
  "code": 102,
  "message": "Betcard `B57AFBA` was not found"
}
```


# Generate a Smartbet

Returns a Smartbet generated based on input parameters

`POST` [https://api.betstack.io/bc/smartbets/](https://api.betstack.io/bc/smartbets/C34826){code}

json payload

```json
{
    "stake": 2000,
    "win": 25000,
    "risk": "1.25-4.99"
}
```

Response example

```json
{
    "price": 2000,
    "stake": 1778,
    "total_odds": 18.24,
    "ext": 12.5,
    "ext_amount": 222,
    "wht": 20,
    "wht_amount": 6131,
    "gross_payout": 32431,
    "net_payout": 26300,
    "risk": "1.25-1.99",
    "events": [
        {
            "starts": "2024-07-17T17:00:00.000000",
            "operator_time_starts": "2024-07-17T19:00:00.000000",
            "category": {
                "league_id": 18450000,
                "league_slug": "football/finland/kakkonen-group-a",
                "league_name": "Kakkonen Group A",
                "country_id": 1880000,
                "country_slug": "finland",
                "country_name": "Finland"
            },
            "home_team": {
                "slug": "ppj",
                "name": "PPJ",
                "id": 1141060000
            },
            "away_team": {
                "slug": "japs-47",
                "name": "JaPS/47",
                "id": 1222480000
            },
            "bet": {
                "id": 1,
                "bet_code": "1",
                "bet_name": "Home",
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "odds": 1.95,
                "updated": "2024-07-16T06:45:11"
            },
            "id": 292275
        },
        {
            "starts": "2024-07-17T16:00:00.000000",
            "operator_time_starts": "2024-07-17T18:00:00.000000",
            "category": {
                "league_id": 2014,
                "league_slug": "football/finland/kakkonen-group-b",
                "league_name": "Kakkonen Group B",
                "country_id": 1880000,
                "country_slug": "finland",
                "country_name": "Finland"
            },
            "home_team": {
                "slug": "tampere-united",
                "name": "Tampere United",
                "id": 1145580000
            },
            "away_team": {
                "slug": "poxyt",
                "name": "Poxyt",
                "id": 1231090000
            },
            "bet": {
                "id": 1,
                "bet_code": "1",
                "bet_name": "Home",
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "odds": 1.22,
                "updated": "2024-07-16T09:45:10"
            },
            "id": 292283
        },
        {
            "starts": "2024-07-17T10:00:00.00000000",
            "operator_time_starts": "2024-07-17T12:00:00.00000000",
            "category": {
                "league_id": 14440000,
                "league_slug": "football/south-korea/fa-cup",
                "league_name": "FA Cup",
                "country_id": 2060000,
                "country_slug": "south-korea",
                "country_name": "South Korea"
            },
            "home_team": {
                "slug": "ulsan-hyundai",
                "name": "Ulsan Hyundai",
                "id": 1083280000
            },
            "away_team": {
                "slug": "incheon-united",
                "name": "Incheon United",
                "id": 1083290000
            },
            "bet": {
                "id": 1,
                "bet_code": "1",
                "bet_name": "Home",
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "odds": 1.64,
                "updated": "2024-07-16T09:21:10"
            },
            "id": 291394
        },
        {
            "starts": "2024-07-17T10:00:00.000000",
            "operator_time_starts": "2024-07-17T12:00:00.000000",
            "category": {
                "league_id": 14440000,
                "league_slug": "football/south-korea/fa-cup",
                "league_name": "FA Cup",
                "country_id": 2060000,
                "country_slug": "south-korea",
                "country_name": "South Korea"
            },
            "home_team": {
                "slug": "gwangju",
                "name": "Gwangju",
                "id": 1083270000
            },
            "away_team": {
                "slug": "seongnam-ilhwa-chunma",
                "name": "Seongnam Ilhwa Chunma",
                "id": 1083320000
            },
            "bet": {
                "id": 1,
                "bet_code": "1",
                "bet_name": "Home",
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "odds": 1.53,
                "updated": "2024-07-16T07:06:12"
            },
            "id": 292290
        },
        {
            "starts": "2024-07-17T15:30:00.000000",
            "operator_time_starts": "2024-07-17T17:30:00.000000",
            "category": {
                "league_id": 2014,
                "league_slug": "football/finland/kakkonen-group-b",
                "league_name": "Kakkonen Group B",
                "country_id": 1880000,
                "country_slug": "finland",
                "country_name": "Finland"
            },
            "home_team": {
                "slug": "fc-honka",
                "name": "FC Honka",
                "id": 1070520000
            },
            "away_team": {
                "slug": "vjs-vantaa",
                "name": "VJS Vantaa",
                "id": 1138340000
            },
            "bet": {
                "id": 3,
                "bet_code": "2",
                "bet_name": "Away",
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "odds": 1.67,
                "updated": "2024-07-16T09:00:10"
            },
            "id": 292284
        },
        {
            "starts": "2024-07-17T10:00:00.000000",
            "operator_time_starts": "2024-07-17T12:00:00.000000",
            "category": {
                "league_id": 14440000,
                "league_slug": "football/south-korea/fa-cup",
                "league_name": "FA Cup",
                "country_id": 2060000,
                "country_slug": "south-korea",
                "country_name": "South Korea"
            },
            "home_team": {
                "slug": "gimpo-citizen",
                "name": "Gimpo Citizen",
                "id": 1093350000
            },
            "away_team": {
                "slug": "jeju-united",
                "name": "Jeju United",
                "id": 1083350000
            },
            "bet": {
                "id": 3,
                "bet_code": "2",
                "bet_name": "Away",
                "market_code": "MRFT",
                "market_name": "Match Result Full Time",
                "line_code": null,
                "line_name": null,
                "odds": 1.83,
                "updated": "2024-07-16T07:06:12"
            },
            "id": 292289
        }
    ]
}
```

If a Smartbet can't be generated due to lack of events an error response is retured with status code `400`

```json
{
  "code": 104,
  "message": "Not enough data to generate a Smartbet 4253A4"
}
```


# Quickbet


# Get Quickbet Cards

Returns the list of available Quickbet cards for specific operator.

Returns only 10 earliest cards.

`GET` [https://api.betstack.io/bc/quickbets?operator=](https://api.betstack.io/bc/quickbets?operator=acme){operator}

&#x20;Response example:

```json
[
    {
        "code": "1581B4",
        "operator": "acme",
        "prices": [
            500,
            1000,
            1500,
            2000
        ],
        "stakes": [
            444,
            889,
            1333,
            1778
        ],
        "ext": 12.5,
        "ext_amounts": [
            56,
            111,
            167,
            222
        ],
        "open_stake": false,
        "enabled": true,
        "wht": 20,
        "title": "Liverpool",
        "description": "Quickbet description",
        "sitename": null,
        "domain": null,
        "preview_img": null,
        "created": "2024-07-11T09:19:46.361000",
        "operator_time_created": "2024-07-11T11:19:46.361000",
        "expires": "2024-08-17T11:30:00.000000",
        "operator_time_expires": "2024-08-17T13:30:00.000000",
        "events": [
            {
                "id": 284126,
                "starts": "2024-08-17T11:30:00.000000",
                "operator_time_starts": "2024-08-17T13:30:00.000000",
                "category": {
                    "league_id": 1053,
                    "league_slug": "football/england/premier-league",
                    "league_name": "Premier League",
                    "country_id": 2340000,
                    "country_slug": "england",
                    "country_name": "England"
                },
                "home_team": {
                    "slug": "ipswich-town",
                    "name": "Ipswich Town",
                    "id": 100567
                },
                "away_team": {
                    "slug": "liverpool",
                    "name": "Liverpool",
                    "id": 100521
                },
                "market": {
                    "market_code": "CSFT",
                    "market_name": "Correct Score Full Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 427,
                            "bet_code": "0-0",
                            "bet_name": "0-0",
                            "odds": 21,
                            "updated": "2024-07-14T21:44:56"
                        },
                        {
                            "id": 428,
                            "bet_code": "0-1",
                            "bet_name": "0-1",
                            "odds": 9.8,
                            "updated": "2024-07-11T02:14:42"
                        },
                        {
                            "id": 429,
                            "bet_code": "0-2",
                            "bet_name": "0-2",
                            "odds": 8.1,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 430,
                            "bet_code": "0-3",
                            "bet_name": "0-3",
                            "odds": 10,
                            "updated": "2024-07-15T09:00:00"
                        },
                        {
                            "id": 431,
                            "bet_code": "0-4",
                            "bet_name": "0-4",
                            "odds": 16.5,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 432,
                            "bet_code": "0-5",
                            "bet_name": "0-5",
                            "odds": 30,
                            "updated": "2024-07-11T02:14:42"
                        },
                        {
                            "id": 433,
                            "bet_code": "1-0",
                            "bet_name": "1-0",
                            "odds": 24,
                            "updated": "2024-07-09T23:14:34"
                        },
                        {
                            "id": 434,
                            "bet_code": "1-1",
                            "bet_name": "1-1",
                            "odds": 10.4,
                            "updated": "2024-07-15T09:00:00"
                        },
                        {
                            "id": 435,
                            "bet_code": "1-2",
                            "bet_name": "1-2",
                            "odds": 8.5,
                            "updated": "2024-07-15T09:00:00"
                        },
                        {
                            "id": 436,
                            "bet_code": "1-3",
                            "bet_name": "1-3",
                            "odds": 10.7,
                            "updated": "2024-07-14T21:44:56"
                        },
                        {
                            "id": 437,
                            "bet_code": "1-4",
                            "bet_name": "1-4",
                            "odds": 18.5,
                            "updated": "2024-07-01T16:31:42"
                        },
                        {
                            "id": 438,
                            "bet_code": "1-5",
                            "bet_name": "1-5",
                            "odds": 29,
                            "updated": "2024-07-11T02:14:42"
                        },
                        {
                            "id": 439,
                            "bet_code": "2-0",
                            "bet_name": "2-0",
                            "odds": 44,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 440,
                            "bet_code": "2-1",
                            "bet_name": "2-1",
                            "odds": 23,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 441,
                            "bet_code": "2-2",
                            "bet_name": "2-2",
                            "odds": 19,
                            "updated": "2024-07-01T16:31:42"
                        },
                        {
                            "id": 442,
                            "bet_code": "2-3",
                            "bet_name": "2-3",
                            "odds": 23,
                            "updated": "2024-07-01T16:31:42"
                        },
                        {
                            "id": 443,
                            "bet_code": "2-4",
                            "bet_name": "2-4",
                            "odds": 36,
                            "updated": "2024-07-14T21:44:56"
                        },
                        {
                            "id": 444,
                            "bet_code": "2-5",
                            "bet_name": "2-5",
                            "odds": 54,
                            "updated": "2024-06-24T05:16:14"
                        },
                        {
                            "id": 445,
                            "bet_code": "3-0",
                            "bet_name": "3-0",
                            "odds": 108,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 446,
                            "bet_code": "3-1",
                            "bet_name": "3-1",
                            "odds": 60,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 447,
                            "bet_code": "3-2",
                            "bet_name": "3-2",
                            "odds": 49,
                            "updated": "2024-07-11T02:14:42"
                        },
                        {
                            "id": 448,
                            "bet_code": "3-3",
                            "bet_name": "3-3",
                            "odds": 58,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 449,
                            "bet_code": "3-4",
                            "bet_name": "3-4",
                            "odds": 84,
                            "updated": "2024-07-11T02:14:42"
                        },
                        {
                            "id": 450,
                            "bet_code": "3-5",
                            "bet_name": "3-5",
                            "odds": 136,
                            "updated": "2024-07-09T09:44:34"
                        },
                        {
                            "id": 451,
                            "bet_code": "4-0",
                            "bet_name": "4-0",
                            "odds": 215,
                            "updated": "2024-07-11T02:14:42"
                        },
                        {
                            "id": 452,
                            "bet_code": "4-1",
                            "bet_name": "4-1",
                            "odds": 182,
                            "updated": "2024-07-11T02:14:42"
                        },
                        {
                            "id": 453,
                            "bet_code": "4-2",
                            "bet_name": "4-2",
                            "odds": 148,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 454,
                            "bet_code": "4-3",
                            "bet_name": "4-3",
                            "odds": 194,
                            "updated": "2024-07-11T02:14:42"
                        },
                        {
                            "id": 455,
                            "bet_code": "4-4",
                            "bet_name": "4-4",
                            "odds": 250,
                            "updated": "2024-07-15T12:45:04"
                        },
                        {
                            "id": 456,
                            "bet_code": "4-5",
                            "bet_name": "4-5",
                            "odds": 420,
                            "updated": "2024-07-02T09:01:47"
                        },
                        {
                            "id": 457,
                            "bet_code": "5-0",
                            "bet_name": "5-0",
                            "odds": 265,
                            "updated": "2024-06-18T15:01:09"
                        },
                        {
                            "id": 458,
                            "bet_code": "5-1",
                            "bet_name": "5-1",
                            "odds": 210,
                            "updated": "2024-06-18T15:01:09"
                        },
                        {
                            "id": 459,
                            "bet_code": "5-2",
                            "bet_name": "5-2",
                            "odds": 320,
                            "updated": "2024-06-18T09:45:57"
                        }
                    ]
                }
            }
        ]
    }
]
```


# Get Quickbet Card by code

Returns Quickbet card by specified code

`GET` [https://api.betstack.io/bc/quickbets/](https://api.betstack.io/bc/quickbets/DEL001){code}

Response example:

```json
{
    "code": "1581B4",
    "operator": "acme",
    "prices": [
        500,
        1000,
        1500,
        2000
    ],
    "stakes": [
        444,
        889,
        1333,
        1778
    ],
    "ext": 12.5,
    "ext_amounts": [
        56,
        111,
        167,
        222
    ],
    "open_stake": false,
    "enabled": true,
    "wht": 20,
    "title": "Cool bet",
    "description": "Quickbet description",
    "sitename": null,
    "domain": null,
    "preview_img": null,
    "created": "2024-07-11T09:19:46.361000",
    "operator_time_created": "2024-07-11T11:19:46.361000",
    "expires": "2024-08-17T11:30:00.000000",
    "operator_time_expires": "2024-08-17T13:30:00.000000",
    "events": [
        {
            "id": 284126,
            "starts": "2024-08-17T11:30:00.000000",
            "operator_time_starts": "2024-08-17T13:30:00.000000",
            "category": {
                "league_id": 1053,
                "league_slug": "football/england/premier-league",
                "league_name": "Premier League",
                "country_id": 2340000,
                "country_slug": "england",
                "country_name": "England"
            },
            "home_team": {
                "slug": "ipswich-town",
                "name": "Ipswich Town",
                "id": 100567
            },
            "away_team": {
                "slug": "liverpool",
                "name": "Liverpool",
                "id": 100521
            },
            "market": {
                "market_code": "CSFT",
                "market_name": "Correct Score Full Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 427,
                        "bet_code": "0-0",
                        "bet_name": "0-0",
                        "odds": 21,
                        "updated": "2024-07-14T21:44:56"
                    },
                    {
                        "id": 428,
                        "bet_code": "0-1",
                        "bet_name": "0-1",
                        "odds": 9.8,
                        "updated": "2024-07-11T02:14:42"
                    },
                    {
                        "id": 429,
                        "bet_code": "0-2",
                        "bet_name": "0-2",
                        "odds": 8.1,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 430,
                        "bet_code": "0-3",
                        "bet_name": "0-3",
                        "odds": 10,
                        "updated": "2024-07-15T09:00:00"
                    },
                    {
                        "id": 431,
                        "bet_code": "0-4",
                        "bet_name": "0-4",
                        "odds": 16.5,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 432,
                        "bet_code": "0-5",
                        "bet_name": "0-5",
                        "odds": 30,
                        "updated": "2024-07-11T02:14:42"
                    },
                    {
                        "id": 433,
                        "bet_code": "1-0",
                        "bet_name": "1-0",
                        "odds": 24,
                        "updated": "2024-07-09T23:14:34"
                    },
                    {
                        "id": 434,
                        "bet_code": "1-1",
                        "bet_name": "1-1",
                        "odds": 10.4,
                        "updated": "2024-07-15T09:00:00"
                    },
                    {
                        "id": 435,
                        "bet_code": "1-2",
                        "bet_name": "1-2",
                        "odds": 8.5,
                        "updated": "2024-07-15T09:00:00"
                    },
                    {
                        "id": 436,
                        "bet_code": "1-3",
                        "bet_name": "1-3",
                        "odds": 10.7,
                        "updated": "2024-07-14T21:44:56"
                    },
                    {
                        "id": 437,
                        "bet_code": "1-4",
                        "bet_name": "1-4",
                        "odds": 18.5,
                        "updated": "2024-07-01T16:31:42"
                    },
                    {
                        "id": 438,
                        "bet_code": "1-5",
                        "bet_name": "1-5",
                        "odds": 29,
                        "updated": "2024-07-11T02:14:42"
                    },
                    {
                        "id": 439,
                        "bet_code": "2-0",
                        "bet_name": "2-0",
                        "odds": 44,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 440,
                        "bet_code": "2-1",
                        "bet_name": "2-1",
                        "odds": 23,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 441,
                        "bet_code": "2-2",
                        "bet_name": "2-2",
                        "odds": 19,
                        "updated": "2024-07-01T16:31:42"
                    },
                    {
                        "id": 442,
                        "bet_code": "2-3",
                        "bet_name": "2-3",
                        "odds": 23,
                        "updated": "2024-07-01T16:31:42"
                    },
                    {
                        "id": 443,
                        "bet_code": "2-4",
                        "bet_name": "2-4",
                        "odds": 36,
                        "updated": "2024-07-14T21:44:56"
                    },
                    {
                        "id": 444,
                        "bet_code": "2-5",
                        "bet_name": "2-5",
                        "odds": 54,
                        "updated": "2024-06-24T05:16:14"
                    },
                    {
                        "id": 445,
                        "bet_code": "3-0",
                        "bet_name": "3-0",
                        "odds": 108,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 446,
                        "bet_code": "3-1",
                        "bet_name": "3-1",
                        "odds": 60,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 447,
                        "bet_code": "3-2",
                        "bet_name": "3-2",
                        "odds": 49,
                        "updated": "2024-07-11T02:14:42"
                    },
                    {
                        "id": 448,
                        "bet_code": "3-3",
                        "bet_name": "3-3",
                        "odds": 58,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 449,
                        "bet_code": "3-4",
                        "bet_name": "3-4",
                        "odds": 84,
                        "updated": "2024-07-11T02:14:42"
                    },
                    {
                        "id": 450,
                        "bet_code": "3-5",
                        "bet_name": "3-5",
                        "odds": 136,
                        "updated": "2024-07-09T09:44:34"
                    },
                    {
                        "id": 451,
                        "bet_code": "4-0",
                        "bet_name": "4-0",
                        "odds": 215,
                        "updated": "2024-07-11T02:14:42"
                    },
                    {
                        "id": 452,
                        "bet_code": "4-1",
                        "bet_name": "4-1",
                        "odds": 182,
                        "updated": "2024-07-11T02:14:42"
                    },
                    {
                        "id": 453,
                        "bet_code": "4-2",
                        "bet_name": "4-2",
                        "odds": 148,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 454,
                        "bet_code": "4-3",
                        "bet_name": "4-3",
                        "odds": 194,
                        "updated": "2024-07-11T02:14:42"
                    },
                    {
                        "id": 455,
                        "bet_code": "4-4",
                        "bet_name": "4-4",
                        "odds": 250,
                        "updated": "2024-07-15T12:45:04"
                    },
                    {
                        "id": 456,
                        "bet_code": "4-5",
                        "bet_name": "4-5",
                        "odds": 420,
                        "updated": "2024-07-02T09:01:47"
                    },
                    {
                        "id": 457,
                        "bet_code": "5-0",
                        "bet_name": "5-0",
                        "odds": 265,
                        "updated": "2024-06-18T15:01:09"
                    },
                    {
                        "id": 458,
                        "bet_code": "5-1",
                        "bet_name": "5-1",
                        "odds": 210,
                        "updated": "2024-06-18T15:01:09"
                    },
                    {
                        "id": 459,
                        "bet_code": "5-2",
                        "bet_name": "5-2",
                        "odds": 320,
                        "updated": "2024-06-18T09:45:57"
                    }
                ]
            }
        }
    ]
}
```


# Superbet


# Get Superbet Cards

Returns the list of available Superbet cards for specific operator.

Returns only 10 earliest cards.

`GET` [https://api.betstack.io/bc/superbets?operator=](https://api.betstack.io/bc/superbets?operator=acme){operator}

&#x20;Response example:

```json
[
    {
        "code": "22299F",
        "operator": "acme",
        "prices": [],
        "stakes": [],
        "ext": 12.5,
        "wht": 20,
        "ext_amounts": [],
        "is_free": true,
        "enabled": true,
        "title": "Cool bet",
        "description": "Superbet description",
        "sitename": null,
        "domain": null,
        "preview_img": null,
        "created": "2024-07-10T05:00:00.205000",
        "operator_time_created": "2024-07-10T07:00:00.205000",
        "expires": "2024-07-17T23:30:00.000000",
        "operator_time_expires": "2024-07-18T01:30:00.000000",
        "event": {
            "id": 290239,
            "starts": "2024-07-17T23:30:00.000000",
            "operator_time_starts": "2024-07-18T01:30:00.000000",
            "category": {
                "league_id": 1638,
                "league_slug": "football/usa/mls",
                "league_name": "MLS",
                "country_id": 1048,
                "country_slug": "usa",
                "country_name": "USA"
            },
            "home_team": {
                "slug": "atlanta-united",
                "name": "Atlanta United",
                "id": 108365
            },
            "away_team": {
                "slug": "new-york-city-fc",
                "name": "New York City FC",
                "id": 108353
            },
            "markets": [
                {
                    "market_code": "FTSFT",
                    "market_name": "First Goal Full Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 1033,
                            "bet_code": "1",
                            "bet_name": "Home",
                            "odds": 1.81,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 1034,
                            "bet_code": "X",
                            "bet_name": "Draw",
                            "odds": 14,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 1035,
                            "bet_code": "2",
                            "bet_name": "Away",
                            "odds": 2.17,
                            "updated": "2024-07-15T12:30:05"
                        }
                    ]
                },
                {
                    "market_code": "CSHT",
                    "market_name": "Correct Score Half Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 464,
                            "bet_code": "0-0",
                            "bet_name": "0-0",
                            "odds": 3.25,
                            "updated": "2024-07-15T02:44:54"
                        },
                        {
                            "id": 465,
                            "bet_code": "0-1",
                            "bet_name": "0-1",
                            "odds": 4.9,
                            "updated": "2024-07-14T03:29:47"
                        },
                        {
                            "id": 466,
                            "bet_code": "0-2",
                            "bet_name": "0-2",
                            "odds": 15,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 467,
                            "bet_code": "0-3",
                            "bet_name": "0-3",
                            "odds": 45,
                            "updated": "2024-07-15T06:30:00"
                        },
                        {
                            "id": 468,
                            "bet_code": "0-4",
                            "bet_name": "0-4",
                            "odds": 102,
                            "updated": "2024-07-15T06:30:00"
                        },
                        {
                            "id": 470,
                            "bet_code": "1-0",
                            "bet_name": "1-0",
                            "odds": 4.2,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 471,
                            "bet_code": "1-1",
                            "bet_name": "1-1",
                            "odds": 6.8,
                            "updated": "2024-07-14T18:29:52"
                        },
                        {
                            "id": 472,
                            "bet_code": "1-2",
                            "bet_name": "1-2",
                            "odds": 20,
                            "updated": "2024-07-14T18:29:52"
                        },
                        {
                            "id": 473,
                            "bet_code": "1-3",
                            "bet_name": "1-3",
                            "odds": 51,
                            "updated": "2024-07-09T12:32:26"
                        },
                        {
                            "id": 474,
                            "bet_code": "1-4",
                            "bet_name": "1-4",
                            "odds": 82,
                            "updated": "2024-07-14T16:59:50"
                        },
                        {
                            "id": 476,
                            "bet_code": "2-0",
                            "bet_name": "2-0",
                            "odds": 10.7,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 477,
                            "bet_code": "2-1",
                            "bet_name": "2-1",
                            "odds": 17,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 478,
                            "bet_code": "2-2",
                            "bet_name": "2-2",
                            "odds": 37,
                            "updated": "2024-07-14T18:29:52"
                        },
                        {
                            "id": 479,
                            "bet_code": "2-3",
                            "bet_name": "2-3",
                            "odds": 85,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 480,
                            "bet_code": "2-4",
                            "bet_name": "2-4",
                            "odds": 500,
                            "updated": "2024-07-09T12:32:26"
                        },
                        {
                            "id": 482,
                            "bet_code": "3-0",
                            "bet_name": "3-0",
                            "odds": 35,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 483,
                            "bet_code": "3-1",
                            "bet_name": "3-1",
                            "odds": 46,
                            "updated": "2024-07-14T16:59:50"
                        },
                        {
                            "id": 484,
                            "bet_code": "3-2",
                            "bet_name": "3-2",
                            "odds": 100,
                            "updated": "2024-07-14T18:29:52"
                        },
                        {
                            "id": 485,
                            "bet_code": "3-3",
                            "bet_name": "3-3",
                            "odds": 215,
                            "updated": "2024-07-14T18:29:52"
                        },
                        {
                            "id": 488,
                            "bet_code": "4-0",
                            "bet_name": "4-0",
                            "odds": 74,
                            "updated": "2024-07-15T06:30:00"
                        },
                        {
                            "id": 489,
                            "bet_code": "4-1",
                            "bet_name": "4-1",
                            "odds": 72,
                            "updated": "2024-07-14T16:59:50"
                        },
                        {
                            "id": 490,
                            "bet_code": "4-2",
                            "bet_name": "4-2",
                            "odds": 500,
                            "updated": "2024-07-09T12:32:26"
                        }
                    ]
                },
                {
                    "market_code": "BTSFT",
                    "market_name": "Both Teams to Score Full Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 84,
                            "bet_code": "Y",
                            "bet_name": "Yes",
                            "odds": 1.53,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 85,
                            "bet_code": "N",
                            "bet_name": "No",
                            "odds": 2.39,
                            "updated": "2024-07-15T02:44:54"
                        }
                    ]
                },
                {
                    "market_code": "HSH",
                    "market_name": "Highest Scoring Half",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 1138,
                            "bet_code": "1",
                            "bet_name": "First",
                            "odds": 2.8,
                            "updated": "2024-07-14T16:59:50"
                        },
                        {
                            "id": 1139,
                            "bet_code": "2",
                            "bet_name": "Second",
                            "odds": 1.84,
                            "updated": "2024-07-14T16:59:50"
                        },
                        {
                            "id": 1140,
                            "bet_code": "E",
                            "bet_name": "Equal",
                            "odds": 3.45,
                            "updated": "2024-07-14T03:29:47"
                        }
                    ]
                },
                {
                    "market_code": "OEFT",
                    "market_name": "Odd/Even Full Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 421,
                            "bet_code": "O",
                            "bet_name": "Odd",
                            "odds": 1.92,
                            "updated": "2024-07-14T19:15:00"
                        },
                        {
                            "id": 422,
                            "bet_code": "E",
                            "bet_name": "Even",
                            "odds": 1.79,
                            "updated": "2024-07-14T19:15:00"
                        }
                    ]
                },
                {
                    "market_code": "CSFT",
                    "market_name": "Correct Score Full Time",
                    "line_code": null,
                    "line_name": null,
                    "bets": [
                        {
                            "id": 427,
                            "bet_code": "0-0",
                            "bet_name": "0-0",
                            "odds": 15,
                            "updated": "2024-07-14T18:29:52"
                        },
                        {
                            "id": 428,
                            "bet_code": "0-1",
                            "bet_name": "0-1",
                            "odds": 12,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 429,
                            "bet_code": "0-2",
                            "bet_name": "0-2",
                            "odds": 18,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 430,
                            "bet_code": "0-3",
                            "bet_name": "0-3",
                            "odds": 34,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 431,
                            "bet_code": "0-4",
                            "bet_name": "0-4",
                            "odds": 57,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 432,
                            "bet_code": "0-5",
                            "bet_name": "0-5",
                            "odds": 123,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 433,
                            "bet_code": "1-0",
                            "bet_name": "1-0",
                            "odds": 10.1,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 434,
                            "bet_code": "1-1",
                            "bet_name": "1-1",
                            "odds": 6.7,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 435,
                            "bet_code": "1-2",
                            "bet_name": "1-2",
                            "odds": 10.3,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 436,
                            "bet_code": "1-3",
                            "bet_name": "1-3",
                            "odds": 21,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 437,
                            "bet_code": "1-4",
                            "bet_name": "1-4",
                            "odds": 41,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 438,
                            "bet_code": "1-5",
                            "bet_name": "1-5",
                            "odds": 103,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 439,
                            "bet_code": "2-0",
                            "bet_name": "2-0",
                            "odds": 12.7,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 440,
                            "bet_code": "2-1",
                            "bet_name": "2-1",
                            "odds": 8.69,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 441,
                            "bet_code": "2-2",
                            "bet_name": "2-2",
                            "odds": 11,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 442,
                            "bet_code": "2-3",
                            "bet_name": "2-3",
                            "odds": 25,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 443,
                            "bet_code": "2-4",
                            "bet_name": "2-4",
                            "odds": 48,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 444,
                            "bet_code": "2-5",
                            "bet_name": "2-5",
                            "odds": 104,
                            "updated": "2024-07-15T06:30:00"
                        },
                        {
                            "id": 445,
                            "bet_code": "3-0",
                            "bet_name": "3-0",
                            "odds": 22,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 446,
                            "bet_code": "3-1",
                            "bet_name": "3-1",
                            "odds": 16,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 447,
                            "bet_code": "3-2",
                            "bet_name": "3-2",
                            "odds": 20,
                            "updated": "2024-07-14T19:15:00"
                        },
                        {
                            "id": 448,
                            "bet_code": "3-3",
                            "bet_name": "3-3",
                            "odds": 35,
                            "updated": "2024-07-14T18:29:52"
                        },
                        {
                            "id": 449,
                            "bet_code": "3-4",
                            "bet_name": "3-4",
                            "odds": 77,
                            "updated": "2024-07-15T06:30:00"
                        },
                        {
                            "id": 450,
                            "bet_code": "3-5",
                            "bet_name": "3-5",
                            "odds": 205,
                            "updated": "2024-07-09T12:32:26"
                        },
                        {
                            "id": 451,
                            "bet_code": "4-0",
                            "bet_name": "4-0",
                            "odds": 38,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 452,
                            "bet_code": "4-1",
                            "bet_name": "4-1",
                            "odds": 31,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 453,
                            "bet_code": "4-2",
                            "bet_name": "4-2",
                            "odds": 38,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 454,
                            "bet_code": "4-3",
                            "bet_name": "4-3",
                            "odds": 62,
                            "updated": "2024-07-14T16:59:50"
                        },
                        {
                            "id": 455,
                            "bet_code": "4-4",
                            "bet_name": "4-4",
                            "odds": 104,
                            "updated": "2024-07-14T16:59:50"
                        },
                        {
                            "id": 457,
                            "bet_code": "5-0",
                            "bet_name": "5-0",
                            "odds": 80,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 458,
                            "bet_code": "5-1",
                            "bet_name": "5-1",
                            "odds": 64,
                            "updated": "2024-07-15T12:30:05"
                        },
                        {
                            "id": 459,
                            "bet_code": "5-2",
                            "bet_name": "5-2",
                            "odds": 88,
                            "updated": "2024-07-15T08:00:01"
                        },
                        {
                            "id": 460,
                            "bet_code": "5-3",
                            "bet_name": "5-3",
                            "odds": 155,
                            "updated": "2024-07-09T12:32:26"
                        },
                        {
                            "id": 461,
                            "bet_code": "5-4",
                            "bet_name": "5-4",
                            "odds": 410,
                            "updated": "2024-07-09T12:32:26"
                        }
                    ]
                }
            ]
        }
    }
]
```


# Get Superbet Card by code

Returns Superbet card by specified code

`GET` [https://api.betstack.io/bc/superbets/](https://api.betstack.io/bc/superbets/DEL001){code}

Response example:

```json
{
    "code": "22299F",
    "operator": "acme",
    "prices": [],
    "stakes": [],
    "ext": 12.5,
    "wht": 20,
    "ext_amounts": [],
    "is_free": true,
    "enabled": true,
    "title": "Cool bet",
    "description": "Superbet description",
    "sitename": null,
    "domain": null,
    "preview_img": null,
    "created": "2024-07-10T05:00:00.205000",
    "operator_time_created": "2024-07-10T07:00:00.205000",
    "expires": "2024-07-17T23:30:00.000000",
    "operator_time_expires": "2024-07-18T01:30:00.000000",
    "event": {
        "id": 290239,
        "starts": "2024-07-17T23:30:00.000000",
        "operator_time_starts": "2024-07-18T01:30:00.000000",
        "category": {
            "league_id": 1638,
            "league_slug": "football/usa/mls",
            "league_name": "MLS",
            "country_id": 1048,
            "country_slug": "usa",
            "country_name": "USA"
        },
        "home_team": {
            "slug": "atlanta-united",
            "name": "Atlanta United",
            "id": 108365
        },
        "away_team": {
            "slug": "new-york-city-fc",
            "name": "New York City FC",
            "id": 108353
        },
        "markets": [
            {
                "market_code": "FTSFT",
                "market_name": "First Goal Full Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 1033,
                        "bet_code": "1",
                        "bet_name": "Home",
                        "odds": 1.81,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 1034,
                        "bet_code": "X",
                        "bet_name": "Draw",
                        "odds": 14,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 1035,
                        "bet_code": "2",
                        "bet_name": "Away",
                        "odds": 2.17,
                        "updated": "2024-07-15T12:30:05"
                    }
                ]
            },
            {
                "market_code": "CSHT",
                "market_name": "Correct Score Half Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 464,
                        "bet_code": "0-0",
                        "bet_name": "0-0",
                        "odds": 3.25,
                        "updated": "2024-07-15T02:44:54"
                    },
                    {
                        "id": 465,
                        "bet_code": "0-1",
                        "bet_name": "0-1",
                        "odds": 4.9,
                        "updated": "2024-07-14T03:29:47"
                    },
                    {
                        "id": 466,
                        "bet_code": "0-2",
                        "bet_name": "0-2",
                        "odds": 15,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 467,
                        "bet_code": "0-3",
                        "bet_name": "0-3",
                        "odds": 45,
                        "updated": "2024-07-15T06:30:00"
                    },
                    {
                        "id": 468,
                        "bet_code": "0-4",
                        "bet_name": "0-4",
                        "odds": 102,
                        "updated": "2024-07-15T06:30:00"
                    },
                    {
                        "id": 470,
                        "bet_code": "1-0",
                        "bet_name": "1-0",
                        "odds": 4.2,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 471,
                        "bet_code": "1-1",
                        "bet_name": "1-1",
                        "odds": 6.8,
                        "updated": "2024-07-14T18:29:52"
                    },
                    {
                        "id": 472,
                        "bet_code": "1-2",
                        "bet_name": "1-2",
                        "odds": 20,
                        "updated": "2024-07-14T18:29:52"
                    },
                    {
                        "id": 473,
                        "bet_code": "1-3",
                        "bet_name": "1-3",
                        "odds": 51,
                        "updated": "2024-07-09T12:32:26"
                    },
                    {
                        "id": 474,
                        "bet_code": "1-4",
                        "bet_name": "1-4",
                        "odds": 82,
                        "updated": "2024-07-14T16:59:50"
                    },
                    {
                        "id": 476,
                        "bet_code": "2-0",
                        "bet_name": "2-0",
                        "odds": 10.7,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 477,
                        "bet_code": "2-1",
                        "bet_name": "2-1",
                        "odds": 17,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 478,
                        "bet_code": "2-2",
                        "bet_name": "2-2",
                        "odds": 37,
                        "updated": "2024-07-14T18:29:52"
                    },
                    {
                        "id": 479,
                        "bet_code": "2-3",
                        "bet_name": "2-3",
                        "odds": 85,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 480,
                        "bet_code": "2-4",
                        "bet_name": "2-4",
                        "odds": 500,
                        "updated": "2024-07-09T12:32:26"
                    },
                    {
                        "id": 482,
                        "bet_code": "3-0",
                        "bet_name": "3-0",
                        "odds": 35,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 483,
                        "bet_code": "3-1",
                        "bet_name": "3-1",
                        "odds": 46,
                        "updated": "2024-07-14T16:59:50"
                    },
                    {
                        "id": 484,
                        "bet_code": "3-2",
                        "bet_name": "3-2",
                        "odds": 100,
                        "updated": "2024-07-14T18:29:52"
                    },
                    {
                        "id": 485,
                        "bet_code": "3-3",
                        "bet_name": "3-3",
                        "odds": 215,
                        "updated": "2024-07-14T18:29:52"
                    },
                    {
                        "id": 488,
                        "bet_code": "4-0",
                        "bet_name": "4-0",
                        "odds": 74,
                        "updated": "2024-07-15T06:30:00"
                    },
                    {
                        "id": 489,
                        "bet_code": "4-1",
                        "bet_name": "4-1",
                        "odds": 72,
                        "updated": "2024-07-14T16:59:50"
                    },
                    {
                        "id": 490,
                        "bet_code": "4-2",
                        "bet_name": "4-2",
                        "odds": 500,
                        "updated": "2024-07-09T12:32:26"
                    }
                ]
            },
            {
                "market_code": "BTSFT",
                "market_name": "Both Teams to Score Full Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 84,
                        "bet_code": "Y",
                        "bet_name": "Yes",
                        "odds": 1.53,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 85,
                        "bet_code": "N",
                        "bet_name": "No",
                        "odds": 2.39,
                        "updated": "2024-07-15T02:44:54"
                    }
                ]
            },
            {
                "market_code": "HSH",
                "market_name": "Highest Scoring Half",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 1138,
                        "bet_code": "1",
                        "bet_name": "First",
                        "odds": 2.8,
                        "updated": "2024-07-14T16:59:50"
                    },
                    {
                        "id": 1139,
                        "bet_code": "2",
                        "bet_name": "Second",
                        "odds": 1.84,
                        "updated": "2024-07-14T16:59:50"
                    },
                    {
                        "id": 1140,
                        "bet_code": "E",
                        "bet_name": "Equal",
                        "odds": 3.45,
                        "updated": "2024-07-14T03:29:47"
                    }
                ]
            },
            {
                "market_code": "OEFT",
                "market_name": "Odd/Even Full Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 421,
                        "bet_code": "O",
                        "bet_name": "Odd",
                        "odds": 1.92,
                        "updated": "2024-07-14T19:15:00"
                    },
                    {
                        "id": 422,
                        "bet_code": "E",
                        "bet_name": "Even",
                        "odds": 1.79,
                        "updated": "2024-07-14T19:15:00"
                    }
                ]
            },
            {
                "market_code": "CSFT",
                "market_name": "Correct Score Full Time",
                "line_code": null,
                "line_name": null,
                "bets": [
                    {
                        "id": 427,
                        "bet_code": "0-0",
                        "bet_name": "0-0",
                        "odds": 15,
                        "updated": "2024-07-14T18:29:52"
                    },
                    {
                        "id": 428,
                        "bet_code": "0-1",
                        "bet_name": "0-1",
                        "odds": 12,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 429,
                        "bet_code": "0-2",
                        "bet_name": "0-2",
                        "odds": 18,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 430,
                        "bet_code": "0-3",
                        "bet_name": "0-3",
                        "odds": 34,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 431,
                        "bet_code": "0-4",
                        "bet_name": "0-4",
                        "odds": 57,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 432,
                        "bet_code": "0-5",
                        "bet_name": "0-5",
                        "odds": 123,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 433,
                        "bet_code": "1-0",
                        "bet_name": "1-0",
                        "odds": 10.1,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 434,
                        "bet_code": "1-1",
                        "bet_name": "1-1",
                        "odds": 6.7,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 435,
                        "bet_code": "1-2",
                        "bet_name": "1-2",
                        "odds": 10.3,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 436,
                        "bet_code": "1-3",
                        "bet_name": "1-3",
                        "odds": 21,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 437,
                        "bet_code": "1-4",
                        "bet_name": "1-4",
                        "odds": 41,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 438,
                        "bet_code": "1-5",
                        "bet_name": "1-5",
                        "odds": 103,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 439,
                        "bet_code": "2-0",
                        "bet_name": "2-0",
                        "odds": 12.7,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 440,
                        "bet_code": "2-1",
                        "bet_name": "2-1",
                        "odds": 8.69,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 441,
                        "bet_code": "2-2",
                        "bet_name": "2-2",
                        "odds": 11,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 442,
                        "bet_code": "2-3",
                        "bet_name": "2-3",
                        "odds": 25,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 443,
                        "bet_code": "2-4",
                        "bet_name": "2-4",
                        "odds": 48,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 444,
                        "bet_code": "2-5",
                        "bet_name": "2-5",
                        "odds": 104,
                        "updated": "2024-07-15T06:30:00"
                    },
                    {
                        "id": 445,
                        "bet_code": "3-0",
                        "bet_name": "3-0",
                        "odds": 22,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 446,
                        "bet_code": "3-1",
                        "bet_name": "3-1",
                        "odds": 16,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 447,
                        "bet_code": "3-2",
                        "bet_name": "3-2",
                        "odds": 20,
                        "updated": "2024-07-14T19:15:00"
                    },
                    {
                        "id": 448,
                        "bet_code": "3-3",
                        "bet_name": "3-3",
                        "odds": 35,
                        "updated": "2024-07-14T18:29:52"
                    },
                    {
                        "id": 449,
                        "bet_code": "3-4",
                        "bet_name": "3-4",
                        "odds": 77,
                        "updated": "2024-07-15T06:30:00"
                    },
                    {
                        "id": 450,
                        "bet_code": "3-5",
                        "bet_name": "3-5",
                        "odds": 205,
                        "updated": "2024-07-09T12:32:26"
                    },
                    {
                        "id": 451,
                        "bet_code": "4-0",
                        "bet_name": "4-0",
                        "odds": 38,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 452,
                        "bet_code": "4-1",
                        "bet_name": "4-1",
                        "odds": 31,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 453,
                        "bet_code": "4-2",
                        "bet_name": "4-2",
                        "odds": 38,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 454,
                        "bet_code": "4-3",
                        "bet_name": "4-3",
                        "odds": 62,
                        "updated": "2024-07-14T16:59:50"
                    },
                    {
                        "id": 455,
                        "bet_code": "4-4",
                        "bet_name": "4-4",
                        "odds": 104,
                        "updated": "2024-07-14T16:59:50"
                    },
                    {
                        "id": 457,
                        "bet_code": "5-0",
                        "bet_name": "5-0",
                        "odds": 80,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 458,
                        "bet_code": "5-1",
                        "bet_name": "5-1",
                        "odds": 64,
                        "updated": "2024-07-15T12:30:05"
                    },
                    {
                        "id": 459,
                        "bet_code": "5-2",
                        "bet_name": "5-2",
                        "odds": 88,
                        "updated": "2024-07-15T08:00:01"
                    },
                    {
                        "id": 460,
                        "bet_code": "5-3",
                        "bet_name": "5-3",
                        "odds": 155,
                        "updated": "2024-07-09T12:32:26"
                    },
                    {
                        "id": 461,
                        "bet_code": "5-4",
                        "bet_name": "5-4",
                        "odds": 410,
                        "updated": "2024-07-09T12:32:26"
                    }
                ]
            }
        ]
    }
}
```

If the card with specified code was not found error response is returned with status code `400`

```
{
  "code": 102,
  "message": "Betcard `B57AFBa` was not found"
}
```

If the card is expired an error response is returned with status code `400`

```
{
  "code": 103,
  "message": "Betcard `C3E370` expired"
}
```


# Referral


# Encrypt rtag

GET \`bc/referral/encrypt\` endpoint

Encrypts `rtag` value.

Query parameters:

<table><thead><tr><th>Parameter name</th><th width="175">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Operator name. For example, for operator <code>acme</code> the value should be <code>operator=acme</code></td></tr><tr><td>rtag</td><td>string</td><td><code>rtag</code> value</td></tr></tbody></table>

Response example:

```json
{
    "rtag": "MzgwMjIxMjM0NTY3"
}
```


# Telegram deep link

GET \`bc/referral/tg-deep-link\` endpoint

Created valid telegram deep link

Query parameters:

<table><thead><tr><th>Parameter name</th><th width="175">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Operator name. For example, for operator <code>acme</code> the value should be <code>operator=acme</code></td></tr><tr><td>rtag</td><td>string</td><td><code>rtag</code> value</td></tr><tr><td>betcard_code</td><td>string</td><td>Code of the betcard which was used for ticket creation</td></tr></tbody></table>

Response example:

```json
{
    "link": "https://t.me/bot_name?start=Yj1DT0RFMTImYXRhZz1Nemd3TWpJeE1qTTBOVFkz"
}
```


# Bet Engine API

Bet Engine service is called for ticket processing

API Endpoint : <https://api.betstack.io/be/>

Bet Engine service is responsible for processing the tickets. When tickets are submitted to Bet Engine, the service will invoke PAM API for integration with operator's platform.&#x20;

The following sections are available in Bet Engine API:

[Headers](/bet-engine-api/headers)

[Create ticket endpoint](/bet-engine-api/create-ticket-endpoint)

[Reserve ticket endpoint](/bet-engine-api/reserve-ticket-endpoint)

[Paid ticket endpoint](/bet-engine-api/paid-ticket-endpoint)

[Get ticket endpoint](/bet-engine-api/get-ticket-endpoint)

[Get ticket list endpoint](/bet-engine-api/get-ticket-list-endpoint)

[Fields](/bet-engine-api/fields)

[Error codes](/bet-engine-api/error-codes)


# Headers

Access to Bet Engine API is authorized by the request headers. Please take timestamp and operator name and generate your request signature as described in [Signature](/signature)

Headers

<table><thead><tr><th width="186">Attribute</th><th width="536">Description</th></tr></thead><tbody><tr><td><code>timestamp</code></td><td>The unix time stamp</td></tr><tr><td><code>operator-name</code></td><td>Operator Name</td></tr><tr><td><code>signature</code></td><td>Signature of incoming request body and secret key (HMAC)</td></tr><tr><td></td><td></td></tr></tbody></table>


# Create ticket endpoint

POST \`/be/tickets\` endpoint

Currently we support 6 ticket types:

Details for creating `quicktip` ticket type are here - [Quicktip](/bet-engine-api/create-ticket-endpoint/quicktip)

Details for creating `smartbet` ticket type are here - [Smartbet](/bet-engine-api/create-ticket-endpoint/smartbet)

Details for creating `quickbet` ticket type are here - [Quickbet](/bet-engine-api/create-ticket-endpoint/quickbet)

Details for creating `quickbetx` ticket type are here - [QuickbetX](/bet-engine-api/create-ticket-endpoint/quickbetx)

Details for creating `superbet` ticket type are here - [Superbet](/bet-engine-api/create-ticket-endpoint/superbet)

Details for creating `jackpot` ticket type are here - [Jackpot](/bet-engine-api/create-ticket-endpoint/jackpot)


# Quicktip

POST \`/be/tickets\` endpoint

Create quicktip ticket.

Request fields:

<table><thead><tr><th width="168">Attribute</th><th width="176">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>token</td><td>string</td><td>Player identification token</td></tr><tr><td>psp</td><td>string or null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>quicktip</code></td></tr><tr><td>odds_diff</td><td>float</td><td><p>Specifies the max odds deviation when we still accept the request and create the ticket. </p><p>When the value is set to zero it means we don't allow any odds difference during ticket creation and will respond with "Ticket odds changed" Error response</p></td></tr><tr><td>events</td><td>list of objects</td><td></td></tr><tr><td>events id</td><td>integer</td><td>Event id</td></tr><tr><td>events bet</td><td>integer</td><td>Event bet id</td></tr><tr><td>events odds</td><td>float</td><td>Event odds at time of ticket submission. Should be in decimal format with 2 digits after comma</td></tr></tbody></table>

Sample request to create `quicktip` ticket:

```json
{
    "operator": "site",
    "token": "sGhx12skwrXsukbZmWh7bkCC9YPEzYQKtKSe9EfCth3Q",
    "psp": "mobile",
    "price": 1800,
    "currency": "KES",
    "atag": null,
    "rtag": "jr4hr54nrjk4jr",
    "source": "mobile",
    "type": "quicktip",
    "odds_diff": 0.7,
    "events": [
        {"id": 390815, "bet": 101, "odds": 1.55},
        {"id": 391814, "bet": 105, "odds": 1.5}
    ]
}
```

Response fields:

<table><thead><tr><th width="224">Attribute</th><th width="122">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Ticket id</td></tr><tr><td>code</td><td>string</td><td>Ticket code</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>quicktip</code></td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>float or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>User ID from PAM</td></tr><tr><td>psp</td><td>psp</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_created</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>odds</td><td>float</td><td>Product of odds for all events for ticket</td></tr></tbody></table>

Sample response (status=200) to `quickbet` ticket:

```json
{
    "id": "66902407b36bfcbd59569738",
    "code": "B66A95",
    "price": 500,
    "stake": 444,
    "currency": "USD",
    "gross_payout": 2842,
    "net_payout": 2602,
    "wht_amount": 240,
    "wht": 10.0,
    "ext_amount": 56,
    "ext": 12.5,
    "ext_type": "inclusive",
    "status": "open",
    "result": "pending",
    "approved": true,
    "source": "desktop",
    "type": "quicktip",
    "atag": null,
    "rtag": "jr4hr54nrjk4jr",
    "aff_instant_comm_amt": null,
    "aff_instant_comm_pct": null,
    "user_id": "sometokenvalue",
    "psp": "mobile",
    "created": "2024-07-11T18:27:19.335000",
    "operator_time_created": "2024-07-11T20:27:19.335000",
    "updated": "2024-07-11T18:27:19.358000",
    "operator_time_updated": "2024-07-11T20:27:19.358000",
    "odds": 6.4
}
```

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr><tr><td>422</td><td>Validation Error. Please check response body for more details</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 103,
    "message": "Event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 104,
    "message": "Events list in ticket object can't be empty"
}
```

Error response (status=400):

```json
{
    "code": 105,
    "message": "Team with `{team-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 106,
    "message": "Market for bet with `{market-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 107,
    "message": "Event with `{event-id}` identifier is not available for play because it has already started"
}
```

Error response (status=400):

```json
{
    "code": 108,
    "message": "Bookmaker event for event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 109,
    "message": "Market is blocked"
}
```

Error response (status=400):

```json
{
    "code": 110,
    "message": "Ticket odds changed"
}
```

Error response (status=400):

```json
{
    "code": 111,
    "message": "Duplicate key for code generation"
}
```

Error response (status=400):

```json
{
    "code": 112,
    "message": "Operator with `{operator-id}` name is not found"
}
```

Error response (status=400):

```json
{
    "code": 114,
    "message": "No webhook url for operator with `{operator-id}` name"
}
```

Error response (status=400):

```json
{
    "code": 115,
    "message": "Operators in request body and in request header are not identical"
}
```


# Smartbet

POST \`/be/tickets\` endpoint

Create smartbet ticket.

All request and response fields are the same as in [Quicktip](/bet-engine-api/create-ticket-endpoint/quicktip) ticket except ticket type must be `smartbet`.


# Quickbet

POST \`/be/tickets\` endpoint

Create quickbet ticket.

All request and response fields are the same as in [Quicktip](/bet-engine-api/create-ticket-endpoint/quicktip) ticket except ticket type must be `quickbet`.


# QuickbetX

POST \`/be/tickets\` endpoint

Create quickbetx ticket.

All request and response fields are the same as in [Quicktip](/bet-engine-api/create-ticket-endpoint/quicktip) ticket except ticket type must be `quickbetx`.


# Superbet

POST \`/be/tickets\` endpoint

Create superbet ticket.

Request fields:

<table><thead><tr><th width="145">Attribute</th><th width="139">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>token</td><td>string</td><td>Player identification token</td></tr><tr><td>psp</td><td>string or null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>superbet</code> Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>event</td><td>integer</td><td>Event id</td></tr><tr><td>bets</td><td>list of integers</td><td>Each element is event bet id</td></tr></tbody></table>

Sample request to create `superbet` ticket:

```json
{
    "operator": "site",
    "token": "sGhx12skwrXsukbZmWh7bkCC9YPEzYQKtKSe9EfCth3Q",
    "psp": "mobile",
    "price": 2000,
    "currency": "KES",
    "atag": "affiliate-1",
    "rtag": null,
    "source": "mobile",
    "type": "superbet",
    "event": 100001,
    "bets": [101, 102, 103, 104, 105, 106]
}
```

Response fields:

<table><thead><tr><th width="223">Attribute</th><th width="122">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Ticket id</td></tr><tr><td>code</td><td>string</td><td>Ticket code</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). Will always be <code>0</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). Will always be <code>0</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). Will always be <code>0</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>superbet</code> Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>float or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>User ID from PAM</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_created</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr></tbody></table>

Sample response (status=200) to `superbet` ticket:

```json
{
    "id": "66902528085ccefbabb9ac9b",
    "code": "B6226E",
    "price": 2000,
    "stake": 1778,
    "gross_payout": 0,
    "net_payout": 0,
    "wht_amount": 0,
    "wht": 10.0,
    "ext_amount": 222,
    "ext": 12.5,
    "ext_type": "inclusive",
    "currency": "USD",
    "status": "open",
    "result": "pending",
    "approved": true,
    "source": "desktop",
    "type": "superbet",
    "atag": "affiliate-1",
    "rtag": null,
    "aff_instant_comm_amt": 356,
    "aff_instant_comm_pct": 20,
    "user_id": "sometokenvalue",
    "created": "2024-07-11T18:32:08.216000",
    "operator_time_created": "2024-07-11T20:32:08.216000",
    "updated": "2024-07-11T18:32:08.236000",
    "operator_time_updated": "2024-07-11T20:32:08.236000"
}
```

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr><tr><td>422</td><td>Validation Error. Please check response body for more details</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 103,
    "message": "Event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 105,
    "message": "Team with `{team-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 106,
    "message": "Market for bet with `{market-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 107,
    "message": "Event with `{event-id}` identifier is not available for play because it has already started"
}
```

Error response (status=400):

```json
{
    "code": 111,
    "message": "Duplicate key for code generation"
}
```

Error response (status=400):

```json
{
    "code": 112,
    "message": "Operator with `{operator-id}` name is not found"
}
```

Error response (status=400):

```json
{
    "code": 114,
    "message": "No webhook url for operator with `{operator-id}` name"
}
```

Error response (status=400):

```json
{
    "code": 115,
    "message": "Operators in request body and in request header are not identical"
}
```

Error response (status=400):

```json
{
    "code": 116,
    "message": "Market with `{market-id}` code is not allowed"
}
```


# Jackpot

POST \`/be/tickets\` endpoint

Create jackpot ticket.

Request fields:

<table><thead><tr><th width="168">Attribute</th><th width="176">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>token</td><td>string</td><td>Player identification token</td></tr><tr><td>psp</td><td>string or null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>jackpot</code></td></tr><tr><td>odds_diff</td><td>float</td><td><p>Specifies the max odds deviation when we still accept the request and create the ticket. </p><p>When the value is set to zero it means we don't allow any odds difference during ticket creation and will respond with "Ticket odds changed" Error response</p></td></tr><tr><td>events</td><td>list of objects</td><td></td></tr><tr><td>events id</td><td>integer</td><td>Event id</td></tr><tr><td>events bet</td><td>integer</td><td>Event bet id</td></tr><tr><td>events odds</td><td>float</td><td>Event odds at time of ticket submission. Should be in decimal format with 2 digits after comma</td></tr><tr><td>betcard_code</td><td>string</td><td>Betcard code</td></tr><tr><td>prize</td><td>integer</td><td>Betcard prize</td></tr><tr><td>bonus_prizes</td><td>list of integers</td><td>Betcard bonus prizes</td></tr></tbody></table>

Sample request to create `jackpot` ticket:

```json
{
    "operator": "acme",
    "token": "sometokenvalue",
    "psp": "mobile",
    "price": 500,
    "currency": "USD",
    "atag": null,
    "rtag": "rk4rk4krnk3nrl3",
    "source": "desktop",
    "type": "jackpot",
    "odds_diff": 10.5,
    "events": [
        {
            "id": 265825,
            "bet": 14,
            "odds": 2.55
        },
        {
            "id": 265826,
            "bet": 34,
            "odds": 3.62
        },
        {
            "id": 265827,
            "bet": 22,
            "odds": 1.55
        },
        {
            "id": 265828,
            "bet": 83,
            "odds": 2.11
        },
        {
            "id": 265829,
            "bet": 66,
            "odds": 5.1
        },
        {
            "id": 265830,
            "bet": 25,
            "odds": 1.78
        }
    ],
    "betcard_code": "ABC123",
    "prize": 10000,
    "bonus_prizes": [
        2000,
        1500,
        1000
    ]
}
```

Response fields:

<table><thead><tr><th width="224">Attribute</th><th width="122">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Ticket id</td></tr><tr><td>code</td><td>string</td><td>Ticket code</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>jackpot</code></td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_create</code> PAM API call.</td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>float or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>User ID from PAM</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_created</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>odds</td><td>float</td><td>Product of odds for all events for ticket</td></tr><tr><td>betcard_code</td><td>string</td><td>Betcard code</td></tr><tr><td>prize</td><td>integer</td><td>Betcard prize</td></tr><tr><td>bonus_prizes</td><td>list of integers</td><td>Betcard bonus prizes</td></tr></tbody></table>

Sample response (status=200) to `jackpot` ticket:

```json
{
    "id": "66e38e2760b915970f42fa85",
    "code": "B5D096",
    "price": 500,
    "stake": 444,
    "currency": "USD",
    "gross_payout": 0,
    "net_payout": 0,
    "wht_amount": 0,
    "wht": 10.0,
    "ext_amount": 56,
    "ext": 12.5,
    "ext_type": "inclusive",
    "status": "open",
    "result": "pending",
    "approved": true,
    "source": "desktop",
    "type": "jackpot",
    "atag": null,
    "rtag": "rk4rk4krnk3nrl3",
    "aff_instant_comm_amt": null,
    "aff_instant_comm_pct": null,
    "user_id": "sometokenvalue",
    "psp": "mobile",
    "created": "2024-09-13T00:58:15.595000",
    "operator_time_created": "2024-09-13T03:58:15.595000",
    "updated": "2024-09-13T00:58:15.614000",
    "operator_time_updated": "2024-09-13T03:58:15.614000",
    "odds": 32.77,
    "betcard_code": "ABC123",
    "prize": 10000,
    "bonus_prizes": [
        2000,
        1500,
        1000
    ]
}
```

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr><tr><td>422</td><td>Validation Error. Please check response body for more details</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 103,
    "message": "Event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 104,
    "message": "Events list in ticket object can't be empty"
}
```

Error response (status=400):

```json
{
    "code": 105,
    "message": "Team with `{team-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 106,
    "message": "Market for bet with `{market-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 107,
    "message": "Event with `{event-id}` identifier is not available for play because it has already started"
}
```

Error response (status=400):

```json
{
    "code": 108,
    "message": "Bookmaker event for event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 109,
    "message": "Market is blocked"
}
```

Error response (status=400):

```json
{
    "code": 110,
    "message": "Ticket odds changed"
}
```

Error response (status=400):

```json
{
    "code": 111,
    "message": "Duplicate key for code generation"
}
```

Error response (status=400):

```json
{
    "code": 112,
    "message": "Operator with `{operator-id}` name is not found"
}
```

Error response (status=400):

```json
{
    "code": 114,
    "message": "No webhook url for operator with `{operator-id}` name"
}
```

Error response (status=400):

```json
{
    "code": 115,
    "message": "Operators in request body and in request header are not identical"
}
```

Error response (status=400):

```json
{
    "code": 118,
    "message": "Events list must contain at least {correct_amount} items."
}
```


# Reserve ticket endpoint

POST \`/be/tickets/reserve\` endpoint

Currently we support 6 ticket types:

Details for reserving `quicktip` ticket type are here - [Quicktip](/bet-engine-api/reserve-ticket-endpoint/quicktip)

Details for reserving `smartbet` ticket type are here - [Smartbet](/bet-engine-api/reserve-ticket-endpoint/smartbet)

Details for reserving `quickbet` ticket type are here - [Quickbet](/bet-engine-api/reserve-ticket-endpoint/quickbet)

Details for reserving `quickbetx` ticket type are here - [QuickbetX](/bet-engine-api/reserve-ticket-endpoint/quickbetx)

Details for reserving `superbet` ticket type are here - [Superbet](/bet-engine-api/reserve-ticket-endpoint/superbet)

Details for reserving `jackpot` ticket type are here - [Jackpot](/bet-engine-api/reserve-ticket-endpoint/jackpot)


# Quicktip

POST \`/be/tickets/reserve\` endpoint

Reserve quicktip ticket.

Request fields:

<table><thead><tr><th width="168">Attribute</th><th width="176">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>token</td><td>string</td><td>Player identification token</td></tr><tr><td>psp</td><td>string or null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>quicktip</code></td></tr><tr><td>odds_diff</td><td>float</td><td><p>Specifies the max odds deviation when we still accept the request and create the ticket. </p><p>When the value is set to zero it means we don't allow any odds difference during ticket creation and will respond with "Ticket odds changed" Error response</p></td></tr><tr><td>events</td><td>list of objects</td><td></td></tr><tr><td>events id</td><td>integer</td><td>Event id</td></tr><tr><td>events bet</td><td>integer</td><td>Event bet id</td></tr><tr><td>events odds</td><td>float</td><td>Event odds at time of ticket submission. Should be in decimal format with 2 digits after comma</td></tr></tbody></table>

Sample request to reserve `quickbet` ticket:

```json
{
    "operator": "site",
    "token": "sGhx12skwrXsukbZmWh7bkCC9YPEzYQKtKSe9EfCth3Q",
    "psp": "mobile",
    "price": 2000,
    "currency": "KES",
    "atag": "affiliate-1",
    "atag": null,
    "source": "mobile",
    "type": "quicktip",
    "odds_diff": 0.7,
    "events": [
        {"id": 390815, "bet": 101, "odds": 1.55},
        {"id": 391814, "bet": 105, "odds": 1.5}
    ]
}
```

Response fields:

<table><thead><tr><th width="228">Attribute</th><th width="122">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Ticket id</td></tr><tr><td>code</td><td>string</td><td>Ticket code</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>quicktip</code></td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>int or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>User ID from PAM</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_created</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>odds</td><td>float</td><td>Product of odds for all events for ticket</td></tr></tbody></table>

Sample response (status=200) to `quickbet` ticket:

```json
{
    "id": "66902628beba20ff2df5c79e",
    "code": "D39163",
    "price": 500,
    "stake": 444,
    "currency": "USD",
    "gross_payout": 2842,
    "net_payout": 2602,
    "wht_amount": 240,
    "wht": 10.0,
    "ext_amount": 56,
    "ext": 12.5,
    "ext_type": "inclusive",
    "status": "reserved",
    "result": "pending",
    "approved": true,
    "source": "desktop",
    "type": "quicktip",
    "atag": "atag_value",
    "rtag": null,
    "aff_instant_comm_amt": null,
    "aff_instant_comm_pct": null,
    "user_id": "sometokenvalue",
    "psp": "mobile",
    "created": "2024-07-11T18:36:24.486000",
    "operator_time_created": "2024-07-11T20:36:24.486000",
    "updated": "2024-07-11T18:36:24.503000",
    "operator_time_updated": "2024-07-11T20:36:24.503000",
    "odds": 6.4
}
```

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr><tr><td>422</td><td>Validation Error. Please check response body for more details</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 103,
    "message": "Event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 104,
    "message": "Events list in ticket object can't be empty"
}
```

Error response (status=400):

```json
{
    "code": 105,
    "message": "Team with `{team-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 106,
    "message": "Market for bet with `{market-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 107,
    "message": "Event with `{event-id}` identifier is not available for play because it has already started"
}
```

Error response (status=400):

```json
{
    "code": 108,
    "message": "Bookmaker event for event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 109,
    "message": "Market is blocked"
}
```

Error response (status=400):

```json
{
    "code": 110,
    "message": "Ticket odds changed"
}
```

Error response (status=400):

```json
{
    "code": 111,
    "message": "Duplicate key for code generation"
}
```

Error response (status=400):

```json
{
    "code": 112,
    "message": "Operator with `{operator-id}` name is not found"
}
```

Error response (status=400):

```json
{
    "code": 114,
    "message": "No webhook url for operator with `{operator-id}` name"
}
```

Error response (status=400):

```json
{
    "code": 115,
    "message": "Operators in request body and in request header are not identical"
}
```


# Smartbet

POST \`/be/tickets/reserve\` endpoint

Reserve smartbet ticket.

All request and response fields are the same as in [Quicktip](/bet-engine-api/reserve-ticket-endpoint/quicktip) ticket except ticket type must be `smartbet`.


# Quickbet

POST \`/be/tickets/reserve\` endpoint

Reserve quickbet ticket.

All request and response fields are the same as in [Quicktip](/bet-engine-api/reserve-ticket-endpoint/quicktip) ticket except ticket type must be `quickbet`.


# QuickbetX

POST \`/be/tickets/reserve\` endpoint

Reserve quickbetx ticket.

All request and response fields are the same as in [Quicktip](/bet-engine-api/reserve-ticket-endpoint/quicktip) ticket except ticket type must be `quickbetx`.


# Superbet

POST \`/be/tickets/reserve\` endpoint

Reserve superbet ticket.

Request fields:

<table><thead><tr><th width="145">Attribute</th><th width="139">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>token</td><td>string</td><td>Player identification token</td></tr><tr><td>psp</td><td>string or null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>superbet</code> Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>event</td><td>integer</td><td>Event id</td></tr><tr><td>bets</td><td>list of integers</td><td>Each element is event bet id</td></tr></tbody></table>

Sample request to reserve `superbet` ticket:

```json
{
    "operator": "site",
    "token": "sGhx12skwrXsukbZmWh7bkCC9YPEzYQKtKSe9EfCth3Q",
    "psp": "mobile",
    "price": 2000,
    "currency": "KES",
    "atag": "affiliate-1",
    "rtag": null,
    "source": "mobile",
    "type": "superbet",
    "event": 100001,
    "bets": [101, 102, 103, 104, 105, 106]
}
```

Response fields:

<table><thead><tr><th width="231">Attribute</th><th width="122">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Ticket id</td></tr><tr><td>code</td><td>string</td><td>Ticket code</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). Will always be <code>0</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). Will always be <code>0</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). Will always be <code>0</code></td></tr><tr><td>wht</td><td>integer</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>superbet</code> Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>float or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>User ID from PAM</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_created</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr></tbody></table>

Sample response (status=200) to `superbet` ticket:

```json
{
    "id": "66902734beba20ff2df5c79f",
    "code": "DEC4C0",
    "price": 1000,
    "stake": 889,
    "gross_payout": 0,
    "net_payout": 0,
    "wht_amount": 0,
    "wht": 10.0,
    "ext_amount": 111,
    "ext": 12.5,
    "ext_type": "inclusive",
    "currency": "USD",
    "status": "reserved",
    "result": "pending",
    "approved": true,
    "source": "desktop",
    "type": "superbet",
    "atag": "atag_value",
    "rtag": null,
    "aff_instant_comm_amt": 178,
    "aff_instant_comm_pct": 20,
    "user_id": "token_or_user_id",
    "psp": "mobile",
    "created": "2024-07-11T18:40:52.995000",
    "operator_time_created": "2024-07-11T20:40:52.995000",
    "updated": "2024-07-11T18:40:53.013000",
    "operator_time_updated": "2024-07-11T20:40:53.013000"
}
```

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr><tr><td>422</td><td>Validation Error. Please check response body for more details</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 103,
    "message": "Event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 105,
    "message": "Team with `{team-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 106,
    "message": "Market for bet with `{market-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 107,
    "message": "Event with `{event-id}` identifier is not available for play because it has already started"
}
```

Error response (status=400):

```json
{
    "code": 111,
    "message": "Duplicate key for code generation"
}
```

Error response (status=400):

```json
{
    "code": 112,
    "message": "Operator with `{operator-id}` name is not found"
}
```

Error response (status=400):

```json
{
    "code": 114,
    "message": "No webhook url for operator with `{operator-id}` name"
}
```

Error response (status=400):

```json
{
    "code": 115,
    "message": "Operators in request body and in request header are not identical"
}
```

Error response (status=400):

```json
{
    "code": 116,
    "message": "Market with `{market-id}` code is not allowed"
}
```


# Jackpot

POST \`/be/tickets/reserve\` endpoint

Reserve jackpot ticket.

Request fields:

<table><thead><tr><th width="168">Attribute</th><th width="176">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>token</td><td>string</td><td>Player identification token</td></tr><tr><td>psp</td><td>string or null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>jackpot</code></td></tr><tr><td>odds_diff</td><td>float</td><td><p>Specifies the max odds deviation when we still accept the request and create the ticket. </p><p>When the value is set to zero it means we don't allow any odds difference during ticket creation and will respond with "Ticket odds changed" Error response</p></td></tr><tr><td>events</td><td>list of objects</td><td></td></tr><tr><td>events id</td><td>integer</td><td>Event id</td></tr><tr><td>events bet</td><td>integer</td><td>Event bet id</td></tr><tr><td>events odds</td><td>float</td><td>Event odds at time of ticket submission. Should be in decimal format with 2 digits after comma</td></tr><tr><td>betcard_code</td><td>string</td><td>Betcard code</td></tr><tr><td>prize</td><td>integer</td><td>Betcard prize</td></tr><tr><td>bonus_prizes</td><td>list of integers</td><td>Betcard bonus prizes</td></tr></tbody></table>

Sample request to reserve `jackpot` ticket:

```json
{
    "operator": "acme",
    "token": "sometokenvalue",
    "psp": "mobile",
    "price": 500,
    "currency": "USD",
    "atag": "atag_value",
    "rtag": null,
    "source": "desktop",
    "type": "jackpot",
    "odds_diff": 10.5,
    "events": [
        {
            "id": 265825,
            "bet": 14,
            "odds": 2.55
        },
        {
            "id": 265826,
            "bet": 34,
            "odds": 3.62
        },
        {
            "id": 265827,
            "bet": 22,
            "odds": 1.55
        },
        {
            "id": 265828,
            "bet": 83,
            "odds": 2.11
        },
        {
            "id": 265829,
            "bet": 66,
            "odds": 5.1
        },
        {
            "id": 265830,
            "bet": 25,
            "odds": 1.78
        }
    ],
    "betcard_code": "ABC123",
    "prize": 10000,
    "bonus_prizes": [
        2000,
        1500,
        1000
    ]
}
```

Response fields:

<table><thead><tr><th width="224">Attribute</th><th width="122">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Ticket id</td></tr><tr><td>code</td><td>string</td><td>Ticket code</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td><code>jackpot</code></td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. If parameter is present then it is added to the <code>ticket_reserve</code> PAM API call.</td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>float or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>User ID from PAM</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_created</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>odds</td><td>float</td><td>Product of odds for all events for ticket</td></tr><tr><td>betcard_code</td><td>string</td><td>Betcard code</td></tr><tr><td>prize</td><td>integer</td><td>Betcard prize</td></tr><tr><td>bonus_prizes</td><td>list of integers</td><td>Betcard bonus prizes</td></tr></tbody></table>

Sample response (status=200) to `jackpot` ticket:

```json
{
    "id": "66e38e2760b915970f42fa85",
    "code": "B5D096",
    "price": 500,
    "stake": 444,
    "currency": "USD",
    "gross_payout": 0,
    "net_payout": 0,
    "wht_amount": 0,
    "wht": 10.0,
    "ext_amount": 56,
    "ext": 12.5,
    "ext_type": "inclusive",
    "status": "open",
    "result": "pending",
    "approved": true,
    "source": "desktop",
    "type": "jackpot",
    "atag": "atag_value",
    "rtag": null,
    "user_id": "sometokenvalue",
    "psp": "mobile",
    "created": "2024-09-13T00:58:15.595000",
    "operator_time_created": "2024-09-13T03:58:15.595000",
    "updated": "2024-09-13T00:58:15.614000",
    "operator_time_updated": "2024-09-13T03:58:15.614000",
    "odds": 32.77,
    "betcard_code": "ABC123",
    "prize": 10000,
    "bonus_prizes": [
        2000,
        1500,
        1000
    ]
}
```

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr><tr><td>422</td><td>Validation Error. Please check response body for more details</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 103,
    "message": "Event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 104,
    "message": "Events list in ticket object can't be empty"
}
```

Error response (status=400):

```json
{
    "code": 105,
    "message": "Team with `{team-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 106,
    "message": "Market for bet with `{market-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 107,
    "message": "Event with `{event-id}` identifier is not available for play because it has already started"
}
```

Error response (status=400):

```json
{
    "code": 108,
    "message": "Bookmaker event for event with `{event-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 109,
    "message": "Market is blocked"
}
```

Error response (status=400):

```json
{
    "code": 110,
    "message": "Ticket odds changed"
}
```

Error response (status=400):

```json
{
    "code": 111,
    "message": "Duplicate key for code generation"
}
```

Error response (status=400):

```json
{
    "code": 112,
    "message": "Operator with `{operator-id}` name is not found"
}
```

Error response (status=400):

```json
{
    "code": 114,
    "message": "No webhook url for operator with `{operator-id}` name"
}
```

Error response (status=400):

```json
{
    "code": 115,
    "message": "Operators in request body and in request header are not identical"
}
```

Error response (status=400):

```json
{
    "code": 118,
    "message": "Events list must contain at least {correct_amount} items."
}
```


# Paid ticket endpoint

POST \`/be/tickets/{identifier}/paid\` endpoint

`identifier` - this could be either ticket id or ticket code.

Will set ticket status to `open`.

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 100,
    "message": "{feature} feature not implemented yet"
}
```

Error response (status=400):

```json
{
    "code": 102,
    "message": "Ticket with `{ticket-id}` identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 117,
    "message": "Ticket has to have `reserved` status in order to do this action"
}
```


# Get ticket endpoint

GET \`/be/tickets/{identifier}\` endpoint

`identifier` - this could be either ticket id or ticket code.

Currently we support 6 ticket types:

Details for  `quicktip` ticket type fields are here - [Quicktip](/bet-engine-api/get-ticket-endpoint/quicktip)

Details for  `smartbet` ticket type fields are here - [Smartbet](/bet-engine-api/get-ticket-endpoint/smartbet)

Details for  `quickbet` ticket type fields are here - [Quickbet](/bet-engine-api/get-ticket-endpoint/quickbet)

Details for  `quickbetx` ticket type fields are here - [QuickbetX](/bet-engine-api/get-ticket-endpoint/quickbetx)

Details for  `superbet` ticket type fields are here - [Superbet](/bet-engine-api/get-ticket-endpoint/superbet)

Details for  `jackpot` ticket type fields are here - [Jackpot](/bet-engine-api/get-ticket-endpoint/jackpot)

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr><tr><td>422</td><td>Validation Error. Please check response body for more details</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 100,
    "message": "Feature not implemented yet"
}
```

Error response (status=400):

```json
{
    "code": 102,
    "message": "Ticket with {ticket-id} identifier is not found"
}
```

Error response (status=400):

```json
{
    "code": 112,
    "message": "Operator with `{operator-id}` name is not found"
}
```


# Quicktip

GET \`/be/tickets/{identifier}\` endpoint

`identifier` - this could be either ticket id or ticket code.

Response fields for `quicktip` ticket:

<table><thead><tr><th width="234">Attribute</th><th width="133">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Betstack ticket id</td></tr><tr><td>code</td><td>string</td><td>Betstack ticket code</td></tr><tr><td>psp</td><td>string or null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td>Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>). Will always contain <code>quicktip</code></td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID</td></tr><tr><td>rtag</td><td>string or null</td><td><p></p><p>Optional referral Tag or referral ID</p></td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>float or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>Betstack user id</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_starts</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>events</td><td>list of objects</td><td></td></tr><tr><td>events id</td><td>integer</td><td>Event id</td></tr><tr><td>event starts</td><td>string</td><td>Event start datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>event opetator_time_starts</td><td>string</td><td>Event start datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>event sport</td><td>object</td><td></td></tr><tr><td>event sport id</td><td>integer</td><td>Id of sport event</td></tr><tr><td>event sport name</td><td>string</td><td>Name of sport event</td></tr><tr><td>event category</td><td>object</td><td></td></tr><tr><td>event category id</td><td>integer</td><td>Id of sport category</td></tr><tr><td>event category name</td><td>string</td><td>Name of sport category</td></tr><tr><td>event league</td><td>object</td><td></td></tr><tr><td>event league id</td><td>integer</td><td>Id of league</td></tr><tr><td>event league name</td><td>string</td><td>Name of league</td></tr><tr><td>event home_team</td><td>object</td><td></td></tr><tr><td>event home_team id</td><td>integer</td><td>Id of home team</td></tr><tr><td>event home_team name</td><td>string</td><td>Name of home team</td></tr><tr><td>event away_team</td><td>object</td><td></td></tr><tr><td>event away_team id</td><td>integer</td><td>Id of away team</td></tr><tr><td>event away_team name</td><td>string</td><td>Name of away team</td></tr><tr><td>event market</td><td>object</td><td></td></tr><tr><td>event market code</td><td>string</td><td>Code of market </td></tr><tr><td>event market name</td><td>string</td><td>Name of market</td></tr><tr><td>event bet</td><td>object</td><td></td></tr><tr><td>event bet code</td><td>string</td><td>Code of event bet</td></tr><tr><td>event bet name</td><td>string</td><td>Name of event bet</td></tr><tr><td>event line</td><td>object</td><td></td></tr><tr><td>event line code</td><td>string</td><td>Code of the bet line</td></tr><tr><td>event line name</td><td>string</td><td>Name of the bet line</td></tr><tr><td>events odds</td><td>float</td><td>Event odds. Should be in decimal format with 2 digits after comma</td></tr><tr><td>event status</td><td>string</td><td>Status of the event (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>event result</td><td>string</td><td>Result of the event (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>odds</td><td>float</td><td>Ticket odds</td></tr></tbody></table>

Sample response (status=200) for `quicktip` ticket:

<pre class="language-json"><code class="lang-json">{
<strong>    "id": "6314704d686a9e8e5d68dca6",
</strong>    "code": "E36E20",
    "psp": null,
    "price": 2000,
    "stake": 1800,
    "currency": "USD",
    "gross_payout": 12000,
    "net_payout": 10000,
    "wht_amount": 1300,
    "wht": 0,
    "ext_amount": 200,
    "ext": 10,
    "ext_type": "inclusive",
    "status": "open",
    "result": "pending",
    "approved": true,
    "source": "desktop",
    "type": "quicktip",
    "atag": "atag_value",
    "rtag": null,
    "aff_instant_comm_amt": null,
    "aff_instant_comm_pct": null,
    "user_id": "1660986605374148608",
    "psp": "mobile",
    "created": "2022-09-04T09:30:53.000000",
    "operator_time_created": "2022-09-04T11:30:53.000000",
    "updated": "2022-09-04T09:30:53.000000",
    "operator_time_updated": "2022-09-04T11:30:53.000000",
    "events": [
        {
            "id": 100001,
            "starts": "2022-09-04T09:30:53.000000",
            "operator_time_starts": "2022-09-04T11:30:53.000000",
            "sport": {
                "id": 101,
                "name": "Football"
            },
            "category": {
                "id": 102,
                "name": "Europe"
            },
            "league": {
                "id": 103,
                "name": "UEFA Europa League"
            },
            "home_team": {
                "id": 1,
                "name": "FC Zurich"
            },
            "away_team": {
                "id": 2,
                "name": "Arsenal"
            },
            "market": {
                "code": "MRFT",
                "name": "Match Result Full Time"
            },
            "bet": {
                "code": "05",
                "name": "0.5"
            },
            "line": {
                "code": "05",
                "name": "0.5"
            },
            "odds": 1.55,
            "status": "not_started",
            "result": "open"
        }
    ],
    "odds": 7.4
}
</code></pre>


# Smartbet

GET \`/be/tickets/{identifier}\` endpoint

`identifier` - this could be either ticket id or ticket code.

Response fields for `smartbet` ticket are the same as for [Quicktip](/bet-engine-api/get-ticket-endpoint/quicktip) ticket, except `type` field will contain `smartbet` value. All other fields are the same.


# Quickbet

GET \`/be/tickets/{identifier}\` endpoint

`identifier` - this could be either ticket id or ticket code.

Response fields for `quickbet` ticket are the same as for [Quicktip](/bet-engine-api/get-ticket-endpoint/quicktip) ticket, except `type` field will contain `quickbet` value. All other fields are the same.


# QuickbetX

GET \`/be/tickets/{identifier}\` endpoint

`identifier` - this could be either ticket id or ticket code.

Response fields for `quickbetx` ticket are the same as for [Quicktip](/bet-engine-api/get-ticket-endpoint/quicktip) ticket, except `type` field will contain `quickbetx` value. All other fields are the same.


# Superbet

GET \`/be/tickets/{identifier}\` endpoint

`identifier` - this could be either ticket id or ticket code.

Response fields for `superbet` ticket:

<table><thead><tr><th width="256">Attribute</th><th width="134">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Betstack ticket id</td></tr><tr><td>code</td><td>string</td><td>Betstack ticket code</td></tr><tr><td>psp</td><td>string ot null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for tax <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for tax <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for tax <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td>Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID</td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>float or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>Betstack user id</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_created</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>event</td><td>object</td><td></td></tr><tr><td>event id</td><td>integer</td><td>Event id</td></tr><tr><td>event starts</td><td>string</td><td>Event start datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>event operator_time_starts</td><td>string</td><td>Event start datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>event home_team</td><td>string</td><td>Name of home team</td></tr><tr><td>event away_team</td><td>string</td><td>Name of away team</td></tr><tr><td>bets</td><td>list of objects</td><td></td></tr><tr><td>bets id</td><td>integer</td><td>Id of bet</td></tr><tr><td>bets bet_name</td><td>string</td><td>Name of bet</td></tr><tr><td>bets market_code</td><td>string</td><td>Code of market</td></tr><tr><td>bets market_name</td><td>string</td><td>Name of market</td></tr><tr><td>bets result</td><td>string</td><td>Bet Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr></tbody></table>

Sample response (status=200) for `superbet` ticket:

```json
{
    "id": "6314704d686a9e8e5d68dca6",
    "code": "E36E20",
    "psp": null,
    "price": 2000,
    "stake": 1800,
    "gross_payout": 0,
    "net_payout": 0,
    "wht_amount": 0,
    "wht": 0,
    "ext_amount": 200,
    "ext": 10,
    "ext_type": "inclusive",
    "currency": "USD",
    "status": "resulted",
    "result": "lost",
    "approved": true,
    "source": "desktop",
    "type": "superbet",
    "atag": "atag_value",
    "rtag": null,
    "aff_instant_comm_amt": 360,
    "aff_instant_comm_pct": 20,
    "user_id": "1660986605374148608",
    "created": "2022-09-04T09:30:53.000000",
    "operator_time_created": "2022-09-04T11:30:53.000000",
    "updated": "2022-09-04T09:30:53.000000",
    "operator_time_updated": "2022-09-04T11:30:53.000000",
    "event": {
        "id": 100001,
        "starts": "2022-09-04T09:30:53.000000",
        "operator_time_starts": "2022-09-04T11:30:53.000000",
        "home_team": "Lazio",
        "away_team": "FC Bayern Munich"
    },
    "bets": [
        {
            "id": 101,
            "bet_name": "Home",
            "market_code": "FTSFT",
            "market_name": "First Goal Full Time",
            "result": "pending"
        },
        {
            "id": 102,
            "bet_name": "1-0",
            "market_code": "CSHT",
            "market_name": "Correct Score Half Time",
            "result": "lost"
        },
        {
            "id": 103,
            "bet_name": "Yes",
            "market_code": "BTSFT",
            "market_name": "Both Teams to Score Full Time",
            "result": "pending"
        },
        {
            "id": 104,
            "bet_name": "Second",
            "market_code": "HSH",
            "market_name": "Highest Scoring Half",
            "result": "pending"
        },
        {
            "id": 105,
            "bet_name": "Odd",
            "market_code": "OEFT",
            "market_name": "Odd/Even Full Time",
            "result": "pending"
        },
        {
            "id": 106,
            "bet_name": "2-1",
            "market_code": "CSFT",
            "market_name": "Correct Score Full Time",
            "result": "pending"
        }
    ]
}
```


# Jackpot

GET \`/be/tickets/{identifier}\` endpoint

`identifier` - this could be either ticket id or ticket code.

Response fields for `jackpot` ticket:

<table><thead><tr><th width="234">Attribute</th><th width="133">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Betstack ticket id</td></tr><tr><td>code</td><td>string</td><td>Betstack ticket code</td></tr><tr><td>psp</td><td>string or null</td><td>Optional payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket amount. Should be in integer format (cents). For example, for stake <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>status</td><td>string</td><td>Ticket Status (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>result</td><td>string</td><td>Ticket Result (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>approved</td><td>bool</td><td>Ticket approval (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>source</td><td>string</td><td>Ticket source (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>type</td><td>string</td><td>Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>). Will always contain <code>jackpot</code></td></tr><tr><td>atag</td><td>string or null</td><td>Optional affiliate Tag or Affiliate ID</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID</td></tr><tr><td>aff_instant_comm_amt</td><td>int or null</td><td>Optional instant commission amount of affiliate user (in cents). Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>aff_instant_comm_pct</td><td>float or null</td><td>Optional instant commission percentage of affiliate user. Actual value may be only in smartbet, jackpot and superbet tickets</td></tr><tr><td>user_id</td><td>string</td><td>Betstack user id</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or payment method name</td></tr><tr><td>created</td><td>string</td><td>Ticket created datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_starts</td><td>string</td><td>Ticket created datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>updated</td><td>string</td><td>Ticket updated datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>operator_time_updated</td><td>string</td><td>Ticket updated datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>events</td><td>list of objects</td><td></td></tr><tr><td>events id</td><td>integer</td><td>Event id</td></tr><tr><td>event starts</td><td>string</td><td>Event start datetime, UTC. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>event opetator_time_starts</td><td>string</td><td>Event start datetime, operator timezone. Format - <code>2024-01-28T14:33:01.000000</code></td></tr><tr><td>event sport</td><td>object</td><td></td></tr><tr><td>event sport id</td><td>integer</td><td>Id of sport event</td></tr><tr><td>event sport name</td><td>string</td><td>Name of sport event</td></tr><tr><td>event category</td><td>object</td><td></td></tr><tr><td>event category id</td><td>integer</td><td>Id of sport category</td></tr><tr><td>event category name</td><td>string</td><td>Name of sport category</td></tr><tr><td>event league</td><td>object</td><td></td></tr><tr><td>event league id</td><td>integer</td><td>Id of league</td></tr><tr><td>event league name</td><td>string</td><td>Name of league</td></tr><tr><td>event home_team</td><td>object</td><td></td></tr><tr><td>event home_team id</td><td>integer</td><td>Id of home team</td></tr><tr><td>event home_team name</td><td>string</td><td>Name of home team</td></tr><tr><td>event away_team</td><td>object</td><td></td></tr><tr><td>event away_team id</td><td>integer</td><td>Id of away team</td></tr><tr><td>event away_team name</td><td>string</td><td>Name of away team</td></tr><tr><td>event market</td><td>object</td><td></td></tr><tr><td>event market code</td><td>string</td><td>Code of market </td></tr><tr><td>event market name</td><td>string</td><td>Name of market</td></tr><tr><td>event bet</td><td>object</td><td></td></tr><tr><td>event bet code</td><td>string</td><td>Code of event bet</td></tr><tr><td>event bet name</td><td>string</td><td>Name of event bet</td></tr><tr><td>event line</td><td>object</td><td></td></tr><tr><td>event line code</td><td>string</td><td>Code of the bet line</td></tr><tr><td>event line name</td><td>string</td><td>Name of the bet line</td></tr><tr><td>events odds</td><td>float</td><td>Event odds. Should be in decimal format with 2 digits after comma</td></tr><tr><td>event status</td><td>string</td><td>Status of the event (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>event result</td><td>string</td><td>Result of the event (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr><tr><td>betcard_code</td><td>string</td><td>Betcard code</td></tr><tr><td>prize</td><td>integer</td><td>Betcard prize</td></tr><tr><td>bonus_prizes</td><td>list of integers</td><td>Betcard bonus prizes</td></tr></tbody></table>

Sample response (status=200) for `jackpot` ticket:

```json
{
    "id": "66e393ea19adab3ab258cb34",
    "code": "4AAFE4",
    "psp": null,
    "price": 500,
    "stake": 444,
    "currency": "USD",
    "gross_payout": 0,
    "net_payout": 0,
    "wht_amount": 0,
    "wht": 20,
    "ext_amount": 56,
    "ext": 12.5,
    "ext_type": "inclusive",
    "status": "open",
    "result": "pending",
    "approved": true,
    "source": "desktop",
    "type": "jackpot",
    "atag": "atag_value",
    "rtag": null,
    "aff_instant_comm_amt": 89,
    "aff_instant_comm_pct": 20,
    "user_id": "sometokenvalue",
    "psp": "mobile",
    "created": "2024-09-13T01:22:50.507000",
    "operator_time_created": "2024-09-13T01:22:50.507000",
    "updated": "2024-09-13T01:22:50.532000",
    "operator_time_updated": "2024-09-13T01:22:50.532000",
    "events": [
        {
            "id": 317299,
            "starts": "2024-09-14T10:00:00.000000",
            "operator_time_starts": "2024-09-14T10:00:00.000000",
            "sport": {
                "id": 10000,
                "name": "Football"
            },
            "category": {
                "id": 1410000,
                "name": "Kenya"
            },
            "league": {
                "id": 11130000,
                "name": "KPL"
            },
            "home_team": {
                "id": 1062240000,
                "name": "Nairobi City Stars"
            },
            "away_team": {
                "id": 1069080000,
                "name": "Bidco United"
            },
            "market": {
                "code": "MRFT",
                "name": "Match Result Full Time"
            },
            "bet": {
                "code": "1",
                "name": "Home"
            },
            "line": null,
            "odds": 2.35,
            "status": "not_started",
            "result": "open"
        },
        {
            "id": 317298,
            "starts": "2024-09-13T21:45:00.000000",
            "operator_time_starts": "2024-09-13T21:45:00.000000",
            "sport": {
                "id": 10000,
                "name": "Football"
            },
            "category": {
                "id": 2280000,
                "name": "Venezuela"
            },
            "league": {
                "id": 16720000,
                "name": "Primera Division"
            },
            "home_team": {
                "id": 1103400000,
                "name": "Metropolitanos FC"
            },
            "away_team": {
                "id": 104407,
                "name": "Portuguesa"
            },
            "market": {
                "code": "DCFT",
                "name": "Double Chance Full Time"
            },
            "bet": {
                "code": "12",
                "name": "Home/Away"
            },
            "line": null,
            "odds": 1.22,
            "status": "not_started",
            "result": "open"
        },
        {
            "id": 317297,
            "starts": "2024-09-14T10:00:00.000000",
            "operator_time_starts": "2024-09-14T10:00:00.000000",
            "sport": {
                "id": 10000,
                "name": "Football"
            },
            "category": {
                "id": 2060000,
                "name": "South Korea"
            },
            "league": {
                "id": 15120000,
                "name": "K3 League"
            },
            "home_team": {
                "id": 1087600000,
                "name": "Ulsan Citizen"
            },
            "away_team": {
                "id": 1087580000,
                "name": "Hwaseong"
            },
            "market": {
                "code": "DCFT",
                "name": "Double Chance Full Time"
            },
            "bet": {
                "code": "12",
                "name": "Home/Away"
            },
            "line": null,
            "odds": 1.2,
            "status": "not_started",
            "result": "open"
        }
    ],
    "betcard_code": "ABC123",
    "prize": 10000,
    "bonus_prizes": [
        2000,
        1500,
        1000
    ]
}
```


# Get ticket list endpoint

GET \`/be/tickets\` endpoint

Request URL parameters:

<table><thead><tr><th width="167">Parameter</th><th width="206">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>limit</td><td>integer</td><td>Optional. Default = 10. Number of tickets to return</td></tr><tr><td>user_id</td><td>string</td><td>Optional. If presented - does filtration by ticket <code>user_id</code> field</td></tr><tr><td>skip_types</td><td>list of TicketType</td><td>Optional. List of Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>). If presented - does filtration by ticket <code>type</code> field. Excludes tickets with types from <code>skip_type</code> parameter. If you want to exclude tickets with multiple types - pass types like this: <code>...&#x26;skip_types=superbet&#x26;skip_types=jackpot&#x26;...</code></td></tr></tbody></table>

Response for this endpoint is a list of objects. Each object represents separate ticket. For each ticket type response fields are the same as in [Get ticket endpoint](/bet-engine-api/get-ticket-endpoint).

Sample response (status=200):

```json
[
    {
        "id": "6314704d686a9e8e5d68dca6",
        "code": "E36E20",
        "psp": null,
        "price": 2000,
        "stake": 1800,
        "currency": "USD",
        "gross_payout": 12000,
        "net_payout": 10000,
        "wht_amount": 1300,
        "wht": 0.0,
        "ext_amount": 200,
        "ext": 10.0,
        "ext_type": "inclusive",
        "status": "open",
        "result": "pending",
        "approved": true,
        "source": "desktop",
        "type": "quicktip",
        "atag": "atag_value",
        "rtag": null,
        "aff_instant_comm_amt": null,
        "aff_instant_comm_pct": null,
        "user_id": "1660986605374148608",
        "psp": "mobile",
        "created": "2022-09-04T09:30:53.000000",
        "operator_time_created": "2022-09-04T11:30:53.000000",
        "updated": "2022-09-04T09:30:53.000000",
        "operator_time_updated": "2022-09-04T11:30:53.000000",
        "events": [...],
        "odds": 7.4
    },
    {
        "id": "6314704d686a9e8e5d68dca6",
        "code": "E36E20",
        "price": 2000,
        "stake": 1800,
        "gross_payout": 0,
        "net_payout": 0,
        "wht_amount": 0,
        "wht": 0.0,
        "ext_amount": 200,
        "ext": 10.0,
        "ext_type": "inclusive",
        "currency": "USD",
        "status": "resulted",
        "result": "lost",
        "approved": true,
        "source": "desktop",
        "type": "superbet",
        "atag": null,
        "rtag": "44nnljrn4r",
        "aff_instant_comm_amt": null,
        "aff_instant_comm_pct": null,
        "user_id": "1660986605374148608",
        "psp": "mobile",
        "created": "2022-09-04T09:30:53.000000",
        "operator_time_created": "2022-09-04T11:30:53.000000",
        "updated": "2022-09-04T09:30:53.000000",
        "operator_time_updated": "2022-09-04T11:30:53.000000",
        "event": {...},
        "bets": [...]
    },
    ...
]
```

Response status codes:

<table><thead><tr><th width="150">Status Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>200</td><td>OK - Everything worked as expected</td></tr><tr><td>400</td><td>Bad Request. Please check error code in response body (see <a data-mention href="/bet-engine-api/error-codes">Error codes</a>)</td></tr><tr><td>403</td><td>Forbidden. You do not have access for such request</td></tr><tr><td>422</td><td>Validation Error. Please check response body for more details</td></tr></tbody></table>

Error response (status=400):

```json
{
    "code": 112,
    "message": "Operator with `{operator-id}` name is not found"
}
```


# Fields

Field values used in Bet Engine API

#### Ticket Fields

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>result</td><td>string</td><td>pending / won / lost / void</td></tr><tr><td>status</td><td>string</td><td>new / *cancelled / reserved / open / calculating / resulted / closed</td></tr><tr><td>approved</td><td>bool</td><td>true / false</td></tr><tr><td>source</td><td>string</td><td>desktop / mobile / android / iphone / ussd / sms / telegram </td></tr><tr><td>type</td><td>string</td><td>quicktip / smartbet / jackpot / *superbet</td></tr><tr><td>ext_type</td><td>string</td><td>inclusive</td></tr><tr><td>payout_status</td><td>string</td><td>used for winning and void ticket status:<br>pending / approved / rejected / processing / failed / done</td></tr></tbody></table>

#### Event Fields

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Values</th></tr></thead><tbody><tr><td>status</td><td>string</td><td>not_started / in_play / postponed / *cancelled / interrupted / finished / walkover_home / walkover_away / retire_home / retire_away / no_result / under_verification</td></tr><tr><td>result</td><td>string</td><td>open / won / lost / void</td></tr></tbody></table>

#### Bet Fields

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>result</td><td>string</td><td>pending / won / lost / void</td></tr><tr><td></td><td></td><td></td></tr></tbody></table>


# Error codes

Full list of error codes for 400 response status code:

<table><thead><tr><th width="135">Error Code</th><th>Interpretation</th></tr></thead><tbody><tr><td>100</td><td>{feature_name} feature not implemented yet</td></tr><tr><td>101</td><td>Error with incoming data</td></tr><tr><td>102</td><td>Ticket with {ticket-id} identifier is not found</td></tr><tr><td>103</td><td>Event with {event-id} identifier is not found</td></tr><tr><td>104</td><td>Events list in ticket object can't be empty</td></tr><tr><td>105</td><td>Team with {team-id} identifier is not found</td></tr><tr><td>106</td><td>Market for bet with {bet-id} identifier is not found</td></tr><tr><td>107</td><td>Event with {event-id} identifier is not available for play because it has already started</td></tr><tr><td>108</td><td>Bookmaker event for event with {event-id} identifier is not found</td></tr><tr><td>109</td><td>Market is blocked</td></tr><tr><td>110</td><td>Ticket odds changed</td></tr><tr><td>111</td><td>Duplicate key for code generation</td></tr><tr><td>112</td><td>Operator with {operator-name} name is not found</td></tr><tr><td>113</td><td>Error while request to PAM {action-name} action</td></tr><tr><td>114</td><td>No webhook url for operator with {operator-id} name</td></tr><tr><td>115</td><td>Operators in request body and in request header are not identical.</td></tr><tr><td>116</td><td>Market with {market-id} code is not allowed.</td></tr><tr><td>117</td><td>Ticket has to have {status} status in order to do this action.</td></tr><tr><td>118</td><td>Events list must contain at least {correct_amount} items.</td></tr></tbody></table>


# PAM Platform API

PAM Platform service is a backend integration calling operators PAM Platform

API Endpoint : <https://api.betstack.io/pam>

When tickets are submitted to Bet Engine, the service will invoke PAM API for integration with operator's platform.&#x20;

{% hint style="info" %}
You can use our accept all proxy PAM API service on <https://public.betstack.io/pam/webhook> as your PAM endpoint in your API settings during development phase for acceptance of all requests.
{% endhint %}

Flowchart illustrating ticket process between Betengine and PAM Platform API when ticket is submitted from a Micro Bet:

{% file src="/files/IxsSFhyo6GemfyB8ebdE" %}


# Headers

In all requests for all actions (except `ping` action) two headers will be sent:

<table><thead><tr><th width="186">Attribute</th><th width="536">Description</th></tr></thead><tbody><tr><td><code>timestamp</code></td><td>The unix time stamp</td></tr><tr><td><code>signature</code></td><td>Signature of incoming request body and secret key (HMAC)</td></tr></tbody></table>

By checking signature in request you may confirm that the webhook came from us.

Detailed info about how to calculate signature may be found on [Signature](/pam-platform-api/signature) page.


# Signature

Generate HMAC hash signature to check that webhook is actually coming from BetEngine.

The Signature is calculated based on the `timestamp`, `request body` and your `Secret Key` with HMAC hash using SHA256 Algorithm.&#x20;

Here is an example on how to generate the Signature for `ticket_create` action with `Secret Key=12345ABCDE`, `timestamp=1706191612` and following request body:

```json
{
    "action": "ticket_create",
    "data": {
        "operator": "acme",
        "ticket_id": "668ef666333180bba97f0c93",
        "ticket_code": "CD4BDD",
        "player_id": "sometokenvalue",
        "price": 500,
        "stake": 444,
        "wht_amount": 240,
        "wht": 10,
        "ext_amount": 56,
        "ext": 12.5,
        "ext_type": "inclusive",
        "gross_payout": 2842,
        "net_payout": 2602,
        "currency": "USD",
        "atag": "atag_value",
        "rtag": null,
        "ticket_type": "quickbet"
    }
}
```

In order to generate the Signature all spaces must be removed from the request body:

```json
{"action":"ticket_create","data":{"operator":"acme","ticket_id":"668ef666333180bba97f0c93","ticket_code":"CD4BDD","player_id":"sometokenvalue","price":500,"stake":444,"wht_amount":240,"wht":10,"ext_amount":56,"ext":12.5,"ext_type":"inclusive","gross_payout":2842,"net_payout":2602,"currency":"USD","atag":"atag_value","rtag":null,"ticket_type":"quickbet"}}
```

{% hint style="info" %}
Please note that the order of the fields matters for calculating the signature. It will always be `action` first then `data`. Fields in `data` must be in the same order they are listed on doc pages for actions.
{% endhint %}

{% hint style="info" %}
Please note that optional fields, like `atag` or `rtag` will also be included in signature generation, even if they have `null` values. For example, if `atag` field has `null` value then it will be included in signature generation like so:

```
{...,"atag":null,...}
```

{% endhint %}

Then message for HMAC algorithm has to be formed using following template:

```
{timestamp}{request body with removed spaces}
```

So the message should look like the following:

```
1706191612{"action":"ticket_create","data":{"operator":"acme","ticket_id":"668ef666333180bba97f0c93","ticket_code":"CD4BDD","player_id":"sometokenvalue","price":500,"stake":444,"wht_amount":240,"wht":10,"ext_amount":56,"ext":12.5,"ext_type":"inclusive","gross_payout":2842,"net_payout":2602,"currency":"USD","atag":"atag_value","rtag":null,"ticket_type":"quickbet"}}
```

The computed Signature for this request is:

```
3fe37f41ba6dc960fd2a7098bd4643f971ff1408a31bcea9f3ef8d03b3ba2d0a
```

A free online HMAC Generator for testing is available on <https://www.freeformatter.com/hmac-generator.html#before-output>.&#x20;

Here is how we calculated the Signature from above example using **Free Formatter**

<figure><img src="https://2027057513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKuxm6ysd27rN14uEAtGy%2Fuploads%2FCnn5vnIxl8YR8sko1drU%2Fimage.png?alt=media&amp;token=53319ea2-53d2-4903-8a57-2371429fd87e" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Your `Secret Key` is located on your API Settings page. Login to Betstack to access your `Secret Key`
{% endhint %}

<figure><img src="https://2027057513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKuxm6ysd27rN14uEAtGy%2Fuploads%2Fe5aGzX5mkTtACXh9j4Ee%2Fsecret-Key.png?alt=media&amp;token=7a7a76a8-c5ea-4821-986f-e015fb624c4b" alt=""><figcaption><p>Secret Key is locate in API Settings profile page</p></figcaption></figure>


# Ping

{% hint style="info" %}
`Signature` header will not be sent with this action.
{% endhint %}

Is used to verify the availability of API provided by the operator's platform Request:

```json
{
    "action": "ping"
}
```

```
Response: 200
Doesn't require any payload
```


# Identify

Used to identify player using token generated by operator before.&#x20;

In case of successful identification, PAM expects Response 200, otherwise return response with code 403 Request.

Request fields:

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td> string</td><td>Name of the operator as registered on the system</td></tr><tr><td>token</td><td> string</td><td>Player identification token</td></tr></tbody></table>

Sample `identify` request:

```json
{    
    "action": "identify",
    "data": {
        "operator": "operator-code", 
        "token": "partner-player-token"
    }
}
```

Response fields:

<table><thead><tr><th width="149">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>player_id</td><td>string</td><td>Player identification number or code</td></tr><tr><td>lang</td><td>string</td><td>Language code in two letter  <a href="https://www.iso.org/iso-639-language-code">ISO 639-1 </a>format </td></tr><tr><td>balance</td><td>integer</td><td>Available player balance. Should be in integer format (cents)</td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>feature_flags</td><td>object</td><td>Additional features</td></tr></tbody></table>

Sample `identify` response:

```json
Response: 200
{
    "player_id": "1660986605374148608", 
    "lang": "en",
    "balance": 1000,
    "currency": "KES", 
    "feature_flags": {
        "flag_name1": true, 
        "flag_name2": false
    }
}

Response: 400
{
    "code": 101,
    "message": "User not found" 
}
```


# Create a ticket

Is used when player creates a ticket (betslip). It takes money out of player's account. In case of not successful response a `ticket_discard` action will be called. In case of not successful call of `ticket_discard` action, call should be repeated after 30 mins.

Request fields:

<table><thead><tr><th width="169">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket identification number</td></tr><tr><td>ticket_code</td><td>string</td><td>Ticket code</td></tr><tr><td>player_id</td><td>string</td><td>Player identification number or code</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket stake. Should be in integer format (cents). For example, for stake <code>33.45</code> the value will be <code>3345</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>4.55</code> the value will be <code>455</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>) </td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value will be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional Affiliate Tag or Affiliate ID</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. </td></tr><tr><td>ticket_type</td><td>string</td><td>Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>) </td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_create",
    "data": {
        "operator": "acme",
        "ticket_id": "668ef666333180bba97f0c93",
        "ticket_code": "CD4BDD",
        "player_id": "sometokenvalue",
        "psp": "mobile",
        "price": 500,
        "stake": 444,
        "wht_amount": 240,
        "wht": 10.0,
        "ext_amount": 56,
        "ext": 12.5,
        "ext_type": "inclusive",
        "gross_payout": 2842,
        "net_payout": 2602,
        "currency": "USD",
        "atag": "atag_value",
        "rtag": null,
        "ticket_type": "quickbet",
    },
}

```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Reserve the ticket

Is used when player reserves a ticket (betslip). It creates a not wagered ticket. Once the player pays for the ticket its status is changed to open. In case of not successful response a `ticket_discard` action will be called. In case of not successful call of `ticket_discard` action, call should be repeated after 30 mins.

Request fields:

<table><thead><tr><th width="210">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket identification number</td></tr><tr><td>ticket_code</td><td>string</td><td>Ticket code</td></tr><tr><td>player_id</td><td>string</td><td>Player identification number or code</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket stake. Should be in integer format (cents). For example, for stake <code>33.45</code> the value will be <code>3345</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>4.55</code> the value will be <code>455</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>) </td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value will be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional Affiliate Tag or Affiliate ID</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. </td></tr><tr><td>ticket_type</td><td>string</td><td>Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>)</td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_reserve",
    "data": {
        "operator": "acme",
        "ticket_id": "668ef666333180bba97f0c93",
        "ticket_code": "CD4BDD",
        "player_id": "sometokenvalue",
        "psp": "mobile",
        "price": 500,
        "stake": 444,
        "wht_amount": 240,
        "wht": 10.0,
        "ext_amount": 56,
        "ext": 12.5,
        "ext_type": "inclusive",
        "gross_payout": 2842,
        "net_payout": 2602,
        "currency": "USD",
        "atag": null,
        "rtag": "rh3hg434h32",
        "ticket_type": "quickbet",
    },
}

```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Update the ticket

Is used only for `jackpot` ticket (betslip).

Request fields:

<table><thead><tr><th width="169">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket identification number</td></tr><tr><td>ticket_code</td><td>string</td><td>Ticket code</td></tr><tr><td>player_id</td><td>string</td><td>Player identification number or code</td></tr><tr><td>psp</td><td>string</td><td>Payment service provider or method used to pay for the ticket. E.g mobile, brite, pawapay</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>integer</td><td>Ticket stake. Should be in integer format (cents). For example, for stake <code>33.45</code> the value will be <code>3345</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax amount. Should be in integer format (cents). For example, for withholding tax amount <code>4.55</code> the value will be <code>455</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax amount. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>) </td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value will be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr><tr><td>currency</td><td>string</td><td>Currency code in <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO 4217</a> three letter format</td></tr><tr><td>atag</td><td>string or null</td><td>Optional Affiliate Tag or Affiliate ID</td></tr><tr><td>rtag</td><td>string or null</td><td>Optional referral Tag or referral ID. </td></tr><tr><td>ticket_type</td><td>string</td><td>Ticket Type (see <a data-mention href="/bet-engine-api/fields">Fields</a>) </td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_update",
    "data": {
        "operator": "acme",
        "ticket_id": "668ef666333180bba97f0c93",
        "ticket_code": "CD4BDD",
        "player_id": "sometokenvalue",
        "price": 500,
        "stake": 444,
        "wht_amount": 240,
        "wht": 10.0,
        "ext_amount": 56,
        "ext": 12.5,
        "ext_type": "inclusive",
        "gross_payout": 2842,
        "net_payout": 2602,
        "currency": "USD",
        "atag": "atag_value",
        "rtag": null,
        "ticket_type": "quickbet",
    },
}

```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Close the ticket

Is used to notify Partner the ticket status is closed. Request is sent with 24 hours delay after `ticket_win` , `ticket_lost` , `ticket_void` , `ticket_refund` request. During this period rollbacks could be sent.

Request fields:

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket id</td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_closed", 
    "data": {
        "operator": "operator-code",
        "ticket_id": "1330556611374148608"
    }
}
```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Refund the ticket

This request is needed when the ticket is declined after transaction is processed on Partner's side Request.

Request fields:

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket id</td></tr><tr><td>reason</td><td>string</td><td>Reason for <code>refund</code> action</td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_refund", 
    "data": {
        "operator": "operator-code",
        "ticket_id": "1330556611374148608",
        "reason": "some-reason"
    }
}
```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Win the ticket

The request is made when player's ticket is won or cashed out.

Request fields:

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket id</td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_win", 
    "data": {
        "operator": "operator-code",
        "ticket_id": "1330556611374148608"
    }
}
```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Lose the ticket

The request is made when ticket is lost.

Request fields:

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket id</td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_lost", 
    "data": {
        "operator": "operator-code",
        "ticket_id": "1330556611374148608"
    }
}
```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Void the ticket

This request is made when ticket is voided.

Request fields:

<table><thead><tr><th width="170">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket id</td></tr><tr><td>price</td><td>integer</td><td>Ticket price. Should be in integer format (cents). For example, for price <code>35.00</code> the value will be <code>3500</code></td></tr><tr><td>stake</td><td>float</td><td>Ticket stake. Should be in integer format (cents). For example, for stake <code>33.45</code> the value will be <code>3345</code></td></tr><tr><td>wht_amount</td><td>integer</td><td>Player withholding tax. Should be in integer format (cents). For example, for withholding tax amount <code>4.55</code> the value will be <code>455</code></td></tr><tr><td>wht</td><td>float</td><td>Player withholding tax percentage. For example, for withholding tax percentage <code>20.0%</code> the value should be <code>20.0</code></td></tr><tr><td>ext_amount</td><td>integer</td><td>Ticket exercise tax. Should be in integer format (cents). For example, for exercise tax amount <code>1.25</code> the value will be <code>125</code></td></tr><tr><td>ext</td><td>float</td><td>Ticket exercise tax percentage. For example, for exercise tax percentage <code>12.5%</code> the value should be <code>12.5</code></td></tr><tr><td>ext_type</td><td>string</td><td>Exercise tax type (see <a data-mention href="/bet-engine-api/fields">Fields</a>) </td></tr><tr><td>gross_payout</td><td>integer</td><td>Ticket gross payout. Should be in integer format (cents). For example, for gross payout <code>30.45</code> the value will be <code>3045</code></td></tr><tr><td>net_payout</td><td>integer</td><td>Ticket net payout. Should be in integer format (cents). For example, for net payout <code>30.45</code> the value should be <code>3045</code></td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_void", 
    "data": {
        "operator": "operator-code",
        "ticket_id": "668ef666333180bba97f0c93",
        "price": 500,
        "stake": 444,
        "wht_amount": 240,
        "wht": 10.0,
        "ext_amount": 56,
        "ext": 12.5,
        "ext_type": "inclusive",
        "gross_payout": 2842,
        "net_payout": 2602
    }
}
```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Discard the ticket

This method is triggered in case of fail during `ticket_create` procedure. Currently there could be two main reasons resulting in this method: connection lost or unsatisfactory result.

Request fields:

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket id</td></tr><tr><td>reason</td><td>string</td><td>Reason for <code>discard</code> action</td></tr></tbody></table>

Sample request:

```json
{
    "action": "ticket_discard", 
    "data": {
        "operator": "operator-code",
        "ticket_id": "1330556611374148608",
        "reason": "some-reason"
    }
}
```

Sample response:

```
Response: 200
Doesn't require any payload
```


# Rollback the ticket

The request is used in case Bet Engine made a ticket’s rollback.&#x20;

Rollback happens when the ticket is originally set one way, but later (can be minutes or sometimes even days after) the results are changed and the ticket is set differently. A ticket’s rollback means that ticket status changes to the previous ticket status (open) and then it can be set to the opposite. After successful response Bet Engine should make a `ticket_win` / `ticket_lost` / `ticket_void` request.

Request fields:

<table><thead><tr><th width="129">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>string</td><td>Name of the operator as registered on the system</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket id</td></tr><tr><td>reason</td><td>string</td><td>Reason for <code>rollback</code> action</td></tr></tbody></table>

Sample request:

```json
[
    "action": "ticket_rollback", 
    "data": {
        "operator": "operator-code",
        "ticket_id": "1330556611374148608",
        "reason": "some-reason"
    }
}
```

Sample response:

```
Response: 200
Doesn't require any payload
```


# SMS notifications


# Headers

In all requests for all types three headers will be sent:

<table><thead><tr><th width="186">Attribute</th><th width="536">Description</th></tr></thead><tbody><tr><td><code>timestamp</code></td><td>The unix time stamp</td></tr><tr><td><code>operator-name</code></td><td>Operator name</td></tr><tr><td><code>signature</code></td><td>Signature of incoming request body and secret key (HMAC)</td></tr></tbody></table>

By checking signature in request you may confirm that the notification came from us.

Detailed info about how to calculate signature may be found on [Signature](/sms-notifications/signature) page.


# Signature

Generate HMAC hash signature to check that SMS notification is actually coming from us.

The Signature is calculated based on the `timestamp`, `request body` and your `Secret Key` with HMAC hash using SHA256 Algorithm.&#x20;

Here is an example on how to generate the Signature for `otp` type with `Secret Key=12345ABCDE`, `timestamp=1706191612` and following request body:

```json
{
  "type": "otp",
  "data": {
    "code": "1234",
    "msisdn": "+260977223120"
  }
}
```

In order to generate the Signature all spaces must be removed from the request body:

```json
{"type":"otp","data":{"code":"1234","msisdn":"+260977223120"}}
```

{% hint style="info" %}
Please note that the order of the fields matters for calculating the signature. It will always be `type` first then `data`. Fields in `data` must be in the same order they are listed on doc pages for types.
{% endhint %}

Then message for HMAC algorithm has to be formed using following template:

```
{timestamp}{request body with removed spaces}
```

So the message should look like the following:

```
1706191612{"type":"otp","data":{"code":"1234","msisdn":"+260977223120"}}
```

The computed Signature for this request is:

```
46b1ec8d2a05129bb57c8256f2cdd3029b2cf72dbed57f0d3eedd6b156573433
```

A free online HMAC Generator for testing is available on <https://www.freeformatter.com/hmac-generator.html#before-output>.&#x20;

Here is how we calculated the Signature from above example using **Free Formatter**

<figure><img src="https://2027057513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKuxm6ysd27rN14uEAtGy%2Fuploads%2Fes42zt6oRO8i8Zv0tDAp%2Fimage.png?alt=media&amp;token=52ab6c3a-d81e-45c1-89f1-bb07f43d4c8d" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Your `Secret Key` is located on your API Settings page. Login to Betstack to access your `Secret Key`
{% endhint %}

<figure><img src="https://2027057513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKuxm6ysd27rN14uEAtGy%2Fuploads%2Fe5aGzX5mkTtACXh9j4Ee%2Fsecret-Key.png?alt=media&amp;token=7a7a76a8-c5ea-4821-986f-e015fb624c4b" alt=""><figcaption><p>Secret Key is locate in API Settings profile page</p></figcaption></figure>


# Notification types

We now support 2 notiifcation types:

* [otp](/sms-notifications/notification-types/otp) - this notifications will always be sent and can not be turned off.
* [ticket\_status](/sms-notifications/notification-types/ticket_status) - this notifications can be turned on/off on `Notifications` page in Betstack.


# otp

Request fields:

<table><thead><tr><th width="210">Attribute</th><th width="149">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>string</td><td>OTP code</td></tr><tr><td>msisdn</td><td>string</td><td>MSISDN</td></tr></tbody></table>

Sample `otp` request:

```json
{
  "type": "otp",
  "data": {
    "code": "1234",
    "msisdn": "+260977223120"
  }
}
```

Response fields:

<table><thead><tr><th width="210">Attribute</th><th width="149">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td>Response message. It can be any text</td></tr></tbody></table>

Sample response (status=200) to `otp` request:

```json
{
  "message": "Notification received"
}
```


# ticket\_status

Request fields:

<table><thead><tr><th width="210">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>ticket_code</td><td>string</td><td>Ticket code</td></tr><tr><td>ticket_id</td><td>string</td><td>Ticket identification number</td></tr><tr><td>msisdn</td><td>string</td><td>MSISDN</td></tr><tr><td>status</td><td>result</td><td>Ticket Status. Can be one of: <code>open</code>, <code>resulted</code></td></tr><tr><td>result</td><td>result</td><td>Ticket Result. Can be one of: <code>pending</code>, <code>won</code>, <code>lost</code>, <code>void</code></td></tr></tbody></table>

Sample `ticket_status` request:

```json
{
  "type": "ticket_status",
  "data": {
    "ticket_code": "AB1234",
    "ticket_id": "66a62424b1770731244c1f3f",
    "msisdn": "213456451",
    "status": "open",
    "result" : "pending"
  }
}
```

{% hint style="info" %}
`open` status will be sent only for tickets which were initially reserved.
{% endhint %}

Response fields:

<table><thead><tr><th width="210">Attribute</th><th width="149">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td>Response message. It can be any text</td></tr></tbody></table>

Sample response (status=200) to `ticket_status` request:

```json
{
  "message": "Notification received"
}
```


# bet\_result (not supported)

Request fields:

<table><thead><tr><th width="210">Attribute</th><th width="117">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>ticket_id</td><td>string</td><td>Ticket identification number</td></tr><tr><td>result</td><td>string</td><td>Bet Result. Can be one of: <code>won</code>, <code>lost</code>, <code>void</code></td></tr><tr><td>event_id</td><td>integer</td><td>Event ID</td></tr><tr><td>bet_id</td><td>integer</td><td>Bet ID</td></tr></tbody></table>

Sample `bet_result` request:

```json
{
  "type": "bet_result",
  "data": {
    "ticket_id": "6549197db70d9c7f28c2a57e",
    "result": "lost",
    "event_id": 100001,
    "bet_id": 11
  }
}
```

Response fields:

<table><thead><tr><th width="210">Attribute</th><th width="149">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>string</td><td>Response message. It can be any text</td></tr></tbody></table>

Sample response (status=200) to `bet_result` request:

```json
{
  "message": "Notification received"
}
```


