FBiHBetting.Aggregator.WebApi

<back to all web services

ReportBetCancelations

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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Reference:
    id: Optional[str] = None
    value: Optional[str] = None


class ProductCategory(IntEnum):
    SPORTSBOOK = 0
    RNG = 1


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProductReference:
    id: Optional[str] = None
    value: Optional[str] = None
    category: Optional[ProductCategory] = None
    product_provider: Optional[Reference] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProductInstanceRef:
    id: Optional[str] = None
    name: Optional[str] = None
    product: Optional[ProductReference] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Origin:
    device: Optional[Reference] = None
    location: Optional[Reference] = None
    location_group: Optional[Reference] = None
    organization: Optional[Reference] = None
    product_instance: Optional[ProductInstanceRef] = None


class PaymentOrigin(IntEnum):
    POS = 0
    SMS = 1
    INTERNET = 2


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PayinRecap:
    payin: Decimal = decimal.Decimal(0)
    tax_amount: Decimal = decimal.Decimal(0)
    stake: Decimal = decimal.Decimal(0)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BetCancelation:
    id: Optional[str] = None
    origin: Optional[Origin] = None
    bet_canceled_at: datetime.datetime = datetime.datetime(1, 1, 1)
    payment_origin: Optional[PaymentOrigin] = None
    payin_recap: Optional[PayinRecap] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ReportBetCancelations:
    bet_cancelations: Optional[List[BetCancelation]] = None

Python ReportBetCancelations 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: fbihtaapi.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	betCancelations: 
	[
		{
			id: String,
			origin: 
			{
				device: 
				{
					id: String,
					value: String
				},
				location: 
				{
					id: String,
					value: String
				},
				locationGroup: 
				{
					id: String,
					value: String
				},
				organization: 
				{
					id: String,
					value: String
				},
				productInstance: 
				{
					id: String,
					name: String,
					product: 
					{
						id: String,
						value: String,
						category: 0,
						productProvider: 
						{
							id: String,
							value: String
						}
					}
				}
			},
			betCanceledAt: 0001-01-01,
			paymentOrigin: 0,
			payinRecap: 
			{
				payin: 0,
				taxAmount: 0,
				stake: 0
			}
		}
	]
}
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
	}
}