GS2-AdReward Transaction Actions
ConsumeAction
Gs2AdReward:ConsumePointByUserId
Consume Points by specifying a user ID
Subtracts a specified number of points from the specified user ID and returns the updated point information. An error is returned if the user does not have enough points to cover the requested consumption amount. If a GS2-Script is configured in the namespace’s consume script settings, the script is executed before the point deduction, allowing custom validation or modification of the consume amount. After the point deduction, a change notification is sent if configured in the namespace settings.
Supports quantity specification: YES
Whether the action is reversible: YES
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| point | long | ✓ | 1 ~ 9223372036854775805 | Consume Points | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2AdReward:ConsumePointByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"point": "[long]Consume Points",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2AdReward:ConsumePointByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
point: "[long]Consume Points"
timeOffsetToken: "[string]Time offset token"transaction.service("adReward").consume.consume_point_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
point="[long]Consume Points",
timeOffsetToken="[string]Time offset token",
})AcquireAction
Gs2AdReward:AcquirePointByUserId
Acquire Points by specifying a user ID
Adds a specified number of points to the specified user ID and returns the updated point information. If the user has no existing point record, a new record is automatically created before adding points. If a GS2-Script is configured in the namespace’s acquire script settings, the script is executed before the point addition, allowing custom validation or modification of the acquire amount. After the point addition, a change notification is sent if configured in the namespace settings.
Supports quantity specification: YES
Whether the action is reversible: YES
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| point | long | ✓ | 1 ~ 9223372036854775805 | Acquire Points | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2AdReward:AcquirePointByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"point": "[long]Acquire Points",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2AdReward:AcquirePointByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
point: "[long]Acquire Points"
timeOffsetToken: "[string]Time offset token"transaction.service("adReward").acquire.acquire_point_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
point="[long]Acquire Points",
timeOffsetToken="[string]Time offset token",
})