Starnet.MontenegroTaxationAuthority.WebApi

<back to all web services

ReportBetCancellations

The following routes are available for this service:
POST/bets/cancel
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 RollbackTransactionType(IntEnum):
    BET = 0
    WIN = 1
    JACKPOT = 1


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RollbackDto(TransactionDtoBase):
    rollback_transaction_id: Optional[str] = None
    ticket_id: Optional[str] = None
    rollback_transaction_type: Optional[RollbackTransactionType] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ReportBetCancellations:
    bet_cancellations: Optional[RecordList[RollbackDto]] = None


T = TypeVar('T')


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

Python ReportBetCancellations 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/cancel HTTP/1.1 
Host: api.prod-mnta.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	betCancellations: 
	[
		{
			rollback_transaction_id: String,
			ticket_id: String,
			rollback_transaction_type: 0,
			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
	}
}