Skip to main content

Transfer

Process a Player's deposit or withdrawal Transaction.

API Information

  • URLPOST /v2/members/transaction
  • Authentication:Bearer Token
  • Encryption:Requests are encrypted using AES-256-GCM; responses are returned as plaintext JSON

request

Request Headers

POST /v2/members/transaction HTTP/1.1
Host: api.example.com
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
x-agentid: integratorNBTest04
x-timestamp: 1769746894501
x-nonce: 56ffd5ecd8a3a4457863a0bd7c298fb2
x-signature: 904e97bee2589b93e9747eed0346c68b23d8ff8b568dabaf4b94a5e89093df67

Request Parameters

Parameters Before Encryption

{
"username": "testacoount001",
"amount": 10,
"transId": "2c205e4f-c922-4967-8e45-f14480a2f075"
}

Encrypted Request Body

{
"cipherText": "G0ZMDELeJwx+7JcIfIFOLJjkSzANPu6krGM2uw==..."
}
FieldTypeRequiredDescription
usernamestringYesPlayer Account
transIdstringYesTransaction ID (Operator's unique identifier)
amountnumberYesTransaction amount; positive for a deposit, negative for a withdrawal

Response

Success Response

{
"code": 0,
"message": "No error.",
"data": {
"amount": 10,
"balance": 2323.582,
},
"logUUID": "fff937f4-b436-496e-baeb-6dfaa4743e43"
}

Response Field Description

FieldTypeDescription
data.amountnumberTransaction amount
data.balancenumberBalance after the Transaction

Error Response

{
"code": 3,
"message": "The transaction already exist.",
"logUUID": "6589bf8d-fe74-48bd-841a-71bf8f848f86"
}

Common Error Codes

CodeDescription
2Balance is insufficient
3Transaction already exists
8Player does not exist
11Parameters error
19Player Account is invalid
20Player's wallet is temporarily locked
35Transaction is being processed
83Authentication Failed
84Decryption Failed

For more error code descriptions, see: Appendix - Error Code Overview

Important Notes

  1. Transaction ID uniqueness: Each transId must be unique under the same agentId, to prevent duplicate Transactions
  2. Amount precision: Amounts are kept to 2 decimal places
  3. Currency consistency: The Transaction currency must match the currency used when the Player was created
  4. Balance check: When withdrawing, the system checks whether the Balance is sufficient
  5. Idempotency: Using the same transId will not result in duplicate execution