Skip to content
Back office

Deposit / Withdraw User Balance

Markdown

Endpoint

POST https://api.nexusggr.com

Request Body

{
    "method": "user_deposit",
    "agent_code": "testAgent",
    "agent_token": "c3041c6d9146a164387fa454eff7b432",
    "user_code": "test",
    "amount": 10000.00,
    "agent_sign": "UNIQUE_ID"   // Optional to prevent duplicated
}
JSON
{
    "method": "user_withdraw",
    "agent_code": "testAgent",
    "agent_token": "c3041c6d9146a164387fa454eff7b432",
    "user_code": "test",
    "amount": 10000.00,
    "agent_sign": "UNIQUE_ID"   // Optional to prevent duplicated
}
KeyTypeDescription
methodstringAPI method name. For balance transfer to a user game wallet, the value must be user_deposit or user_withdraw.
agent_codestringUnique agent identifier provided by NEXUS. Used to identify which agent is sending the request.
agent_tokenstringSecret authentication token assigned to the agent. Used for API authentication and request validation.
user_codestringUnique user identifier within the agent’s platform, without whitespace. This user will receive (user_deposit) or give (user_withdraw) the transferred balance. user_deposit creates the user if it does not exist yet.
amountdoubleAmount to transfer from the agent balance to the user API balance (user_deposit), or back (user_withdraw). Must be greater than 0 and sent as a JSON number, not a string. Supports up to 2 digits after the decimal point. Example: 10000.00
agent_signstringOptional unique request identifier used to prevent duplicated requests: a sign already used for the same user is refused with Duplicated Agent Sign. Letters, digits and underscores only (A-Z, a-z, 0-9, _). Recommended for transaction safety and idempotency handling. Example: UUID without hyphens, hash string, timestamp-based unique value.

Response Example

JSON
{
    "status": 1, 
    "code": 7777777,
    "msg": "SUCCESS",
    "agent_balance": 990000,
    "user_balance": 10000
}
JSON
{
    "status": 0,
    "code": 7770014,
    "msg": "Insufficient agent funds."
}
JSON
{
    "status": 0,
    "code": 7770015,
    "msg": "Insufficient user funds."
}
FieldTypeDescription
statusintRequest processing status. 1 indicates success, while 0 indicates failure.
codeintResponse code. 7777777 indicates success; any other value is an error code (7770xxx).
msgstringResponse message describing the result of the request. Example: SUCCESS, Insufficient agent funds.
agent_balancedoubleRemaining balance of the agent after the transaction has been processed successfully. Supports up to 2 digits after the decimal point.
user_balancedoubleUpdated API balance of the user after the transaction has been completed successfully. Supports up to 2 digits after the decimal point.