> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-AdReward Transaction Actions

Specification of verify/consume/acquire transaction actions





## Consume Action



### Gs2AdReward:ConsumePointByUserId

Consume Point by User ID

Consumes 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 consuming points, allowing custom validation or modification of the consumed amount.
After the point deduction, a change notification is sent if configured in the Namespace settings.

**Quantity specification supported: YES**

**Reversible action: YES**

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID<br>Specify `#{userId}` to substitute the currently logged-in user's ID. |
| point | long |  | ✓|  | 1 ~ 9223372036854775805 | Consume Points |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2AdReward:ConsumePointByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "point": "[long]Consume Points",
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2AdReward:ConsumePointByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  point: "[long]Consume Points"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

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",
})
```


---

## Acquire Action



### Gs2AdReward:AcquirePointByUserId

Acquire Point by 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 acquiring points, allowing custom validation or modification of the acquired amount.
After the point addition, a change notification is sent if configured in the Namespace settings.

**Quantity specification supported: YES**

**Reversible action: YES**

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID<br>Specify `#{userId}` to substitute the currently logged-in user's ID. |
| point | long |  | ✓|  | 1 ~ 9223372036854775805 | Acquire Points |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2AdReward:AcquirePointByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "point": "[long]Acquire Points",
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2AdReward:AcquirePointByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  point: "[long]Acquire Points"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

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",
})
```


---



