Operator API

Operator will provide this request to send to provider.

Operator provided API list

Content-Type: application/json, (Require)

POST {OperatorAPIDomain}/authenticate

The Provider system will call this operator API to check the player token generated when player login the game (Refer to the URL Scheme login flow diagram see)

Example: {"app_id": "TEST", "token": "31a250ac789e47123456", "hash": "5e110fcffd42e59726adca5dca20a54d", "timestamp": 1658287156}

Request Body

Name
Type
Description

app_id*

String

Operator unique identifier of player session

token*

String

Operator's unique identification in the BD system (provided by BD)

hash*

String

Encrypt parameter(MD5) see

timestamp*

Int

UNIX timestamp

// Response result
{
    "code": 1000,
    "message": "Success",
    "username": "Testman",
    "balance": 0
}

// Response error
{
    "code": 1003,
    "message": "Invalid appId"
}

Content-Type: application/json, (Require)

POST {OperatorAPIDomain}/getBalance

The Provider system will send this request to get balance from operator.

Example: {"app_id": "TEST","username": "testbowdang01","hash": "5e110fcffd42e59726adca5dca20a54d","timestamp": 1658287156}

Request Body

Name
Type
Description

app_id*

String

Operator unique identifier of player session

username*

String

Player username

hash*

String

Encrypt parameter(MD5) see

timestamp*

Int

UNIX timestamp

// Response result
{
    "code": 1000,
    "message": "Success",
    "username": "Testman",
    "balance": 0
}

// Response error
{
    "code": 1003,
    "message": "Invalid appId"
}

Content-Type: application/json, (Require)

POST {OperatorAPIDomain}/bet

The Provider system will be real time called from operator system while the player is betting to achieve the addition or reduction of player's balance.

Example: {"app_id":"TEST","hash":"a4300e1588f07b4d8cf2ffb0a9ca0f06","transaction_id":"d90699ee-fa1e-4daa-98b7-67c94802bbc0","round_id":1,"ticket_id":1,"username":"testbowdang01","lottery":"HT001","amount":100,"currency":"THB","round_time":"2022-09-12T06:30:00Z""bet_time":"2022-09-12T05:00:00Z","remark":"{"ticket":[{"type":"3 ตัวบน","number":"332","amount":100}]}","timestamp":1662960159}

Request Body

Name
Type
Description

app_id*

String

Operator unique identifier of player session

transaction_id*

String

Unique transaction id (UUID)

ticket_id*

Int

Lottery ticket

username*

String

Player username

amount*

Float

Transfer amount (Must greater than 0)

lottery*

String

Lottery code see

currency

String

Currency code

round_time

Date

Lottery round date (RFC339, UTC+0)

hash*

String

Encrypt parameter(MD5) see

timestamp*

Int

UNIX timestamp

bet_time

Date

Lottery bet date (RFC339, UTC+0)

round_id*

Int

Lottery round

remark

String

Detail about ticket

// Response result
{
    "code": 1000,
    "message": "Success",
    "username": "Testman",
    "balance": 0
}

// Response error
{
    "code": 1003,
    "message": "Invalid appId"
}

Content-Type: application/json, (Require)

POST {OperatorAPIDomain}/cancel-bet

The Provider system will send the transactions when the lottery round is cancelled.

1.Because the huge package requires quite of processing time, recommend that Operator respond (Status Code 1000) to the Provider before the request processing.

2.Operator should use the backup by original request to processing to avoid processing failure. Provider will never resend the same package after receiving a response (Status Code 1000) from Provider.

3.If the request is damaged or cannot be recovered for any reason, please request a backup from BD for manual adjustment.

*If the operator does not send the 1000 status code back to the provider. This request will continue until the 1000 status code is received.

Example: {"app_id":"TEST","hash":"04d9e853241d4ab7c0891fa373aafbbb","transaction_id":"e6a33e42-456d-479f-adcc-417381c1b123","round_id":1,"data":[{"ticket_id":1,"username":"testbowdang01","amount":100,"bet_time":"2022-09-12T05:30:00Z"}],"lottery":"HT001","currency":"THB","round_time":"2022-09-12T06:30:00Z","timestamp":1662960159}

Request Body

Name
Type
Description

app_id*

String

Operator unique identifier of player session

transaction_id*

String

Unique transaction id (UUID)

data*

Array

Ticket information detail

lottery*

String

Lottery code see

currency

String

Currency code

round_time

Date

Lottery round date (RFC339, UTC+0)

hash*

String

Encrypt parameter(MD5) see

timestamp*

Int

UNIX timestamp

ticket_id (data)*

Int

Lottery ticket (This information is in an array)

username (data)*

String

Player username (This information is in an array)

amount (data)*

Float

Transfer amount (This information is in an array)

bet_time (data)

Date

Lottery bet date (RFC339, UTC+0)

round_id*

Int

Lottery round

// Response result
{
    "code": 1000,
    "message": "Success"
}

// Response error
{
    "code": 1003,
    "message": "Invalid appId"
}

Content-Type: application/json, (Require)

POST {OperatorAPIDomain}/settle

The Provider system will be real time called from operator system while payout to achieve the addition or reduction of the system wallet of operator.

1.Because the huge package requires quite of processing time, recommend that Operator respond (Status Code 1000) to the Provider before the request processing.

2.Operator should use the backup by original request to processing to avoid processing failure. Provider will never resend the same package after receiving a response (Status Code 1000) from Provider.

