Contribution Sources

Contribution Sources are a concept in ThrillPots that allow operators create well-known identifiers for one or more Jackpot Instances. A contribution source is bound to an operator and brand ID.

Contribution Sources are valid targets/identifiers for jackpot contribution bets (as described in the Contributing to Jackpots section).

Why use sources instead of Jackpot Instance IDs

Sources provide a mechanism of indirection to Jackpot Instances. Since a Source will usually have a well-known and human-defined identifier, and can represent one or more Jackpot Instances at any point in time, they provide a very convenient way for Integrating services and frontends to work with Jackpot Instances.

For example, instead of hard coding a specific Jackpot Instance ID into your frontend or backend services, you can simply configure the more human-readable source_id and use the Source to determine at runtime which Jackpot Instance ID is being used. This is especially useful when Jackpot models are changed over time since your integrated product will not need to be modified unless there is a fundamental structural change to the jackpot itself (which is rarely the case).

Example

An early, but very common use-case Contribution Source can be seen below, where a Source has been created for Operator thrilltech, Brand brand1 and is the source for the "site wide casino jackpot".

In this case, the contribution flow would look like this:

┌──────────────────────────────┐
│Contribution to Source Request│   (POST https://thrillpots_gateway_host/jackpots/contribute/source)
└──────────────┬───────────────┘
               │                
               │                
               │                
               ▼                
           ┌────────┐           
           │ Source │           
           └────────┘           
               │                
               │                
               │                
               ▼                
      ┌──────────────────┐      
      │ Jackpot Instance │      
      └──────────────────┘      

Under the covers (in the data), this Contribution Source will most probably look something like this:

{
  "owner_id": "thrilltech:brand1",
  "source_name": "Casino Sitewide Source",
  "source_id": "sitewide-casino",
  "jackpots": [
    {
      "priority": {
        "$numberLong": "0"
      },
      "owner_id": "thrilltech:brand1",
      "instance_id": "12231b6a-a774-4a93-8f16-f8af9aee2076"
    }
  ]
}

The jackpots array in this Contribution contains a single Jackpot Instance ID because in this case, there is only one Jackpot Instance required. We will discuss use cases where having multiple Jackpot Instances in this array can be useful.

Retrieving the Jackpot Instance from a source

To retrieve that relevant Jackpot Instance for a specific source, you can use the following methods:

ThrillPots Gateway

GET /jackpots/instances/source/:source_id/brand/:brand_id?player_id=:player_id

The parameters in the url above are:

ParameterDescription
source_idThe Source ID (for example, sitewide-casino from the example above)
brand_idThis is the identifier for the brand in question, which is comprised of the operator_id:brand_id pairing
player_id[OPTIONAL] If a player_id is specified, the returned Jackpot Instance will also contain the opt-in details for the specified player

ThrillConnect (used by the Frontend)

GET /v1/thrillpots/instances/source/:source_id/brand/:brand_id?player_id=:player_id

The parameters in the url above are the same as for ThrillPots Gateway:

ParameterDescription
source_idThe Source ID (for example, sitewide-casino from the example above)
brand_idThis is the identifier for the brand in question, which is comprised of the operator_id:brand_id pairing
player_id[OPTIONAL] If a player_id is specified, the returned Jackpot Instance will also contain the opt-in details for the specified player

Retrieving all sources in the System

To retrieve a list of sources for a specific operator brand, you can use one of the following methods:

ThrillPots Gateway

GET /sources?owner_id=:brand_id

The brand_id parameter in the URL is once again comprised of the operator_id:brand_id pair which identifies a specific brand. If any sources have been configured for the operator_id:brand_id specified, they will be returned in a response which contains a list of Source JSON objects and will look similar to this example:

[
    {
        "owner_id": "thrilltech:brand1",
        "source_name": "Casino Sitewide Source",
        "source_id": "sitewide-casino",
        "jackpots": [
            {
                "priority": 0,
                "owner_id": "thrilltech:brand1",
                "instance_id": "12231b6a-a774-4a93-8f16-f8af9aee2076"
            }
        ]
    }
]

ThrillConnect (used by the Frontend)

GET /v1/thrillpots/sources?owner_id=:brand_id

As in the ThrillPots Gateway example above, the brand_id parameter in the URL is once again comprised of the operator_id:brand_id pair which identifies a specific brand. The response payload will look exactly the same as the response from the ThrillPots Gateway service above.