# Link to your Tebex

## Tebex Integration

This guide explains how to link **is-store** to Tebex, how to map package IDs to rewards, and how to control VIP purchases made with coins.

### 1. Tebex Secret Key

Before using Tebex rewards, set your Tebex secret in your `server.cfg`:

```cfg
set sv_tebexSecret "YOUR_TEBEX_SECRET_KEY"
```

You can find this key in your Tebex dashboard under your game server integration.

If the secret key is missing or invalid, Tebex claim handling will not work correctly.

### 2. Package Mapping

Package rewards are configured in:

* `config/config.lua`

Look for this table:

```lua
Config.Store.Packages = {
    [7438066] = 1000,
    [7438085] = 2000,
    [1234569] = 10000,
    [7438555] = { type = 'vip', level = 'gold', days = 30 }
}
```

Each key is a **Tebex package ID**.

Each value is the reward that should be granted when the package is claimed.

### 3. Coins Packages

If you want a package to give coins, use a numeric value:

```lua
[7438066] = 1000
```

This means:

* Tebex package ID `7438066`
* Reward: `1000` coins

You can add as many coin packages as you want.

Example:

```lua
Config.Store.Packages = {
    [1111111] = 500,
    [2222222] = 1500,
    [3333333] = 5000
}
```

### 4. VIP Packages

If you want a package to give VIP access, use a VIP table instead of a numeric value:

```lua
[7438555] = { type = 'vip', level = 'gold', days = 30 }
```

This means:

* Tebex package ID `7438555`
* Reward type: VIP
* VIP level: `gold`
* Duration: `30` days

You can change the level and duration depending on your shop plan.

Example:

```lua
Config.Store.Packages = {
    [5000001] = { type = 'vip', level = 'bronze', days = 7 },
    [5000002] = { type = 'vip', level = 'silver', days = 30 },
    [5000003] = { type = 'vip', level = 'gold', days = 30 }
}
```

### 5. How To Find Package IDs

In Tebex, open your store and go to the **Packages** section.

For each package, copy its ID and place it in the config table as the key.

Important:

* The ID must match the package exactly
* Do not use the package name as the key
* Use only the numeric Tebex package ID

### 6. VIP Purchase With Coins

VIP can also be purchased with coins inside the store.

This is controlled in:

* `config/config.lua`

Look for:

```lua
Config.VIP = {
    Enabled = true,
    AllowCoinPurchase = true,
    ProrataTime = true
}
```

#### Enable VIP purchase with coins

Set:

```lua
AllowCoinPurchase = true
```

This allows players to buy VIP using their in-game coins.

#### Disable VIP purchase with coins

Set:

```lua
AllowCoinPurchase = false
```

This disables VIP purchase with coins and keeps VIP acquisition tied to Tebex only.

### 7. Recommended Setup

A simple setup usually looks like this:

* Coins packages for normal currency rewards
* VIP packages for membership tiers
* `AllowCoinPurchase = true` if you want both Tebex and coin purchase
* `AllowCoinPurchase = false` if you want VIP to be Tebex-only

Example:

```lua
Config.Store.Packages = {
    [1000001] = 500,
    [1000002] = 2000,
    [1000003] = { type = 'vip', level = 'silver', days = 30 },
    [1000004] = { type = 'vip', level = 'gold', days = 30 }
}
```

### 8. Final Checklist

Before testing Tebex rewards, make sure:

* `sv_tebexSecret` is set in `server.cfg`
* Your Tebex package IDs are correct
* Coin packages use numeric values
* VIP packages use `{ type = 'vip', level = '...', days = ... }`
* `AllowCoinPurchase` is set the way you want
* `is-store` starts after the framework and `oxmysql`

If everything is configured correctly, Tebex claims will grant the mapped reward automatically.


---

# 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://imperiumscripts.gitbook.io/imperium-scripts/scripts/imperium-store/link-to-your-tebex.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.
