Betting.WebApi

<back to all web services

InstallProductInstance

Requires Authentication
The following routes are available for this service:
POST/cmd/products/instances
"use strict";
export class Ref {
    /** @param {{id?:string,val?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    val;
}
export class ProductReference {
    /** @param {{id?:string,value?:string,category?:string,productProvider?:Ref}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    value;
    /** @type {string} */
    category;
    /** @type {Ref} */
    productProvider;
}
/** @typedef {number} */
export var PayinConstraintType;
(function (PayinConstraintType) {
    PayinConstraintType[PayinConstraintType["SingleBet"] = 0] = "SingleBet"
    PayinConstraintType[PayinConstraintType["MultiBet"] = 1] = "MultiBet"
    PayinConstraintType[PayinConstraintType["SystemBet"] = 2] = "SystemBet"
})(PayinConstraintType || (PayinConstraintType = {}));
export class Money {
    /** @param {{amount?:number,currency?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    amount;
    /** @type {string} */
    currency;
}
export class PayinConstraint {
    /** @param {{type?:PayinConstraintType,min?:Money,default?:Money,warningThreshold?:Money,max?:Money}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {PayinConstraintType} */
    type;
    /** @type {Money} */
    min;
    /** @type {Money} */
    default;
    /** @type {Money} */
    warningThreshold;
    /** @type {Money} */
    max;
}
/** @typedef {number} */
export var WinningsCapType;
(function (WinningsCapType) {
    WinningsCapType[WinningsCapType["SingleBet"] = 0] = "SingleBet"
    WinningsCapType[WinningsCapType["MultiBet"] = 1] = "MultiBet"
    WinningsCapType[WinningsCapType["SystemBet"] = 2] = "SystemBet"
})(WinningsCapType || (WinningsCapType = {}));
export class WinningsCap {
    /** @param {{type?:WinningsCapType,cap?:Money}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {WinningsCapType} */
    type;
    /** @type {Money} */
    cap;
}
export class BettingPolicies {
    /** @param {{payinConstraints?:RecordList<PayinConstraint>,payinTaxationPolicyId?:string,winningsCaps?:RecordList<WinningsCap>,winningsTaxationPolicyId?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {RecordList<PayinConstraint>} */
    payinConstraints;
    /** @type {string} */
    payinTaxationPolicyId;
    /** @type {RecordList<WinningsCap>} */
    winningsCaps;
    /** @type {string} */
    winningsTaxationPolicyId;
}
export class InstallProductInstance {
    /** @param {{id?:string,name?:string,title?:string,product?:ProductReference,currency?:Ref,bettingPolicies?:BettingPolicies,apiUrl?:string,backOfficeUrl?:string,instanceUrl?:string,feedPlayerUrl?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    name;
    /** @type {string} */
    title;
    /** @type {ProductReference} */
    product;
    /** @type {Ref} */
    currency;
    /** @type {BettingPolicies} */
    bettingPolicies;
    /** @type {string} */
    apiUrl;
    /** @type {string} */
    backOfficeUrl;
    /** @type {string} */
    instanceUrl;
    /** @type {string} */
    feedPlayerUrl;
}
/** @typedef T {any} */
export class RecordList extends Array {
    constructor(init) { super(init); Object.assign(this, init) }
}

JavaScript InstallProductInstance DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /cmd/products/instances HTTP/1.1 
Host: api.sbbet.ath.cx 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id":"String","name":"String","title":"String","product":{"id":"String","value":"String","category":"String","productProvider":{"id":"String","val":"String"}},"currency":{"id":"String","val":"String"},"bettingPolicies":{"payinConstraints":[{"type":0,"min":{"amount":0,"currency":"String"},"default":{"amount":0,"currency":"String"},"warningThreshold":{"amount":0,"currency":"String"},"max":{"amount":0,"currency":"String"}}],"payinTaxationPolicyId":"String","winningsCaps":[{"type":0,"cap":{"amount":0,"currency":"String"}}],"winningsTaxationPolicyId":"String"},"apiUrl":"String","backOfficeUrl":"String","instanceUrl":"String","feedPlayerUrl":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

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