# Adding Packages

When adding packages, there may be certain **Variables** associated with them. These can be filled by providing a `variable_data` object.

```json
"variable_data": {
    "variable_identifier": "value"
}
```

## Deliverable Types and Variable Data

### Gift Card

Packages that deliver a gift card to the user should include `giftcard_to` mapped to the e-mail address that will receive the gift card:

```json
{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "giftcard_to": "tebex-integrations@overwolf.com"
    }
}
```

### Discord Action

Packages that deliver Discord actions should include the user's `discord_id:`

```json
{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "discord_id": "000000000000000000"
    }
}
```

### Game Server Commands&#x20;

Packages that deliver game server commands should include the `username_id` of the user, dependent on your store type.

You can get the **username\_id** after creating the basket if you provide the player's username at the time of creation. See **Creating a Basket** for specific details on Game Servers.

```json
{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "username_id": "9e65a968ee4743d19a2a4c9969154491"
    }
}
```

### Custom Data

You can also provide custom data when adding packages which can be referenced by the seller as part of the transaction.

```json
{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "username_id": "9e65a968ee4743d19a2a4c9969154491"
    },
    "custom": {
        "key": "value"
    }
}
```

### Specifying the Package's Game Server

If a package with a **Game Server Command** has the configuration option:

* `Allow customers to select the game server they want to receive this package on.`

You can specify the target game server in the request by including `server_id` in your package's `variable_data`:

```json
{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "server_id": "127444"
    }
}
```

A list of your `server_ids` can be found in your [Tebex Control Panel](https://creator.tebex.io/game-servers) by clicking **Edit** beside your relevant game server. The server ID is the number at the end of the URL when editing the game server.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tebex.io/developers/headless-api/adding-packages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
