Monkey Bytes - Gain, entertain, retain

Back end

Settle bets

https:/{your_server}/winners Is called when a tournament ends, and prize distribution is requested.

A list of all participants in the tournament will be given, whether they won anything or not. If the endpoint responds with an error message, the tournament will fail to close, and might try again later.

Your endpoint should distribute the given winnings to the listed teams and respond with an OK.


{
  headers: {
    authorization: 'Bearer %customer% {admin_token}'
  },
  body: {
    pools: [{
      pool: {                         // Data about betting pool (tournament)
        client: String,               // Name of white label, not necessarily yours
        game: String,                 // Type of game being played. Should be "fantasy"
        uid: Integer,                 // Id of tournament, unique within game scope
        overdraw: String <Decimal>,   // Total payout under your label
      },
      bets: [{                        // You will only receive data for your own users
        user: {                       // Data about the user owning the fantasy team
          client: String,             // Name of white label, always yours
          uid: String,                // Unique ID of user
          name: String                // Username
        },
        bet: {                        // Data about the bet being made (fantasy team)
          uid: Integer,               // Id of the fantasy team, unique within game scope
          amount: String <Decimal>,   // Buy-in
          rake: String <Decimal>,     // Rake
          payout: String <Decimal>,   // How much the team won. Can be 0.
          ticket: String <optional>   // Ticket token (see appendix earlier)
        }
      }]
    }]
  }
}
Previous
Create bet