Odds

The emBET SDK provides a functionality for the integrator to pass the odds data to the SDK. You are fully in charge of providing and updating odds, betting markets, outcomes, etc...​

embet.updateOdds(payload);

The payload passed to the updateOdds() function needs to adhere to the following structure.

[
    {
        "marketId": "1",
        "marketName": "1x2",
        "description": "1x2",
        "specifiers": null,
        "isDisplayed": true,
        "marketOptions": [
            {
                "outcomeId": "1",
                "description": "RBL",
                "betPlacementDescription": "RBL",
                "odds": "1.94",
                "state": "live"
            },
            {
                "outcomeId": "2",
                "description": "Draw",
                "betPlacementDescription": "Draw",
                "odds": "3.75",
                "state": "live"
            },
            {
                "outcomeId": "3",
                "description": "B04",
                "betPlacementDescription": "B04",
                "odds": "3.35",
                "state": "live"
            }
        ]
    },
    {
        "marketId": "2",
        "marketName": "Total",
        "description": "Total",
        "specifiers": "total_2.5",
        "isDisplayed": true,
        "marketOptions": [
            {
                "outcomeId": "4",
                "description": "O 2.5",
                "betPlacementDescription": "O 2.5",
                "odds": "1.17",
                "state": "live"
            },
            {
                "outcomeId": "5",
                "description": "U 2.5",
                "betPlacementDescription": "U 2.5",
                "odds": "4.1",
                "state": "live"
            }
        ]
    },
    {
        "marketId": "2",
        "marketName": "Total",
        "description": "Total",
        "specifiers": "total_3.5",
        "isDisplayed": false,
        "marketOptions": [
            {
                "outcomeId": "4",
                "description": "O 3.5",
                "betPlacementDescription": "O 3.5",
                "odds": "2.3",
                "state": "suspended"
            },
            {
                "outcomeId": "5",
                "description": "U 3.5",
                "betPlacementDescription": "U 3.5",
                "odds": "1.5",
                "state": "live"
            }
        ]
    }
]

Attributes

  • marketId: Represents the ID of the market.
  • marketName: Represents the name of the market.
  • description: Represents an alternate name of the market.
  • specifiers: Represents the specifiers that make a market unique (Total 2.5, Total 3.5, etc.)
  • isDisplayed: Indicates if this market should be shown in the list or not. For markets with specifiers this is also used to group those markets together into an expandable list.
  • marketOptions: Represents the outcomes for each market.
    • outcomeId: Represents the ID of the outcome.
    • description: Represents the name of the outcome.
    • betPlacementDescription: Represents the name of the outcome used in the betslip view.
    • odds: Represents the current odds for the outcome.
    • state: Indicates if the outcome is currently active or suspended.