NAV
java php python go javascript

XAgent Transfer Mode Access Document Manual V3.0

Preface

Connection Process

  1. Provide relevant information and contact us to open an account for you in the UAT environment
  2. Provide your server IP to add the server IP whitelist.
  3. After the account is opened, we provide publicKey, logo, site and other parameters, and the game background address
  4. According to your game needs, we provide the corresponding game coding table for docking
  5. Create game-related data (name, code, cover material, etc.) on your platform
  6. Start docking the interface through the interface document
  7. The interface docking is completed and the joint debugging test is correct
  8. The formal environment is ready for access, and our business intervenes to discuss business matters with you
  9. The formal environment account is opened, and the interface address and parameters are switched
  10. Provide your background IP whitelist and configure the whitelist in the game background
  11. Pre-operation and acceptance of the formal environment
  12. Access is completed and officially launched

Docking instructions

  1. All our interface parameters are case sensitive (case will not be ignored), please pay attention to the value

  2. After configuring the game entrance on your WEB / H5 / APP platform, the user clicks on the game entrance, calls the user registration/login interface provided by us, and passes in parameters such as account, game code, gameType, etc.

  3. After success, get the interface return value, where the url field is the form or url link that carries the user's login token

  4. By accessing and embedding the url field, you can jump into the game body

  5. You need to take the user's unique ID as the account, splice it according to certain rules, and pass it to the interface

  6. If you need to get the trial entrance of the game, pass isAnonymous true in the interface parameters.

  7. You can create different proxy lines in the game console (backstage) provided by us. Each line can be configured with an independent RTP configuration, and the users of each line are also separated and independent.

  8. When we open an account for you, we will create a default proxy line for you to use. If you need more later, you can add them in the background.

  9. You can also create your sub-agent in the background, assign different proxy lines to your sub-agent management, and attach the sub-agent background, which can view the relevant game data, user order records, reports, adjust RTP parameters, etc. assigned to the sub-agent.

Whitelist restrictions

All our interface domain names and the game backends we opened for you have set IP whitelist restrictions. If they are not configured, you cannot call the interface/access the backend. Therefore, before the connection starts, you need to provide the following IP information for us to pre-configure:

  1. The IP address of the server in each environment

  2. The IP address of the device you need to access the game backend

API Document

Interface Domain Name

UAT Environment: https://xagent-open-api-uat.ncfc.cc

Formal Environment: Contact Business to Obtain

Preparation before Access

Headers:

Parameter Name Parameter Value Required Example Remarks
Content-Type application/json Yes application/json
businessAccount The unique ID of the general agent provided by us Yes ballGame
site Agent line identification in XAgent merchant backend Yes xaDefault

Parameter encryption example:

//Parameters
Map<String, String> param = new HashMap<>();
param.put("account", "username");
param.put("password", "password");
//rsa encryption
byte[] encodedData = RSAUtil.encrypt(JSON.toJSONString(param).getBytes(), publicKey);
//base64
String base64String = Base64Util.encode(encodedData);
System.out.println("encoded: " + base64String);
Map<String, String> encryptParam = new HashMap<>();
encryptParam.put("data",base64String);
//Call API httpPost(encryptParam);
// Param
$param = array(
    "account" => "username",
    "password" => "password"
);

// JSON Encode
$jsonData = json_encode($param);

// RSA Encrypt
$publicKey = "your-public-key"; // Replace your public key
$publicKeyResource = openssl_pkey_get_public($publicKey);
openssl_public_encrypt($jsonData, $encryptedData, $publicKeyResource);

// Base64 Encode
$base64String = base64_encode($encryptedData);
echo "encoded: " . $base64String . "\n";

// Build Request Param
$encryptParam = array(
    "data" => $base64String
);

// Call API
$response = httpPost($encryptParam);
echo $response;

// HTTP POST
function httpPost($params) {
    $url = 'your-api-endpoint'; // replace api address

    $options = array(
        'http' => array(
            'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
            'method'  => 'POST',
            'content' => http_build_query($params),
        ),
    );

    $context  = stream_context_create($options);
    $result = file_get_contents($url, false, $context);

    return $result;
}
import json
import base64
import requests
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP

# param
param = {
    "account": "username",
    "password": "password"
}

