| POST | /cmd/slips |
|---|
"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 BettingApp {
/** @param {{name?:string,version?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
name;
/** @type {string} */
version;
}
export class RefEx extends Ref {
/** @param {{data?:RecordDictionary<string, string>,id?:string,val?:string}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {RecordDictionary<string, string>} */
data;
}
export class Origin {
/** @param {{application?:BettingApp,ip?:string,organization?:RefEx,region?:Ref,locationGroup?:Ref,location?:RefEx,device?:RefEx,clerk?:Ref}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {BettingApp} */
application;
/** @type {string} */
ip;
/** @type {RefEx} */
organization;
/** @type {Ref} */
region;
/** @type {Ref} */
locationGroup;
/** @type {RefEx} */
location;
/** @type {RefEx} */
device;
/** @type {Ref} */
clerk;
}
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;
}
export class ProductInstanceRef {
/** @param {{id?:string,name?:string,title?:string,product?:ProductReference}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
id;
/** @type {string} */
name;
/** @type {string} */
title;
/** @type {ProductReference} */
product;
}
export class PayinRecap {
/** @param {{currency?:string,payin?:number,payinTaxationPolicyRef?:Ref,taxAmount?:number,stake?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
currency;
/** @type {number} */
payin;
/** @type {Ref} */
payinTaxationPolicyRef;
/** @type {number} */
taxAmount;
/** @type {number} */
stake;
}
export class PayoutRecap {
/** @param {{currency?:string,winnings?:number,winningsTaxationPolicyRef?:Ref,taxAmount?:number,payout?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
currency;
/** @type {number} */
winnings;
/** @type {Ref} */
winningsTaxationPolicyRef;
/** @type {number} */
taxAmount;
/** @type {number} */
payout;
}
export class BetRequest {
/** @param {{betId?:string,productInstance?:ProductInstanceRef,payload?:{ [index:string]: string; },payinRecap?:PayinRecap,possiblePayoutRecap?:PayoutRecap}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
betId;
/** @type {ProductInstanceRef} */
productInstance;
/** @type {{ [index:string]: string; }} */
payload;
/** @type {PayinRecap} */
payinRecap;
/** @type {PayoutRecap} */
possiblePayoutRecap;
}
export class SubmitSlip {
/** @param {{id?:string,bettor?:Ref,origin?:Origin,betRequests?:BetRequest[],headerData?:{ [index:string]: string; }}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
id;
/** @type {Ref} */
bettor;
/** @type {Origin} */
origin;
/** @type {BetRequest[]} */
betRequests;
/** @type {{ [index:string]: string; }} */
headerData;
}
class Dictionary {}
/** @typedef TKey {any} */
/** @typedef TVal {any} */
export class RecordDictionary extends Dictionary {
constructor(init) { super(init); Object.assign(this, init) }
}
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 /cmd/slips HTTP/1.1
Host: api.sbbet.ath.cx
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: String,
bettor:
{
id: String,
val: String
},
origin:
{
application:
{
name: String,
version: String
},
ip: String,
organization:
{
data:
{
String: String
},
id: String,
val: String
},
region:
{
id: String,
val: String
},
locationGroup:
{
id: String,
val: String
},
location:
{
data:
{
String: String
},
id: String,
val: String
},
device:
{
data:
{
String: String
},
id: String,
val: String
},
clerk:
{
id: String,
val: String
}
},
betRequests:
[
{
betId: String,
productInstance:
{
id: String,
name: String,
title: String,
product:
{
id: String,
value: String,
category: String,
productProvider:
{
id: String,
val: String
}
}
},
payload:
{
String: String
},
payinRecap:
{
currency: String,
payin: 0,
payinTaxationPolicyRef:
{
id: String,
val: String
},
taxAmount: 0,
stake: 0
},
possiblePayoutRecap:
{
currency: String,
winnings: 0,
winningsTaxationPolicyRef:
{
id: String,
val: String
},
taxAmount: 0,
payout: 0
}
}
],
headerData:
{
String: 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
}
}