メインコンテンツまでスキップ

Wallet update notifications

Last updated on October 24, 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.

FieldTypeDescriptionValue
typeStringNotification typewalletStatusChanged
walletBalanceChanged
actionStringAction taken on the walletEnable: enableUserWallet
Disable: disableUserWallet
dataObjectContains the wallet status change details
data.walletIdStringIdentifier of the wallet
data.userIdStringIdentifier of the user associated with the wallet
data.statusStringCurrent status of the walletACTIVE or INACTIVE
data.previousStatusStringPrevious status of the walletACTIVE 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.

FieldTypeDescriptionValue
typeStringNotification typewalletStatusChanged
walletBalanceChanged
actionStringAction taken on the walletPayment (decrease): payWithUserWallet
Debit (decrease): bulkDebit, debitByWalletPlatform, debitUserWalletByCurrencyCode, or debitUserWallet
Expire (decrease): this is triggered by expiring wallet job.
Credit (increase): bulkCredit or creditUserWallet
dataObjectContains the wallet status change details
data.namespaceStringNamespace where the wallet is in
data.userIdStringIdentifier of the user associated with the wallet
data.currencyCodeStringCurrency code associated with the balance
data.amountLongNew or updated amount inside the wallet
data.reasonStringReason for the balance change
data.originStringOrigin of the balance change