Wallet update notifications
Last updated on August 9, 2024
備考
- The Wallet Update Notification API is only available and enabled by default in AGS Private Cloud environments.
- Currently, notifications are turned on or off globally and not configurable by game namespace. To request assistance in configuring the Wallet Update Notification API, contact your AccelByte Technical Producer or submit a request through the AccelByte Customer Support Portal.
Introduction
The AccelByte Gaming Services (AGS) Wallet Update Notification API provides real-time updates on players' wallets, ensuring they are promptly informed of any changes, including those occurring outside the game client.
Supported notification types and sample payloads
This section lists the types of wallet update notifications supported by the AGS Wallet service.
Changed wallet status notifications
The following is a sample payload for walletStatusChanged
notifications.
{
"type": "walletBalanceChanged",
"payload": {
"action": "credit",
"data": {
"namespace": "namespace123",
"userId": "user123",
"currencyCode": "USD",
"amount": 500,
"reason": "Purchase",
"origin": "System"
}
}
}
The following table describes the function and supported values for each field in the payload.
Field | Type | Description | Value |
---|---|---|---|
type | String | Notification type | walletStatusChanged walletBalanceChanged |
action | String | Action taken on the wallet | Enable: enableUserWallet Disable: disableUserWallet |
data | Object | Contains the wallet status change details | |
data.walletId | String | Identifier of the wallet | |
data.userId | String | Identifier of the user associated with the wallet | |
data.status | String | Current status of the wallet | ACTIVE or INACTIVE |
data.previousStatus | String | Previous status of the wallet | ACTIVE or INACTIVE |
Changed wallet balance notifications
The following is a sample payload for walletBalanceChanged
notifications.
{
"type": "walletBalanceChanged",
"payload": {
"action": "credit",
"data": {
"namespace": "namespace123",
"userId": "user123",
"currencyCode": "USD",
"amount": 500,
"reason": "Purchase",
"origin": "System"
}
}
}
The following table describes the function and supported values for each field in the payload.
Field | Type | Description | Value |
---|---|---|---|
type | String | Notification type | walletStatusChanged walletBalanceChanged |
action | String | Action taken on the wallet | Payment (decrease): payWithUserWallet Debit (decrease): bulkDebit , debitByWalletPlatform , debitUserWalletByCurrencyCode , or debitUserWallet Expire (decrease): this is triggered by expiring wallet job. Credit (increase): bulkCredit or creditUserWallet |
data | Object | Contains the wallet status change details | |
data.namespace | String | Namespace where the wallet is in | |
data.userId | String | Identifier of the user associated with the wallet | |
data.currencyCode | String | Currency code associated with the balance | |
data.amount | Long | New or updated amount inside the wallet | |
data.reason | String | Reason for the balance change | |
data.origin | String | Origin of the balance change |