Betting.WebApi

<back to all web services

GetSelfServiceDeviceBettingSession

Requires Authentication
The following routes are available for this service:
GET/qry/self-service-device-betting-sessions/{Id}
const std = @import("std");

pub const Ref = struct {
    id: ?[]const u8 = null,
    val: ?[]const u8 = null,
};

pub const SessionStatus = enum(i32) {
    Opening = 1,
    Open = 2,
    Ending = 3,
    Ended = 4,
    Rejected = 5,
};

pub const Money = struct {
    amount: f64 = 0,
    currency: ?[]const u8 = null,
};

pub const TopUpStatus = enum(i32) {
    Pending = 1,
    Completed = 2,
    Failed = 3,
};

pub const SessionTopUp = struct {
    id: ?[]const u8 = null,
    amount: ?Money = null,
    clerk: ?Ref = null,
    status: ?TopUpStatus = null,
    failureReason: ?[]const u8 = null,
};

pub const SelfServiceDeviceBettingSession = struct {
    id: ?[]const u8 = null,
    device: ?Ref = null,
    location: ?Ref = null,
    status: ?SessionStatus = null,
    startedAt: ?[]const u8 = null,
    issuedByClerk: ?Ref = null,
    patronName: ?[]const u8 = null,
    initialCredit: ?Money = null,
    topUps: ?RecordList = null,
    payoutId: ?[]const u8 = null,
    payout: ?Money = null,
    rejectionReason: ?[]const u8 = null,
};

pub const GetSelfServiceDeviceBettingSession = struct {
    id: ?[]const u8 = null,
};

pub fn RecordList(comptime T: type) type {
    _ = T;
    return struct {
        pub const ss_collection = "items";

        items: []T = &.{},
    };

Zig GetSelfServiceDeviceBettingSession 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.

GET /qry/self-service-device-betting-sessions/{Id} HTTP/1.1 
Host: api.testenv.webhop.biz 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	device: 
	{
		id: String,
		val: String
	},
	location: 
	{
		id: String,
		val: String
	},
	status: 1,
	startedAt: 0001-01-01,
	issuedByClerk: 
	{
		id: String,
		val: String
	},
	patronName: String,
	initialCredit: 
	{
		amount: 0,
		currency: String
	},
	topUps: 
	[
		{
			id: String,
			amount: 
			{
				amount: 0,
				currency: String
			},
			clerk: 
			{
				id: String,
				val: String
			},
			status: 1,
			failureReason: String
		}
	],
	payoutId: String,
	payout: 
	{
		amount: 0,
		currency: String
	},
	rejectionReason: String
}