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

# GS2-Quest Transaction Actions

Specification of verify/consume/acquire transaction actions





## Consume Action



### Gs2Quest:DeleteProgressByUserId

Delete Quest Progress by User ID

Deletes the current quest progress for the specified user. This cancels the quest in progress and allows starting a new quest.

**Quantity specification supported: NO**

**Reversible action: NO**

|  | 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. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2Quest:DeleteProgressByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2Quest:DeleteProgressByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

transaction.service("quest").consume.delete_progress_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    timeOffsetToken="[string]Time offset token",
})
```


---

## Acquire Action



### Gs2Quest:CreateProgressByUserId

Create Quest Progress by User ID

Creates a quest progress by looking up the quest model, performing a lottery on the quest content, and starting the quest. If a quest is already in progress, it returns an error unless the force flag is set.

**Quantity specification supported: NO**

**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. |
| questModelId | string |  | ✓|  |  ~ 1024 chars | Quest Model GRN to Start |
| force | bool |  | | false |  | If have a quest already started, you can discard it and start it |
| config | List&lt;Config&gt; |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |




**JSON**
```json
{
    "action": "Gs2Quest:CreateProgressByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "questModelId": "[string]Quest Model GRN to Start",
        "force": "[bool]If have a quest already started, you can discard it and start it",
        "config": [
            {
                "key": "[string]Name",
                "value": "[string]Value"
            }
        ],
        "timeOffsetToken": "[string]Time offset token"
    }
}
```

**YAML**
```yaml

action: Gs2Quest:CreateProgressByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  questModelId: "[string]Quest Model GRN to Start"
  force: "[bool]If have a quest already started, you can discard it and start it"
  config: 
    - key: "[string]Name"
      value: "[string]Value"
  timeOffsetToken: "[string]Time offset token"
```

**GS2-Script**
```lua

transaction.service("quest").acquire.create_progress_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    questModelId="[string]Quest Model GRN to Start",
    force="[bool]If have a quest already started, you can discard it and start it",
    config={
        {
            key="[string]Name",
            value="[string]Value"
        }
    },
    timeOffsetToken="[string]Time offset token",
})
```


---



