Skip to main content

VNLOTO API Transfer Wallet

Overview

1. Language

  • Mobile website, desktop website: Vietnamese
  • Backoffice: Vietnamese, English, Chinese

2. Currency Types

  • The system supports most currencies. Refer to the appendix.

3. Time Zone and Date/Time Format

  • API: GMT+7
  • Backoffice: GMT+7
  • Platform: GMT+7
  • Required date/time format:
    • Date: dd-mm-yyyy (Example: 03-08-2024)
    • Date and time: dd-mm-yyyy hh24:mi (Example: 03-08-2024 14:20)

4. Error Handling

  • All responses must include an error status indicating whether an error occurred.

Common Responses

Success
{
"errorCode": 0,
"message": "The operation was successful!"
}

Success with data
{
"balance": "9774000",
"errorCode": 0,
"message": "The operation was successful!"
}
...

Failure
{
"errorCode": 1001,
"message": "Failed: Username has been registered."
}
  • Typically, error code 0 means “no error.” Any other code indicates an error.

5. Logging

  • All request and response parameters, including server errors, are recorded.

6. Interfaces

The system provides two interfaces: xoso168 and xoso188.

  • xoso168: Uses a luxurious gold theme.
  • xoso188: Uses a sky blue theme.

7. Game Betting Odds

  • Agents can set their own detailed lottery odds for each lottery type, lottery station, and play style.

8. Integration Steps

8.1 Agent Provides Integration Information

  • The agent provides the following information to XOSO168 before integration:
    • Wallet type: Transfer
    • Currency type: VND (two options: VND or VNDK)
    • Agent code: X88 (used for agent identification)
    • Interface type: xoso168 (two interface templates: xoso168 and xoso188)

8.2 XOSO168 Creates a Test Integration Environment and Returns Results to the Agent

  • After the agent supplies sufficient information, XOSO168 creates a test integration environment for the agent:

9. API Authentication

  • When calling XOSO168 APIs:
    • Add apiPrivateKey in the header; this key is provided by XOSO168 during integration

alt text

API List

1. Create Player (CreatePlayer)

URL: /LotoService.aspx
Method: POST

Request

Field NameTypeMax LengthRequiredDescription
flagString20YFixed value: CreatePlayer
accountString50YOnly alphanumeric characters [a-z, A-Z, 0-9, _ ] allowed
passwordString50YPlayer’s password
signNumber10YAgent identifier provided during system integration

Request Example

curl --header "Content-Type:application/json" \
--header "Accept: application/json" \
--header "apiPrivateKey : [apiPrivateKey]" \
--request POST \
--data '{
"flag": "CreatePlayer",
"account": "test01",
"password": "123qwe",
"sign": "161825"
}' \
https://[SERVER]/LotoService.aspx

Response

Field NameTypeLengthRequiredDescription
errorCodeIntegerYError code
messageString255YError message

Response Example

Success
{
"errorCode": 0,
"message": "The operation was successful!"
}

Failure
{
"errorCode": 500,
"message": "Failed: Please try again or contact customer service!"
}

Unauthorized
{
"errorCode": 4001,
"message": "Failed: Insufficient access."
}

Account already exists
{
"errorCode": 1001,
"message": "ailed: Username has been registered."
}

2. Player Login (PlayerLogin)

URL: /LotoService.aspx
Method: POST

Request

Field NameTypeMax LengthRequiredDescription
flagString20YFixed value: PlayerLogin
accountString50YOnly alphanumeric characters [a-z, A-Z, 0-9, _ ]
passwordString50YPlayer’s password
loginTypeNumber1Y0 for mobile
1 for PC
The simplest is 1, and if accessed from mobile, the system automatically redirects.
gameIdNumber1YRefer to the GameId table
langString10NList of values: 'en', 'zh_CN', 'vi'. If this parameter is not provided, the default game link will be displayed in Vietnamese.

Request Example

