Starnet.MontenegroTaxationAuthority.WebApi

<back to all web services

ReportBetPayouts

The following routes are available for this service:
POST/bets/payout
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


class WinType(IntEnum):
    REGULAR = 0
    CASHBACK = 1
    CASHOUT = 2


class IBetEvent:
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WinDto(TransactionDtoBase):
    bet_transaction_id: Optional[str] = None
    ticket_id: Optional[str] = None
    win_odds: Decimal = decimal.Decimal(0)
    win_type: Optional[WinType] = None
    bonus: Decimal = decimal.Decimal(0)
    cancel: bool = False
    canceled_events: Optional[RecordList[IBetEvent]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ReportBetPayouts:
    bet_payouts: Optional[RecordList[WinDto]] = None


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RecordList(Generic[T], List[T]):
    pass

Python ReportBetPayouts DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /bets/payout HTTP/1.1 
Host: api.prod-mnta.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	betPayouts: 
	[
		{
			bet_transaction_id: String,
			ticket_id: String,
			win_odds: 0,
			win_type: 0,
			bonus: 0,
			cancel: False,
			canceled_events: 
			[
				{
					
				}
			],
			transaction_id: String,
			transaction_time: 0001-01-01,
			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/jsv
Content-Length: length

{
	errorCode: String,
	message: String,
	stackTrace: String,
	errors: 
	[
		{
			errorCode: String,
			fieldName: String,
			message: String,
			meta: 
			{
				String: String
			}
		}
	],
	meta: 
	{
		String: String
	}
}