One of the ways Unibo offers to payout a prize is by using rewards predefined in the platform itself. We can fetch the list of available rewards, allowing the user to choose the Reward from a drop down list in the backoffice and then later send a request to the platform in order to execute it for given player_id.
In cases such as these:
- We will periodically check what rewards are available for given casino (generally every minute)
- We sync them with our local state, while also removing (mark as not available) the ones that are no longer there.
- In the backoffice the user can choose the Reward they want to trigger as a prize payout and we also set up how it should be displayed for players (in overlay):
- Catalog Item: Basically can be anything, you set up a title displayed for players per language and a value of the prize used for reporting
- Free Spins: User will write how many FS in which games, this is primarily for Unibo to be able to print it in the Terms and Conditions and in the overlay information.
- Cash/Bonus: Essentially an amount
- Once the campaign is going to payout the prize, it just sends the request to execute reward for given player id.
In order to run Jackpots we'll need a way to payout a Cash Prize with dynamic amount/currency for particular player.
Here's the list of some other calls we make for different platforms to pay a prize
Unibo -> POST /api/prizes/cash
- player_id
- amount
- currency
Unibo -> PUT /api/prizes/{player_id}/depositbonus/{bonus_code_for_given_currency}
Unibo -> POST /api/prizes/freespins
- player_id
- number_of_freespins
- list_of_game_ids
- bonus_code_for_currency / currency
Unibo -> POST /api/prizes/bonusmoney
- player_id
- amount
- bonus_code_for_currency / currency
For authorization we use simple API Key in the request headers.
For making sure we do not payout prize twice when our "retry" mechanism kicks in (optional, but sometimes APIs just dies so auto-retry works good) we make use of idempotency, so every prize payout has unique id in the headers that we send in a request, this way it can be ignored by a platform once it already processed it once but somehow responded with an error (usually timeout or other kinds of connection drops).