curl --header "Content-Type:application/json" \
--header "Accept: application/json" \
--header "apiPrivateKey : [apiPrivateKey]" \
--request POST \
--data '{
"flag": "PlayerLogin",
"account": "player1",
"password": "abcd1234",
"loginType": 0,
"gameId": 0
}' \
https://[SERVER]/LotoService.aspx

Response

Field NameTypeMax LengthRequiredDescription
errorCodeIntegerYError code
messageString255YError message
gameLinkString512YIf loginType is 0, returns mobile web link
If loginType is 1, returns PC web link

Response Example

Successful mobile login
{
"errorCode": 0,
"gameLink": "http://[SERVER]/?token=Z2FtZSZwbGF5ZXIxJmFiY2QxMjM0&gameId=0",
"message": "The operation was successful!"
}

Successful PC login
{
"errorCode": 0,
"gameLink": "http://[SERVER]/game?token=Z2FtZSZwbGF5ZXIxJmFiY2QxMjM0&gameId=0",
"message": "The operation was successful!"
}

Incorrect username or password
{
"errorCode": 1002,
"gameLink": "",
"message": "Failed: Invalid username or password, please try again!"
}

3. Balance

URL: /LotoService.aspx
Method: POST

Request

Field NameTypeMax LengthRequiredDescription
flagString20YFixed value: Balance
accountString50YPlayer’s account

Request Example

curl --header "Content-Type:application/json" \
--header "Accept: application/json" \
--header "apiPrivateKey : [apiPrivateKey]" \
--request POST \
--data '{
"flag": "Balance",
"account": "player1"
}' \
https://[SERVER]/LotoService.aspx

Response

Field NameTypeMax LengthRequiredDescription
errorCodeIntegerYError code
messageString255YError message
balanceString15YPlayer’s balance

Response Example

Query successful
{
"balance": "9874000",
"errorCode": 0,
"message": "The operation was successful!"
}

4. Deposit

URL: /LotoService.aspx
Method: POST

Request

Field NameTypeMax LengthRequiredDescription
flagString50YFixed value: Deposit
refnoString50YTransaction ID on the Merchant side
accountString50YPlayer’s account
amountDecimal18,2YA decimal number with 18 digits and 2 digits after the decimal point.

Request Example

curl --header "Content-Type:application/json" \
--header "Accept: application/json" \
--header "apiPrivateKey : [apiPrivateKey]" \
--request POST \
--data '{
"flag": "Deposit",
"refno": "refno1",
"account": "player1",
"amount": 100000
}' \
https://[SERVER]/LotoService.aspx

Response

Field NameTypeMax LengthRequiredDescription
errorCodeIntegerYError code
messageString255YError message

Response Example

Success
{
"errorCode": 0,
"message": "The operation was successful!"
}

Refno already exists
{
"errorCode": 2001,
"message": "Failure: Reference number refno10 already exists"
}

5. Withdraw

URL: /LotoService.aspx
Method: POST

Request

Field NameTypeMax LengthRequiredDescription
flagString20YFixed value: Withdraw
refnoString50YTransaction ID on the Merchant side
accountString50YPlayer’s account
amountDecimal18,2YMust be a negative number, a decimal with 18 digits and 2 digits after the decimal point.

Request Example

curl --header "Content-Type:application/json" \
--header "Accept: application/json" \
--header "apiPrivateKey : [apiPrivateKey]" \
--request POST \
--data '{
"flag": "Withdraw",
"refno": "refno1",
"account": "player1",
"amount": 100000
}' \
https://[SERVER]/LotoService.aspx

Response

Field NameTypeMax LengthRequiredDescription
errorCodeIntegerYError code
messageString255YError message

Response Example

Success
{
"errorCode": 0,
"message": "The operation was successful!"
}

Refno already exists
{
"errorCode": 2001,
"message": "Failure: Reference number refno10 already exists"
}

Account balance is insufficient
{
"errorCode": 2005,
"message": "Failed: Account balance is insufficient."
}

6. BetLog

