| POST | /bets/place |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
class BetSource(IntEnum):
LANDBASE = 0
WEB = 1
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransactionDtoBase:
transaction_id: Optional[str] = None
transaction_time: datetime.datetime = datetime.datetime(1, 1, 1)
transaction_amount: Decimal = decimal.Decimal(0)
game_name: Optional[str] = None
betting_place_id: Optional[str] = None
betting_terminal_id: Optional[str] = None
jmbg: Optional[str] = None
passport_number: Optional[str] = None
source: Optional[BetSource] = None
identification_document_country: Optional[str] = None
identification_document_type: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TicketDto:
sy: Optional[str] = None
nc: int = 0
ac: Decimal = decimal.Decimal(0)
e: Optional[RecordList[RecordList[IBetEvent]]] = None
class BetType(IntEnum):
REAL = 0
PROMO = 1
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BetDto(TransactionDtoBase):
min_odds: Decimal = decimal.Decimal(0)
max_odds: Decimal = decimal.Decimal(0)
min_win: Decimal = decimal.Decimal(0)
max_win: Decimal = decimal.Decimal(0)
min_bonus: Decimal = decimal.Decimal(0)
max_bonus: Decimal = decimal.Decimal(0)
max_payout: Decimal = decimal.Decimal(0)
promo_amount: Decimal = decimal.Decimal(0)
ticket_id: Optional[str] = None
ticket: Optional[TicketDto] = None
bet_type: Optional[BetType] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ReportBetPlacements:
bet_placements: Optional[RecordList[BetDto]] = None
T = TypeVar('T')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RecordList(Generic[T], List[T]):
pass
Python ReportBetPlacements DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /bets/place HTTP/1.1
Host: api.prod-mnta.webhop.biz
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"betPlacements":[{"min_odds":0,"max_odds":0,"min_win":0,"max_win":0,"min_bonus":0,"max_bonus":0,"max_payout":0,"promo_amount":0,"ticket_id":"String","ticket":{"sy":"String","nc":0,"ac":0,"e":[[{}]]},"bet_type":0,"transaction_id":"String","transaction_time":"0001-01-01T00:00:00.0000000Z","transaction_amount":0,"game_name":"String","betting_place_id":"String","betting_terminal_id":"String","jmbg":"String","passport_number":"String","source":0,"identification_document_country":"String","identification_document_type":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}