# JSON encode
json_data = json.dumps(param)

# RSA Encrypt
public_key = 
"
-----BEGIN PUBLIC KEY-----
your-public-key-here
-----END PUBLIC KEY-----
"
rsa_key = RSA.import_key(public_key)
cipher = PKCS1_OAEP.new(rsa_key)
encoded_data = cipher.encrypt(json_data.encode('utf-8'))

# Base64 encode
base64_string = base64.b64encode(encoded_data).decode('utf-8')
print("encoded:", base64_string)

# build request param
encrypt_param = {
    "data": base64_string
}

# call api
response = requests.post('your-api-endpoint', data=encrypt_param)
print(response.text)
package main

import (
    "bytes"
    "crypto/rand"
    "crypto/rsa"
    "crypto/x509"
    "encoding/base64"
    "encoding/json"
    "encoding/pem"
    "fmt"
    "net/http"
)

func main() {
    // param
    param := map[string]string{
        "account":  "username",
        "password": "password",
    }

    // JSON encode
    jsonData, err := json.Marshal(param)
    if err != nil {
        fmt.Println("JSON Marshal error:", err)
        return
    }

    // RSA encrypt
    publicKey := `-----BEGIN PUBLIC KEY-----
your-public-key-here
-----END PUBLIC KEY-----`

    encodedData, err := rsaEncrypt(jsonData, publicKey)
    if err != nil {
        fmt.Println("RSA Encryption error:", err)
        return
    }

    // Base64 encode
    base64String := base64.StdEncoding.EncodeToString(encodedData)
    fmt.Println("encoded:", base64String)

    // build request param
    encryptParam := map[string]string{
        "data": base64String,
    }

    // call api
    response, err := httpPost("your-api-endpoint", encryptParam)
    if err != nil {
        fmt.Println("HTTP Post error:", err)
        return
    }

    fmt.Println("Response:", response)
}
const crypto = require('crypto');
const axios = require('axios');

// param
const param = {
    account: 'username',
    password: 'password'
};

// JSON encode
const jsonData = JSON.stringify(param);

// RSA encrypt
const publicKey = `-----BEGIN PUBLIC KEY-----
your-public-key-here
-----END PUBLIC KEY-----`;
const buffer = Buffer.from(jsonData, 'utf8');
const encryptedData = crypto.publicEncrypt(publicKey, buffer);

// Base64 encode
const base64String = encryptedData.toString('base64');
console.log("encoded: " + base64String);

// build request param
const encryptParam = {
    data: base64String
};

// call api
axios.post('your-api-endpoint', encryptParam)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
  1. Content-Type: application/json.
  2. You need to add the two fixed values provided by us to the request header, with the header keys being site and businessAccount
  3. You need to use the public key to perform RSA encryption on the request body, then convert the encrypted byte array into a Base64 string, and finally assemble it into a json format of {"data":"encrypted Base64 string"} and submit it to the interface
  4. In the http return object, code is the return code 200 = normal, and the data is in data. When code is not 200, message is an error message.
  5. Request example
  6. Example XAgent server domain name is https://xagent-open-api-uat.ncfc.cc
  7. The address of a certain interface is /v3/single/act
  8. The merchant end public key is MIGfMA0GCSqGSIb3DQEBAQUAA4GNADC...
  9. Business parameter json data {"field_1":"value_1","field_2":"value_2"}
  10. First encrypt the business parameters with RSA to get the ciphertext Os977UOvhnqN+0xY4YBg95vlBpaKmgWAHnTa...
  11. Set the request header businessAccount site content-type
  12. After encoding the ciphertext with base64, build a unified request parameter entity {"data":"Os977UOvhnqN+0xY4YBg95vlBpaKmgWAHnTa..."}
  13. Submit the request using post https://xagent-open-api-uat.ncfc.cc/v3/single/act
  14. Get the response data {"code":200,"message":"success","data":{"field_a":"value_a","field_b":"value_b"}}
  15. Determine whether the code is 200. If it is 200, it is strongly recommended that the merchant verify the response data. If it is not 200, there will be no signature value. The signature value is obtained from the response header signature
  16. Concatenate the data in the Body with the public key to obtain {"code":200,"message":"success","data":{"field_a":"value_a","field_b":"value_b"}}MIGfMA0GCSqGSIb3DQEBAQUAA4GNADC...
  17. Obtain the information summary of the concatenated string through the MD5 algorithm, and then compare it with the signature value in the response header. If they are consistent, the response data is safe
  18. Then make subsequent business logic judgments based on business parameters