URL: /LotoService.aspx
Method: POST
info
  • Rate limit: 1 request every 10 seconds
  • Query interval: up to 1 hour (distance between start_time and end_time)
  • Date limit: up to 35 days

Parameter Data

Field NameTypeMax LengthRequiredDescription
flagString20YFixed value: BetLog
signNumber10YAgent identifier provided during system integration
startTimeString16NSearch by betting time. Format: yyyy-MM-dd HH:mm, e.g., "2024-10-12 00:00:00"
endTimeString16NSearch by betting time. Format: yyyy-MM-dd HH:mm, e.g., "2024-10-12 00:00:00"

Request Example

curl --header "Content-Type:application/json" \
--header "Accept: application/json" \
--header "apiPrivateKey : [apiPrivateKey]" \
--request GET \
--data '{
"flag": "BetLog",
"sign": "171762",
"startTime": "2024-10-12 00:00:00",
"endTime": "2024-12-12 23:59:59"
}' \
https://[SERVER]/LotoService.aspx

Response

Field NameTypeMax LengthRequiredDescription
errorCodeIntegerYError code
messageString255YError message
reslistarray-NList of bets

Data Structure

Field NameTypeMax LengthDescription
amountNumberBetting amount
betcontentString4000Betting content
betfromNumber0: Bet on PC web
3: Bet on Mobile web
betnumberNumberThe number of digits the player picked
bettimeStringBetting time
bettypeString10Number input method: pick numbers, manually enter, quick pick
bonusNumberBonus amount
codesString4000Betting content code
finishtimeStringEnd time
idString50Betting ID (unique)
inserttimeStringData insertion time
ipString50IP address
issueString50Lottery draw
loginnameString50Login name
lotteryidNumberLottery ID
methodidNumberBetting method type
multipleNumberBetting multiplier
statusNumberBet status (see Appendix)
traceidString30Number of betting codes, one betting code includes many betting tickets
(When User creates an automatic betting plan, it will create a betting code
usertimeStringUser’s local time
winnumberString200Winning number
wintimesNumberNumber of wins
oddNumberOdds when calculating prizes for lottery games
info
  • Bonus calculation formula = Bet multiplier * Odd * Number of wins * Exchange ratio
  • Exchange ratio is either 1 or 1000 (Ex: VND = 1000, VNDK, USD,... = 1)

Response Example

Success
{
"errorCode": 0,
"message": "The operation was successful!",
"reslist": [
{
"amount": 100000,
"betcontent": "[Đánh Đề - Đề đặc biệt] -,-,X,X",
"betfrom": 0,
"betnumber": 50,
"bettime": "2025-03-30 13:57:10",
"bettype": "digital",
"bonus": 199000,
"codes": "0&1&2&3&4&5&6&7&8&9|5&6&7&8&9",
"finishtime": "2025-03-30 13:57:52",
"id": "B250330135710100068",
"inserttime": "2025-03-30 13:57:10",
"ip": "0:0:0:0:0:0:0:1",
"issue": "20250330-1118",
"loginname": "transfervnd",
"lotteryid": 100,
"methodid": 6,
"multiple": 2,
"odd": 99.5,
"status": 4,
"traceid": "",
"usertime": "2025-03-30 13:57:10",
"winnumber": "723127,19002,71299,38929,76096,53274,56712,52535,78395,83693,33270,79533,5903,0471,9356,1519,741,33,",
"wintimes": 1
},
{
"amount": 900000,
"betcontent": "[Bao Lô - Lô 2 Số] -,-,X,X",
"betfrom": 0,
"betnumber": 50,
"bettime": "2025-03-30 13:56:55",
"bettype": "digital",
"bonus": 796000,
"codes": "0&1&2&3&4&5&6&7&8&9|5&6&7&8&9",
"finishtime": "2025-03-30 13:56:55",
"id": "B250330135655100067",
"inserttime": "2025-03-30 13:56:55",
"ip": "0:0:0:0:0:0:0:1",
"issue": "20250330-1s",
"loginname": "transfervnd",
"lotteryid": 50,
"methodid": 1,
"multiple": 1,
"odd": 0,
"status": 4,
"traceid": "",
"usertime": "2025-03-30 13:56:55",
"winnumber": "211216,13327,95851,95490,57097,35194,57905,45782,75330,61023,27181,76665,5676,5638,7240,9073,536,13,",
"wintimes": 8
}
]
}

Failure
{
"errorCode": 4001,
"message": "Failed: Insufficient access.."
}

7. BetInfo

URL: /LotoService.aspx
Method: POST

Parameter Data

Field NameTypeMax LengthRequiredDescription
flagString20YFixed value: BetInfo
betIdString50YBetting ID (unique)

Request Example

curl --header "Content-Type:application/json" \
--header "Accept: application/json" \
--header "apiPrivateKey : [apiPrivateKey]" \
--request GET \
--data '{
"flag": "BetInfo",
"betId": "B250404085016100055"
}' \
https://[SERVER]/LotoService.aspx