3.If the request is damaged or cannot be recovered for any reason, please request a backup from BD for manual adjustment.

*If the operator does not send the 1000 status code back to the provider. This request will continue until the 1000 status code is received.

Example: {"app_id":"TEST","hash":"04d9e853241d4ab7c0891fa373aafbbb","transaction_id":"5de56636-cc57-481d-b153-f082c11cbfa2","round_id":1,"data":[{"ticket_id":1,"username":"testbowdang01","amount":5000,"bet_time":"2022-09-12T05:30:00Z"}],"lottery":"HT001","currency":"THB","round_time":"2022-09-12T06:30:00Z","timestamp":1662960159}

Request Body

Name
Type
Description

app_id*

String

Operator unique identifier of player session

transaction_id*

String

Unique transaction id (UUID)

data*

Array

Ticket information detail

lottery*

String

Lottery code see

currency

String

Currency code

round_time

Date

Lottery round date (RFC339, UTC+0)

hash*

String

Encrypt parameter(MD5) see

timestamp*

Int

UNIX timestamp

ticket_id (data)*

Int

Lottery ticket (This information is in an array)

username (data)*

String

Player username (This information is in an array)

amount (data)*

Float

Transfer amount (This information is in an array)

bet_time

Date

Lottery round date (RFC339, UTC+0)

round_id*

Int

Lottery round

// Response result
{
    "code": 1000,
    "message": "Success"
}

// Response error
{
    "code": 1003,
    "message": "Invalid appId"
}

Content-Type: application/json, (Require)

POST {OperatorAPIDomain}/unsettle

The Provider system will send the transactions when the wrong settle is issued.

1.Because the huge package requires quite of processing time, recommend that Operator respond (Status Code 1000) to the Provider before the request processing.

2.Operator should use the backup by original request to processing to avoid processing failure. Provider will never resend the same package after receiving a response (Status Code 1000) from Provider.

3.If the request is damaged or cannot be recovered for any reason, please request a backup from BD for manual adjustment.

*If the operator does not send the 1000 status code back to the provider. This request will continue until the 1000 status code is received.

Example: {"app_id":"TEST","hash":"04d9e853241d4ab7c0891fa373aafbbb","transaction_id":"073c3e23-34f2-4179-b625-b6021714e5ed","round_id":1,"data":[{"ticket_id":1,"username":"testbowdang01","amount":5000,"bet_time":"2022-09-12T05:30:00Z"}],"lottery":"HT001","currency":"THB","round_time":"2022-09-12T06:30:00Z","timestamp":1662960159}

Request Body

Name
Type
Description

app_id*

String

Operator unique identifier of player session

transaction_id*

String

Unique transaction id (UUID)

data*

Array

Ticket information detail

lottery*

String

Lottery code see

currency

String

Currency code

round_time

Date

Lottery round date (RFC339, UTC+0)

hash*

String

Encrypt parameter(MD5) see

timestamp*

Int

UNIX timestamp

ticket_id (data)*

Int

Lottery ticket (This information is in an array)

username (data)*

String

Player username (This information is in an array)

amount (data)*

Float

Transfer amount (This information is in an array)

bet_time (data)

Date

Lottery round date (RFC339, UTC+0)

round_id*

Int

Lottery round

// Response result
{
    "code": 1000,
    "message": "Success"
}

// Response error
{
    "code": 1003,
    "message": "Invalid appId"
}

Content-Type: application/json, (Require)

POST {OperatorAPIDomain}/bonus

The Provider system will send transaction when user gets bonus from system to operator.

Example: {"app_id":"TEST","hash":"a4300e1588f07b4d8cf2ffb0a9ca0f06","transaction_id":"b6fd3033-c2a5-4a5f-8733-844daa138aa3","round_id":1,"username":"testbowdang01","lottery":"HT001","amount":200,"currency":"THB","round_time":"2022-09-12T06:30:00Z","timestamp":1662960159}

Request Body

Name
Type
Description

currency

String

Currency code

round_time

Date

Lottery round date (RFC339, UTC+0)

username*

String

Player username

lottery*

String

Lottery code see

transaction_id*

String

Unique transaction id (UUID)

amount*

Float

Transfer amount (Must greater than 0)

app_id*

String

Operator unique identifier of player session

hash*

String

Encrypt parameter(MD5) see

timestamp*

Int

UNIX timestamp

round_id*

Int

Lottery round

// Response result
{
    "code": 1000,
    "message": "Success"
}

// Response error
{
    "code": 1003,
    "message": "Invalid appId"
}

Content-Type: application/json, (Optional)

POST {OperatorAPIDomain}/round-end

The Provider system will send transaction when lottery round is complete.

Example: {"app_id":"TEST","hash":"a4300e1588f07b4d8cf2ffb0a9ca0f06","transaction_id":"534d116b-11cc-4f4d-a235-626537f04fd1","round_id":1,"lottery":"HT001","round_time":"2022-09-12T06:30:00Z","timestamp":1662960159}

Request Body

Name
Type
Description

app_id

String

Operator unique identifier of player session

hash*

String

Encrypt parameter(MD5) see

lottery*

String

Lottery code see

round_time*

Date

Lottery round date (RFC339, UTC+0)

timestamp*

Int

UNIX timestamp

transaction_id*

String

Unique transaction id (UUID)

round_id*

Int

Lottery round

// Response result
{
    "code": 1000,
    "message": "Success"
}

// Response error
{
    "code": 1003,
    "message": "Invalid appId"
}

Last updated