User registration / login (game entry)

Interface path

POST /v3/transfer/user/login

Interface description

Request this interface to register/login a user, and at the same time obtain the URL entry with the user token. The account must be unique.

Request parameters

Body:

Parameters Data type Required Description
account string Y Player account (supports only (2~13) lowercase characters or numbers) ^[a-z0-9]{2,8}$
password string Y Account password (no more than 20 characters)
gameType string Y Game category code (see Appendix)
isMobile bool Y Whether it is a mobile terminal
gameCode string Y Game code, the code of the specific game
lang string Y Language type (see Appendix)
coin string Y Currency type (see Appendix)
line string N Line, supported by some venues, if supported, use this value to fill in the required parameters of the "line/site" system of the three parties, if not passed, it will be the default value
lobby string N Lobby address, supported by some venues, such as jumping back from the venue game page to the merchant page, empty if not passed
isAnonymous bool N Anonymous account/trial account
userIP string N Player IP
orderNoMerchant string N Order number for points increase, length does not exceed 50 digits
inAmount decimal N Transfer amount, 2 decimal places

Return data

Name Type Required Default value Remarks Other information
code number Required 200 Error code, 200 for successful call, other values ​​for failure, see error code definition
message string Optional When the error code is not 200, this field displays the error message
data object optional For specific data fields, see data definition *Note:* Specific data content

data data:

parameter data type required description
urlType int Y url type [1:direct redirect url 2:automatic redirect form]
url string Y game address
orderNo string N order number - XAgent
orderNoMerchant string N order number - downstream merchant
status int N transfer result [0: initialization/unknown status; 1: success; 2: failure;]

Get player balance

Interface path

POST /v3/transfer/user/balance

Interface description

This interface is used to obtain the balance of your platform users in our designated venues

Request parameters

Body:

Parameter Data type Required Description
account string Y Player account (only supports (2~8) lowercase characters or numbers) ^[a-z0-9]{2,8}$
password string Y Account password (no more than 20 characters)
gameType string Y Game category code (see Appendix)
coin string Y Currency type (see Appendix)

Return data

Name Type Required Default value Remarks Other information
code number required 200 error code, 200 for successful call, other values ​​for failure, see error code definition
message string optional When the error code is not 200, this field displays the error message
data object optional For specific data fields, see data data definition *Note:* Specific data content

data

parameter data type required description
balance decimal Y balance, 2 decimal places
coin string Y currency in the request parameter

Transfer (up/down)

Interface path

POST /v3/transfer/user/transfer

Interface description

This interface is used to add and deduct points for a specified user

Request parameters

Body:

Parameters Data type Required Description
account string Y Player account (supports only (2~8) lowercase characters or numbers) ^[a-z0-9]{2,8}$
password string Y Account password (no more than 20 characters)
gameType string Y Game category code (refer to the appendix)
coin string Y Currency type (refer to the appendix)
orderNoMerchant string Y Up/down order number, no more than 50 characters
type string Y Transfer category [in is up (transfer in), out is down (transfer out)]
amount decimal Y Amount, 2 decimal places

Return data

Name Type Required Default value Notes Other information
code number Required Error code, 200 for successful call, other values for failure, see error code definition
message string Optional When the error code is not 200, this field displays the error message
data object Optional Specific data field, see data data definition *Note:* Specific data content

data data:

Parameter Data type Required Description
orderNo string Y Order number - XAgent's
orderNoMerchant string Y Order number - downstream merchant's
status int Y Transfer result [0: Initialization/unknown status; 1: Success; 2: Failure;]

Get historical bets

Interface path

POST /v3/transfer/bet/betting

Interface description

Interface for querying historical game bets (A maximum of 5,000 pieces of data can be returned in one call)

Request parameters

Body:

Parameter Data type Required Description
gameType string Y Game category code (refer to Appendix)
startTimestampMs string Y Start timestamp
endTimestampMs string Y End timestamp, start and end time cannot exceed 12 hours
pageIndex string Y Page number