Response

Field NameTypeMax LengthRequiredDescription
errorCodeIntegerYError code
messageString255YError message
betinfoObject-NBet ticket info

Data Structure: Refer BetLog API

Response Example

Success
{
"betinfo": {
"amount": 10,
"betcontent": "betdata[da]=5&betdata[xiao]=5",
"betfrom": 0,
"betnumber": 1,
"bettime": "2025-04-04 08:50:16",
"bettype": "",
"bonus": 0,
"codes": "betdata[da]=5&betdata[xiao]=5",
"finishtime": "",
"id": "B250404085016100055",
"inserttime": "2025-04-04 08:50:16",
"ip": "0:0:0:0:0:0:0:1",
"issue": "20250404-0051",
"loginname": "transfervndk",
"lotteryid": 80,
"methodid": 0,
"multiple": 1,
"odd": 0,
"status": 2,
"traceid": "",
"usertime": "2025-04-04 08:50:16",
"winnumber": "331",
"wintimes": 0
},
"errorCode": 0,
"message": "The operation was successful!",
}

Failure
{
"errorCode": 4010,
"message": "Failed: No record found."
}


Failure
{
"errorCode": 4001,
"message": "Failed: Insufficient access.."
}

Failure
{
"errorCode": 500,
"message": "Failed: Please try again or contact customer service!"
}

Appendix

1. Error Codes

Error CodeError MessageError Type
0The operation was successful!Transaction Success
4001Failed: Insufficient access.Access Error (e.g., wrong apikey..)
4002Failed: Invalid agentId.Access Error
4004Failed: System under maintenance.Access Errors
4010Failed: No record found.Client-side errors (Error not found requested resource)
500Failed: Please try again or contact customer service!System Errors
1001Failed: Username has been registered.Account Errors
1002Failed: Invalid username or password, please try again!Account Errors
1003Your account has been disabled, if you have any questions, please contact customer service!Account Errors
1004Failure: Account does not existAccount Errors
1005Failure: Account is locked and cannot be depositedAccount Errors
1006Your account has been disabled, if you have any questions, please contact customer service!Account Errors
1007Failure: Trial account cannot be depositedAccount Errors
1008Failure: Account is locked and cannot be withdrawnAccount Errors
2001Failure: Reference number 0 already existsReference Errors
2005Failed: Account balance is insufficient.Withdrawal Errors

2. Betting Status

Betting StatusDescriptionPayout
0Not yet drawnNo
1Awaiting drawNo
2Awaiting settlementNo
3LostNo
4WonYes
5Canceled "maintenance"No
6Individual bet canceledNo
7Draw results canceledNo

3. GameId Table

