Skip to main content

2.3 Order vs Bet

In the context of MollyBet API, an Order represents a request for placing bets on behalf of the client. It includes, among other options, a desired stake and a minimum price. When an Order is created, MollyBet API will attempt to place one or more bets with a bookmaker.

Bets that are placed with bookmakers are not placed atomically. MollyBet API tries its best to get bet placement to be confirmed with a bookie, and the bet status field (see bet status) is continuously updated to reflect what is the degree of certainty that bet has been placed with the bookmaker, or even whether the bet has been settled.

The MollyBet API Order also has its own independent status field, as well as a closed field. The order closed field is initially false as long as MollyBet API is still trying to fulfil the order, i.e. not all of the desired stake has been confirmed by placed bets. The closed field becomes true when (a) all the stake that the customer requested has been provided by confirmed bets belonging to that order, (b) the order has expired, or (c) the client requested cancellation. The status field (see order status) attempts to summarise the stage of completion and settlement of an order, according to the bets placed and the closed field.

Please note that once a bet has been created, it cannot be cancelled. The status of a bet evolves independently of the Order that created it. When an Order is closed, MollyBet API will stop trying to place more bets, but it will not cancel existing bets already placed.