Публичный API · V5.0.0
Техническая справка для B2B-интеграции Slots
Текущая публичная справка содержит 17 конечных точек, четыре схемы и восемь FAQ. Она помогает подготовить технический объём, но не раскрывает реальные URL, учётные данные и конфигурации производственной среды.
Здесь опубликованы каталог конечных точек, метод подписи, характерные поля и обезличенные примеры. Реальный базовый URL, учётные данные, окончательные обратные вызовы, все ограничения полей и производственная конфигурация передаются в контролируемом процессе интеграции. Операции возврата средств и конфигурации мерчанта раскрывают только назначение, не точные пути.
Аутентификация и подпись
Каждый запрос использует JSON и POST. Передавайте код мерчанта, метку времени, одноразовый идентификатор и HMAC-SHA256 подпись; подпись рассчитывается по окончательной JSON-строке. Ключи хранятся только в контролируемой серверной среде, отдельно для тестовой и производственной среды.
| Заголовок | Тип | Обязательно | Назначение |
|---|---|---|---|
X-MERCHANT-CODE | string | Да | Merchant code assigned to the platform |
X-TIMESTAMP | string | Да | Timestamp at the time of the request |
X-NONCE | string | Да | Random string used for each request |
X-SIGN | string | Да | Request signature generated with HmacSHA256 |
X-CONTENT-PROCESSING-TYPE | string | Да | Content-processing type supplied according to the integration configuration |
17 публично описанных возможностей
В каталоге ниже представлены все 17 возможностей V5.0.0: поставщики, категории, игры, сессии, принудительное завершение, обратные вызовы единого кошелька, операции переводного кошелька, записи игр и контролируемые запросы мерчанта.
Каталог игр и сессии
POST /game/v5/providers— List game providersPOST /game/v5/categories— List game categoriesPOST /game/v5/games— List games with paginationPOST /game/v5/game/url— Create a player game session and obtain a launch URLPOST /game/v5/player/force/logout— Force the end of a player game session
Callback единого кошелька
POST {MERCHANT-URL}/wallet/balance— Query a player wallet balancePOST {MERCHANT-URL}/player/info— Query player informationPOST {MERCHANT-URL}/wallet/bet— Receive a bet notificationPOST {MERCHANT-URL}/wallet/win— Receive a settlement or bet-settlement notificationPOST {MERCHANT-URL}/wallet/cancel— Receive an order-cancellation notification
Переводной кошелёк
POST /game/v5/cash/deposit— Transfer funds into a player game walletPOST /game/v5/cash/withdraw— Transfer funds out of a player game walletPOST /game/v5/cash/balance— Query a player game-wallet balancePOST /game/v5/cash/transaction— List wallet transaction records with paginationPOST {CONTROLLED-PATH:FUND-RECOVERY}— Recover all funds from a player game wallet through a controlled operation
Записи и мерчант
POST /game/v5/game/record— List game records with paginationPOST {CONTROLLED-PATH:MERCHANT-CONFIGURATION}— Query merchant configuration and wallet information through a controlled operation
POST/game/v5/game/urlCreate game session
/game/v5/game/urlCreate game sessionCreates a game session for a specified player and returns a URL that can launch the game.
Request fields
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
reqTraceId | string | Required | Unique request identifier; must not be reused |
gameCode | string | Required | Game code |
playerId | string | Required | Unique player identifier on the merchant side |
currencyCode | string | Required | Wallet currency code |
language | string | Required | Game-interface language |
terminalType | string | Optional | Terminal type: PHONE or PC; PHONE by default |
returnUrl | string | Optional | Return URL after the player leaves the game |
ipAddress | string | Required | Player IPv4 or IPv6 address |
subMerchantCode | string | Optional | Sub-merchant code; cannot contain an underscore |
nickName | string | Optional | Player nickname |
avatarUrl | string | Optional | Player avatar URL |
{
"reqTraceId": "trace-demo-001",
"gameCode": "{game-code}",
"playerId": "player-demo-001",
"currencyCode": "{currency-code}",
"language": "en",
"terminalType": "PC",
"returnUrl": "https://{merchant-host}/lobby",
"ipAddress": "192.0.2.10"
}{
"code": "C10000",
"msg": "Request succeeded",
"success": true,
"data": {
"gameCode": "{game-code}",
"playerId": "player-demo-001",
"gameUrl": "https://{game-launch-host}/session/{token}",
"expireTime": "2026-08-08T10:30:00Z"
}
}Поля ответа
| Поле | Тип | Возвращается | Описание |
|---|---|---|---|
data.gameCode | string | Required | Game code |
data.playerId | string | Required | Player identifier |
data.gameUrl | string | Required | Game launch URL |
data.expireTime | string | Optional | Session expiry time |
POST{MERCHANT-URL}/wallet/winWallet settlement callback
{MERCHANT-URL}/wallet/winWallet settlement callbackIn single-wallet mode, the platform sends a payout or bet-settlement notification to the merchant wallet. The merchant should process the transaction idempotently and return the resulting balance in the response.
Request fields
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
reqTraceId | string | Required | Unique request identifier |
playerId | string | Required | Unique player identifier on the merchant side |
currencyCode | string | Required | Wallet currency code |
gameCode | string | Required | Game code |
transactionId | string | Required | Unique platform transaction identifier |
roundId | string | Required | Unique game-round identifier |
betId | string | Required | Related bet identifier |
betAmount | string | Required | Bet amount for this transaction |
winAmount | string | Required | Payout amount for this transaction |
isFree | boolean | Required | Whether the record was generated by a free game |
isEnd | boolean | Required | Whether the current game round has ended |
betTime | string | Required | Bet time |
settledTime | string | Required | Settlement time |
type | string | Required | Notification type: win or bet_win |
{
"reqTraceId": "trace-demo-002",
"playerId": "player-demo-001",
"currencyCode": "{currency-code}",
"gameCode": "{game-code}",
"transactionId": "txn-demo-002",
"roundId": "round-demo-001",
"betId": "bet-demo-001",
"betAmount": "10.00",
"winAmount": "18.50",
"isFree": false,
"isEnd": true,
"betTime": "2026-08-08T10:00:00Z",
"settledTime": "2026-08-08T10:00:08Z",
"type": "bet_win"
}{
"code": "C10000",
"msg": "Request succeeded",
"success": true,
"data": {
"merchantBetId": "merchant-bet-demo-001",
"balance": "108.50"
}
}POST/game/v5/cash/depositTransfer funds into game wallet
/game/v5/cash/depositTransfer funds into game walletIn transfer-wallet mode, transfers the specified amount from the merchant side into a player game wallet.
Request fields
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
reqTraceId | string | Required | Unique request identifier used for request tracing |
playerId | string | Required | Unique player identifier on the merchant side |
currencyCode | string | Required | Wallet currency code |
amount | string | Required | Transfer amount |
merchantTransactionId | string | Required | Unique merchant transaction identifier used for transaction reconciliation |
{
"reqTraceId": "trace-demo-003",
"playerId": "player-demo-001",
"currencyCode": "{currency-code}",
"amount": "100.00",
"merchantTransactionId": "merchant-txn-demo-001"
}{
"code": "C10000",
"msg": "Request succeeded",
"success": true,
"data": {
"balance": "100.00"
}
}Generate a unique merchantTransactionId for every transfer and retain the request and business result so that the final status can be reconciled through the transaction-query endpoint.
POST/game/v5/game/recordQuery game records
/game/v5/game/recordQuery game recordsQueries a player's bet and payout records by time range with pagination.
Request fields
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
reqTraceId | string | Required | Unique request identifier |
pageNum | integer | Required | Page number |
pageSize | integer | Required | Records per page |
reqData.startTime | string | Required | Query start time |
reqData.endTime | string | Required | Query end time |
sort | string | Optional | Sort order |
{
"reqTraceId": "trace-demo-004",
"pageNum": 1,
"pageSize": 50,
"reqData": {
"startTime": "2026-08-08T00:00:00Z",
"endTime": "2026-08-08T23:59:59Z"
},
"sort": "DESC"
}{
"code": "C10000",
"msg": "Request succeeded",
"success": true,
"data": {
"gameRecordList": [{
"orderNo": "order-demo-001",
"playerId": "player-demo-001",
"betAmount": "10.00",
"winAmount": "18.50",
"betTime": "2026-08-08T10:00:00Z",
"winTime": "2026-08-08T10:00:08Z",
"gameCode": "{game-code}",
"currencyCode": "{currency-code}",
"roundId": "round-demo-001"
}]
}
}Коды ошибок
| Код | Сообщение | Действие |
|---|---|---|
C10000 | Request succeeded | Request succeeded |
C10001 | Base service exception | Base service exception |
C10002 | Request parameter error | Check request fields and data types |
C10003 | Invalid request header | Check the five common request headers |
C10004 | Signature error | Check signing order, key and original request body |
C20001 | Merchant code absent | Check the merchant code |
G10001 | Game service exception | Game service exception |
G20001 | Player ID empty | Provide playerId |
G20002 | Game ID absent | Check the game code |
G20003 | Game offline | The game is offline or unavailable |
G30001 | Game user session expired | Create a new game session |
G30002 | Merchant balance insufficient | Merchant balance is insufficient |
G30003 | Player balance insufficient | Player balance is insufficient |
G40001 | Third-party service exception | Third-party service exception |
Технические FAQ
How does AG API generate a request signature?
Serialize the final request body as body, then concatenate merchantCode + timestamp + nonce + signType + body in that order without separators. signType is fixed as HmacSHA256. Compute HMAC-SHA256 with the signing key and place the result in X-SIGN. The body used for signing must be exactly the same as the body sent.
Why is C10004 returned?
C10004 indicates signature verification failure. First check the merchant code, timestamp, nonce, signing key and fixed HmacSHA256 type. Then confirm that middleware has not reserialized the signed JSON string, changed field order or changed whitespace. Keep reqTraceId and the request time for diagnosis, but never record the signing key.
What is the difference between single wallet and transfer wallet?
In single-wallet mode, the merchant maintains the player balance and the platform collaborates with the merchant wallet through balance, bet and settlement callbacks. In transfer-wallet mode, the merchant calls endpoints such as /game/v5/cash/deposit and /game/v5/cash/withdraw to transfer funds between the merchant system and the player game wallet. The model used depends on the merchant integration configuration and should not be mixed within the same transaction flow.
How should repeated wallet callbacks be handled?
The merchant should use transactionId as the idempotency basis for callback transactions. When the same transaction arrives again, return the previously confirmed processing result and balance; do not debit or credit it again. Retain the request, business result and final balance for reconciliation. Whether /wallet/bet and /wallet/cancel are required remains subject to the merchant's final callback list.
Can a transfer request be retried directly after a timeout?
Do not create a new transaction and repeat the transfer while the result is unknown. First use the original merchantTransactionId to call /game/v5/cash/transaction and query the result, then decide whether to resend according to the final technical agreement. This avoids duplicate accounting when the first request succeeded but its response was lost on the network.
What are reqTraceId and merchantTransactionId used for?
reqTraceId is the unique tracking identifier for each request. It is used to associate call logs and diagnose one request; it should be generated and recorded per request even when retrying. merchantTransactionId is the merchant-side unique transaction identifier, used for transfer reconciliation, result queries and preventing the same business transaction from being processed repeatedly. They have different purposes and cannot replace one another.
How is a player game session created?
Obtain an available gameCode from the game catalog, prepare the player identifier, currency, language and IP address, then call /game/v5/game/url with the common request headers. A successful response returns gameUrl and may return expireTime; the client should open the URL while the session is valid.
How are player game records queried?
Call /game/v5/game/record with pageNum, pageSize, and the reqData.startTime and reqData.endTime range; sort can be supplied when needed. Read order, player, bet amount, payout, game code and round records from gameRecordList in the response, and continue querying by page.