GameIdTypeDescription
0MAINMain lobby
1MAINASIA 24H Menu
2MAINVIP Menu
3MAINRapid Menu
4MAINNorthern Menu
5MAINCentral Menu
6MAINSouthern Menu
7MAINFolk Games Menu
400ASIA 24HSouthern 24H14
401ASIA 24HCentral 24H14
402ASIA 24HNorthern 24H14
300VIPVietnam VIP 12H14
301VIPSaigon VIP 15H14
302VIPHo Chi Minh VIP 16H14
303VIPDa Nang VIP 17H14
304VIPHa Noi VIP 19H14
305VIPThang Long VIP 20H14
50RapidRapid 1 Second
100RapidRapid 45 Seconds
101RapidRapid 1 Minute
102RapidRapid 1.5 Minutes
103RapidRapid 2 Minutes
104RapidRapid 5 Minutes
105SouthernHo Chi Minh
106SouthernDong Thap
107SouthernCa Mau
108SouthernBen Tre
109SouthernVung Tau
110SouthernBac Lieu
111SouthernDong Nai
112SouthernCan Tho
113SouthernSoc Trang
114SouthernTay Ninh
115SouthernAn Giang
116SouthernBinh Thuan
117SouthernVinh Long
118SouthernBinh Duong
119SouthernTra Vinh
120SouthernLong An
121SouthernBinh Phuoc
122SouthernHau Giang
123SouthernTien Giang
124SouthernKien Giang
125SouthernDa Lat
126CentralThua Thien Hue
127CentralPhu Yen
128CentralDak Lak
129CentralQuang Nam
130CentralDa Nang
131CentralKhanh Hoa
132CentralBinh Dinh
133CentralQuang Tri
134CentralQuang Binh
135CentralGia Lai
136CentralNinh Thuan
137CentralQuang Ngai
138CentralDak Nong
139CentralKon Tum
200NorthernNorthern 18H14
201NorthernSpecial 6h25
60Folk GamesTai Xiu 1 Second
80Folk GamesTai Xiu 1 Minute
90Folk GamesXoc Dia 1 Second
91Folk GamesXoc Dia 1 Minute
92Folk GamesBau Cua 1 Second
93Folk GamesBau Cua 1 Minute

4. Currency List

Currency CodeDescription
USDTUSDT
AEDUnited Arab Emirates dirham
AMDArmenian dram
ARSArgentine peso
AUDAustralian dollar
BDTBangladeshi taka
BNDBrunei dollar
BRLBrazilian real
CADCanadian dollar
CHFSwiss franc
CLPChilean peso
COPColombian peso
CNYChinese yuan (Renminbi)
DZDAlgerian dinar
EGPEgyptian pound
ETBEthiopian birr
EUREuro
FRFFrench franc
GBPBritish pound sterling
GHSGhanaian cedi
HKDHong Kong dollar
IDRIndonesian rupiah (1:1000)
INRIndian rupee
JPYJapanese yen
KRWSouth Korean won
KZTKazakhstani tenge
KHRCambodian riel (1:1000)
KESKenyan shilling
LAKLao kip (original)
LAKKLao kip (1:1000)
LKRSri Lankan rupee
MADMoroccan dirham
MOPMacanese pataca
MMKMyanmar kyat (original) (1:1)
MMKKMyanmar kyat (1:1000)
MYRMalaysian ringgit
MXNMexican peso
MNTMongolian tugrik
NOKNorwegian krone
NZDNew Zealand dollar
NPRNepalese rupee
NGNNigerian naira
PGKPapua New Guinean kina
PTIIndonesian rupiah (original) (1:1)
PKRPakistani rupee
PHPPhilippine peso
PENPeruvian nuevo sol
RUBRussian ruble
SEKSwedish krona
SGDSingapore dollar
THBThai baht
TRYTurkish lira
TNDTunisian dinar
TZSTanzanian shilling
USDUnited States dollar
UAHUkrainian hryvnia
UGXUgandan shilling
VNDVietnamese đồng (original) (1:1)
VNDKVietnamese đồng (1:1000)
ZARSouth African rand
ZWDZimbabwean dollar
ZMWZambian kwacha