Return data

Name Type Required Default value Remarks Other information
code number Required Error code, 200 for successful call, other values ​​for failed call, see error code definition
message string optional When the error code is not 200, this field displays the error message
data String optional For specific data fields, see the data definition below

data data:

parameter data type required description
pageIndex string Y page number
pageTotal string Y total number of pages
bets BetItemModel[] Y historical bet collection

BetItemModel:

parameter data type required description
betNoVenue string Y venue bet number
account string Y player account
coin string Y currency (Refer to Appendix)
gameType string Y Game category (Refer to Appendix)
gameCode string Y Game code
betAmount decimal Y Bet amount
validAmount decimal Y Valid bet
netWinningAmount decimal Y Net win or loss
betTimestampMs long Y Bet timestamp
settlementTimestampMs long Y Settlement timestamp
isTrial bool Y Trial bet
betState int Y Bet state (Refer to Appendix)
settlementState int Y Settlement state (Refer to Appendix)
extend object Y Extended bet information, different types of bets have different extended information (Refer to Appendix)

Transfer order query

Interface path

POST /v3/transfer/user/transfer-search

Interface description

Interface for querying transfer order details based on order number

Request parameters

Body:
Parameter Data type Required Description
orderNoMerchant string Y Up/down order number, length not exceeding 50 characters

Return data

Name Type Required Default value Remarks Other information
code number Required Error code, 200 for successful call, other values ​​for failure, see error code definition
message string Not required When the error code is not 200, this field displays the error message
data object Not required For specific data fields, see the TransferOrder data definition below

data

Parameter Data type Required Description
orderNo string Y Order number - XAgent's
orderNoMerchant string Y Order number - Downstream merchant's
status int Y Transfer result [0: Initialization/unknown status; 1: Success; 2: Failure;]

Get the game list

Interface path

POST /v3/transfer/game/list-gamecode

Interface description

Interface for getting the game list

Request parameters

Body:

Parameter Data type Required Description
gameType string Y Game category code (refer to Appendix)

Return data

Name Type Required Default value Remarks Other information
code number Required Error code, 200 for successful call, other values for failed call, see error code definition
message string Required When the error code is not 200, this field displays the error message
data GameCodeList[] Required game collection (see appendix)

Get game category list

interface path

POST /v3/transfer/game/list-gametype

interface description

Interface for getting game category list

request parameters

Body:

parameter data type required description
coin string Y currency type (see appendix)

return data

name type required default value notes other information
code number required Error code, 200 for successful call, other values for failed call, see error code definition
message string required When the error code is not 200, this field displays the error message
data GameTypeList[] required game category collection (data structure refers to the appendix)

Member Kickout Interface(PG Venus)

Interface Path

POST /v3/transfer/game/pgKickOut

Interface Description

PG game-specific, kick-off member offline interface, after calling, the member will be forced offline

Request Parameters

Body:

Parameter Data Type Required Description
account string Y Player Account
gameType string Y Game Category Code (refer to Appendix)

Return Data

Name Type Required Default Value Remarks Other Information
code number Required Error code, 200 for successful call, other values for failure, see Error Code Definition
message string Required When the error code is not 200, this field displays the error message

View order details (PG Venus)

Interface path

POST /v3/transfer/game/pgSnapshot

Interface description

PG game only, you can view the detailed game screenshot details of a certain member's PG game order. After calling the interface, it is returned in the form of a URL, and you can view it directly by visiting

Request parameters

Body:

Parameter Data type Required Description
account string Y Player account
gameType string Y Game category code (refer to Appendix)
orderNo string Y Order number

Return data

Name Type Required Default value Remarks Other information
code number Required Error code, 200 for successful call, other values for failed call, see error code definition
message string Required When the error code is not 200, this field displays the error message
data string Required URL of the game order details page, you can view it by visiting it directly

Appendix

GameType Game Category

Only some GameTypes are shown here for reference only. For details, please check the XAgent Game List document. Subsequent additions will be reflected in the document, or View the latest data through the merchant backend

