> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Economy and Game Configs

> Use game configs, probability tables, and in-app purchase validation from Unity.

Economy and configuration features are published from Console and consumed by Unity clients.

## Game Configs

Game configs are JSON settings such as balance values, feature flags, and season settings.

```cs theme={null}
var balance = await HyperX.Core.Economy.GameConfigs.Get("balance");
int maxLevel = (int)balance.Data["max_level"];
```

You can pin a version.

```cs theme={null}
var season = await HyperX.Core.Economy.GameConfigs.Get("season", "v2");
```

## Probability Tables

Probability tables contain item keys, weights, and optional payloads. Console validates the table, and only published versions are available to the SDK.

```cs theme={null}
var table = await HyperX.Core.Economy.Probability.Get("starter_box");

var draw = await player.DrawProbability(
    tableKey: "starter_box",
    seed: "tutorial-reward"
);

Debug.Log(draw.ItemKey);
```

With a `seed`, the same user, published version, and seed produce the same result. Deliver rewards according to your game policy.

## In-App Purchase Validation

After a store purchase succeeds, send receipt information to HyperX. HyperX verifies it through the provider API using credentials registered in Console.

```cs theme={null}
var purchase = await player.ValidatePurchase(
    provider: "google_play",
    productId: "gold_pack_100",
    transactionId: "GPA.1234-5678-9012-34567",
    receiptPayload: new
    {
        purchase_token = "STORE_PURCHASE_TOKEN",
        app_identifier = "com.example.game"
    },
    rewardPayload: new { gold = 100 }
);
```

Production providers are `google_play`, `app_store`, and `one_store`.

| Provider      | Receipt Values                                               |
| ------------- | ------------------------------------------------------------ |
| `google_play` | `purchase_token` or `token`, `app_identifier`                |
| `app_store`   | StoreKit transaction ID as `transactionId`, `app_identifier` |
| `one_store`   | `purchase_token` or `token`, `app_identifier`                |

The same `provider + transaction_id` returns the existing purchase record when called again.

## Purchase History and Refunds

```cs theme={null}
var history = await player.PurchaseHistory(limit: 20);
```

Refund, cancel, and revoke events are applied through provider webhooks. Clients should sync against server purchase history instead of rolling back entitlements locally.

See [Provider Integrations](/guide/en/dotnet/provider-integrations) for store credentials and webhook setup.
