# Make Purchases through Steam Store

## Creating In app Purchase for Steam

Setting up your catalog item for sale in Steam is super simple! All you need to do is go to your [catalogs](https://console.lootlocker.com/economy/catalogs/) and find the catalog item that you wish to sell head to `Actions` and Configure IAP, but don't forget to press `List For Sale` as otherwise, this item will not be purchasable.

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-fec54bb2bab266d6ae18ce5ddbc3247f68d849f1%2Fimage.png?alt=media" alt="" width="211"><figcaption></figcaption></figure>

You can set up multiple prices with different real life currencies, USD is the default.

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-4e7f84fd0393202984e6efc6c1733ac703a93681%2Fimage.png?alt=media" alt="" width="256"><figcaption></figcaption></figure>

Redeeming purchases using the Steam Store is split into three stages.

1. BeginSteamPurchaseRedemption

   This method requires a lot of initial information, such as SteamID of the user attempting to purchase, the currency, the language, and the Catalog Listing Item ID. This in return gives you an Entitlement\_id which will be used throughout the flow.
2. QuerySteamPurchaseRedemption

   This method requires the Entitlement\_id which we got from BeginSteamPurchaseRedemption. This function will return a status on the purchase, has the user accepted and paid? Did they cancel? All this information is available here, you should iterate it until a final decision has been made by the user.
3. FinalizeSteamPurchaseRedemption

   This method also requires the Entitlement\_id, this function redeems the purchase on LootLocker, giving the user the asset to their LootLocker Inventory. Calling this method is only possible once QuerySteamPurchaseRedemption returns an "Approved" status.

## Redeeming In app Purchase for Player

{% hint style="warning" %}
To be able to make Steam purchases, the game must have working Steam integration, Steam must be launched on the device and the player must own the game.
{% endhint %}

Follow the links to learn more about [languages](https://partner.steamgames.com/doc/store/localization/languages) and [currency](https://partner.steamgames.com/doc/store/pricing/currencies).

{% tabs %}
{% tab title="Unity" %}
{% hint style="info" %}
It is recommended to use our [Steam Authentication](https://github.com/lootlocker/gitbook-sync/blob/main/commerce/players/authentication/steam.md) for a better experience for your users.
{% endhint %}

In this example we used [Steamworks.net](https://steamworks.github.io/) plugin to get the steamID of the user, as well as the language they're playing in.

```csharp

CSteamID user = SteamUser.GetUserInfo();
string localLanguage = SteamApps.GetCurrentGameLanguage();
LootLockerSDKManager.BeginSteamPurchaseRedemption(user.ToString(), "USD", localLanguage, "01HRCA5QQBV9P0A57RFK9J073T", (response) =>
{

    if (!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        return;
    }
    entitlementID = response.entitlement_id;

});
```

```csharp
LootLockerSDKManager.QuerySteamPurchaseRedemption(entitlementID, (response) =>
{

    if (!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        return;
    }

    if (response.status == LootLocker.LootLockerEnums.SteamPurchaseRedemptionStatus.Approved)
    {
        // Steam purchase is approved by the user and is ready to be redeemed by calling FinalizeSteamPurchaseRedemption
    }

});
```

```csharp
LootLockerSDKManager.FinalizeSteamPurchaseRedemption(entitlementID, (response) =>
{
    if (!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        return;
    }

});
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-54676e23d2c92d5acf8fde629c2ea39dd36cdf56%2Fimage.png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/q0svk_xn/">Blueprint example of Starting Redemption of purchase for Player</a></p></figcaption></figure>

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-00230c2480526ae9014b78246fe97aa06ef13309%2Fimage.png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/zj255w_8/">Blueprint example of querying the Purchase status</a></p></figcaption></figure>

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-ed18119b3ccd1e02398fd995016067546fafd20e%2Fimage.png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/yvuo2atg/">Blueprint example of Finalizing the purchase</a></p></figcaption></figure>
{% endtab %}

{% tab title="REST" %}
Begin Purchase

```bash
curl --location --request POST 'https://api.lootlocker.io/game/store/steam/redeem/begin' \
--header 'x-session-token: {{session_token}}' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
  "steam_id": "76561198043649707",
  "currency": "USD",
  "language": "en",
  "catalog_item_id": "01HM6G77Y87AWWQ75MCG9V66VQ"
}'
```

Query Purchase

```bash
curl --location --request POST 'https://api.lootlocker.io/game/store/steam/redeem/query' \
--header 'x-session-token: {{session_token}}' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
    "entitlement_id": "{{steam_entitlement_id}}"
}'
```

Finalize Purchase

```bash
curl --location --request POST 'https://api.lootlocker.io/game/store/steam/redeem/finalise' \
--header 'x-session-token: {{session_token}}' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
    "entitlement_id": "{{steam_entitlement_id}}"
}'
```

{% endtab %}
{% endtabs %}

## Redeeming In app Purchase for Class

{% hint style="warning" %}
To be able to make Steam purchases, the game must have working Steam integration, Steam must be launched on the device and the player must own the game
{% endhint %}

{% tabs %}
{% tab title="Unity" %}
{% hint style="info" %}
It is recommended to use our [Steam Authentication](https://github.com/lootlocker/gitbook-sync/blob/main/commerce/players/authentication/steam.md) for a better experience for your users.
{% endhint %}

In this example we used [Steamworks.net](https://steamworks.github.io/) plugin to get the steamID of the user.

```csharp

CSteamID user = SteamUser.GetUserInfo();

LootLockerSDKManager.BeginSteamPurchaseRedemptionForClass(user.ToString(), "USD", "en", "01HRCA5QQBV9P0A57RFK9J073T", (response) =>
{

    if (!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        return;
    }
    entitlementID = response.entitlement_id;

});
```

```csharp
LootLockerSDKManager.QuerySteamPurchaseRedemption(entitlementID, (response) =>
{

    if (!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        return;
    }

    if (response.status == LootLocker.LootLockerEnums.SteamPurchaseRedemptionStatus.Approved)
    {
        // Steam purchase is approved by the user and is ready to be redeemed by calling FinalizeSteamPurchaseRedemption
    }

});
```

```csharp
LootLockerSDKManager.FinalizeSteamPurchaseRedemption(entitlementID, (response) =>
{
    if (!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        return;
    }

});
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-ed3f679589ece362435b16e2f4ef20d305ee6c37%2Fimage.png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/xynsg67z/">Blueprint example of beginning a Steam Purchase for Class</a></p></figcaption></figure>

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-00230c2480526ae9014b78246fe97aa06ef13309%2Fimage.png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/zj255w_8/">Blueprint example of querying the Purchase status</a></p></figcaption></figure>

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-ed18119b3ccd1e02398fd995016067546fafd20e%2Fimage.png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/yvuo2atg/">Blueprint example of Finalizing the purchase</a></p></figcaption></figure>
{% endtab %}

{% tab title="REST" %}
Begin Purchase

```bash
curl --location --request POST 'https://api.lootlocker.io/game/store/steam/redeem/begin' \
--header 'x-session-token: {{session_token}}' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
  "character_id": 123,
  "steam_id": "76561198043649707",
  "currency": "USD",
  "language": "en",
  "catalog_item_id": "01HM6G77Y87AWWQ75MCG9V66VQ"
}'
```

Query Purchase

```bash
curl --location --request POST 'https://api.lootlocker.io/game/store/steam/redeem/query' \
--header 'x-session-token: {{session_token}}' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
    "entitlement_id": "{{steam_entitlement_id}}"
}'
```

Finalize Purchase

```bash
curl --location --request POST 'https://api.lootlocker.io/game/store/steam/redeem/finalise' \
--header 'x-session-token: {{session_token}}' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
    "entitlement_id": "{{steam_entitlement_id}}"
}'
```

{% endtab %}
{% endtabs %}


---

# 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.lootlocker.com/commerce/real-money-purchases/how-to/steam-store-purchasing.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.