Code Name Description
xg_electronic XG Electronic
ag_electronic AsiaGaming Electronic
ag_live AsiaGaming Live
ax_electronic Aviatrix Electronic
bng_electronic BNG Electronic
cr_sport Crown Sports
dg_live DreamGaming Live
evo_live Evolution Live
fb_sport FB Sports
fg_brand FunGaming Chess
imty_sport InplayMatrix Sports
jdb_electronic Duobao Electronic
ky_brand Kaiyuan Chess
mg_electronic MicroGaming Electronic
nlc_electronic NoLimitCity Electronic
ob_live DB (formerly OB) Live
obty_sport Panda Sports
pg_electronic PocketGames Electronic
png_electronic PlayNGo Electronic
pp_electronic PragmaticPlay Electronic
pp_live PragmaticPlay Live
rt_electronic Red Tiger Electronic
sc_lottery SHI CAI Lottery
sexy_live Sexy Live
shb_sport Sabah Sports

Coin Currency

Subsequent additions will be reflected in the document, or you can view the latest data through the merchant backend

Code Name Description
aud Australian Dollar
bdt Bangladeshi Taka
brl Brazilian Real
cny Chinese Yuan
eur Euro
hkd Hong Kong dollar
idr Indonesian rupiah
inr Indian rupee
irr Iranian rial
jpy Japanese yen
khr Cambodian riel
krw Korean won
mmk Myanmar kyat
myr Malaysian ringgit
ngn Nigerian naira
npr Nepalese rupee
php Philippine peso
pkr Pakistani rupee
pyg Paraguayan jalan
rub Russian ruble
sgd Singapore dollar
thb Thai baht
twd Taiwan dollar
usd US dollar
vnd Vietnamese dong
v_usdt USDT

Lang language

Subsequent additions will be reflected in the document, or you can view the latest data through the merchant backend

Code Name Description
en English
hi Hindi
id Indonesian
ja Japanese
ko Korean
pt Portuguese
ta Tamil
th Thai
vi Vietnamese
zh Chinese
zh_hant Chinese-Traditional

BetOperateStates bet processing results

Code Name Description
0 Unknown, default value when no value is assigned or any situation where it is uncertain whether it is successful, also a failure
1 Success
2 Failure
3 Insufficient balance
4 Player does not exist
20 Bet does not exist
21 Duplicate bet
22 Bet settled
23 Bet canceled
24 Bet rolled back

BillOperateStates Bill processing results

Code Name Description
0 Unknown, default value when no value is assigned, or any situation where success is uncertain, also a failure
1 Success
2 Failure
3 Insufficient balance
4 Player does not exist
20 Bill does not exist
21 Duplicate bill
23 Bill canceled

VenueResultCodes Common error codes

Code Name Description
200 Success, all others are failures
400 Parameter error
9*** Internal service error
9999 Including any failure
3000 XAgent-System maintenance
3001 XAgent-IP whitelist restriction
3002 The merchant has not opened this game hall or currency
5000 Game hall system maintenance
5001 Game hall IP whitelist restriction
5002 Game hall is not accessible
5003 Game hall system is busy
5004 Cannot enter the lobby directly
5005 Order processing
5006 Insufficient balance
7000 Merchant-side system maintenance
7001 Merchant-side IP whitelist restriction
7003 The merchant system is busy
7004 The merchant account does not exist

BetStates Bet Status

Code Name Transfer Mode Single Wallet Description
0 Unknown Status Available Available
1 The bet has been accepted and is valid Available Available
2 Rejection/failed betting Available Unavailable
3 Cancellation/cancellation/third-party forced withdrawal/refund Available Unavailable
4 Order canceled Available Available
5 Reclaim/sell Available Unavailable

SettlementState settlement status

Code Name
1 Unsettled/Undrawn/Waiting for draw
3 Win/Win
4 Lost/didn’t win
5 Tie/Draw

GameTypeList Game category entity

Parameter Data type Required Description
gameType string Y Game category
name string Y Corresponding Chinese name
isEnable int Y Whether to enable 1. Yes 2. No

GameCodeList Game list entity

Parameter Data type Required Description
gameType string Y Game category
gameCode string Y Game code, specific game code
gameNameEnus string Y Game English name
gameNamePtbr string Y Game Portuguese name
gameNameZhcn string Y Game Chinese name
isEnable int Y Whether to enable 1. Yes 2. No
logoUrl string Y game logo
remark string Y remark