| POST | /bets/expire |
|---|
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 PayoutRecap:
winnings: Decimal = decimal.Decimal(0)
tax_amount: Decimal = decimal.Decimal(0)
payout: Decimal = decimal.Decimal(0)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BetExpiration:
id: Optional[str] = None
origin: Optional[Origin] = None
bet_expired_at: datetime.datetime = datetime.datetime(1, 1, 1)
payment_origin: Optional[PaymentOrigin] = None
payout_recap: Optional[PayoutRecap] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ReportBetExpirations:
bet_expirations: Optional[List[BetExpiration]] = None
Python ReportBetExpirations DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /bets/expire HTTP/1.1
Host: fbihtaapi.bettor.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
betExpirations:
[
{
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
}
}
}
},
betExpiredAt: 0001-01-01,
paymentOrigin: 0,
payoutRecap:
{
winnings: 0,
taxAmount: 0,
payout: 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
}
}