FBiHBetting.Aggregator.WebApi

<back to all web services

ReportBetPlacements

The following routes are available for this service:
POST/bets/place
"use strict";
export class BettorState {
    /** @param {{id?:string,accountBalanceBeforeBet?:number,accountBalanceAfterBet?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {number} */
    accountBalanceBeforeBet;
    /** @type {number} */
    accountBalanceAfterBet;
}
export class Reference {
    /** @param {{id?:string,value?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    value;
}
/** @typedef {number} */
export var ProductCategory;
(function (ProductCategory) {
    ProductCategory[ProductCategory["Sportsbook"] = 0] = "Sportsbook"
    ProductCategory[ProductCategory["RNG"] = 1] = "RNG"
})(ProductCategory || (ProductCategory = {}));
export class ProductReference {
    /** @param {{id?:string,value?:string,category?:ProductCategory,productProvider?:Reference}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    value;
    /** @type {ProductCategory} */
    category;
    /** @type {Reference} */
    productProvider;
}
export class ProductInstanceRef {
    /** @param {{id?:string,name?:string,product?:ProductReference}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    name;
    /** @type {ProductReference} */
    product;
}
export class Origin {
    /** @param {{device?:Reference,location?:Reference,locationGroup?:Reference,organization?:Reference,productInstance?:ProductInstanceRef}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {Reference} */
    device;
    /** @type {Reference} */
    location;
    /** @type {Reference} */
    locationGroup;
    /** @type {Reference} */
    organization;
    /** @type {ProductInstanceRef} */
    productInstance;
}
/** @typedef {number} */
export var PaymentOrigin;
(function (PaymentOrigin) {
    PaymentOrigin[PaymentOrigin["POS"] = 0] = "POS"
    PaymentOrigin[PaymentOrigin["SMS"] = 1] = "SMS"
    PaymentOrigin[PaymentOrigin["Internet"] = 2] = "Internet"
})(PaymentOrigin || (PaymentOrigin = {}));
export class PayinRecap {
    /** @param {{payin?:number,taxAmount?:number,stake?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    payin;
    /** @type {number} */
    taxAmount;
    /** @type {number} */
    stake;
}
export class PayoutRecap {
    /** @param {{winnings?:number,taxAmount?:number,payout?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    winnings;
    /** @type {number} */
    taxAmount;
    /** @type {number} */
    payout;
}
export class BetPlacement {
    /** @param {{id?:string,betCode?:string,bettorState?:BettorState,origin?:Origin,betIssuedAt?:string,isLive?:boolean,isSystemBet?:boolean,payload?:{ [index:string]: string; },paymentOrigin?:PaymentOrigin,payinRecap?:PayinRecap,possiblePayoutRecap?:PayoutRecap}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    betCode;
    /** @type {BettorState} */
    bettorState;
    /** @type {Origin} */
    origin;
    /** @type {string} */
    betIssuedAt;
    /** @type {boolean} */
    isLive;
    /** @type {boolean} */
    isSystemBet;
    /** @type {{ [index:string]: string; }} */
    payload;
    /** @type {PaymentOrigin} */
    paymentOrigin;
    /** @type {PayinRecap} */
    payinRecap;
    /** @type {PayoutRecap} */
    possiblePayoutRecap;
}
export class ReportBetPlacements {
    /** @param {{betPlacements?:BetPlacement[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {BetPlacement[]} */
    betPlacements;
}

JavaScript ReportBetPlacements 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/place HTTP/1.1 
Host: fbihtaapi.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	betPlacements: 
	[
		{
			id: String,
			betCode: String,
			bettorState: 
			{
				id: String,
				accountBalanceBeforeBet: 0,
				accountBalanceAfterBet: 0
			},
			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
						}
					}
				}
			},
			betIssuedAt: 0001-01-01,
			isLive: False,
			isSystemBet: False,
			payload: 
			{
				String: String
			},
			paymentOrigin: 0,
			payinRecap: 
			{
				payin: 0,
				taxAmount: 0,
				stake: 0
			},
			possiblePayoutRecap: 
			{
				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
	}
}