Make IAP Purchases In-Game

In this guide, we will walk through how to implement the in-game purchase flow for Epic Games Store using LootLocker, from initiating a purchase to validating and granting rewards to the player.

Prerequisites

Initiate Purchase In-Game

Trigger the Epic Games Store purchase flow from within your game using the Epic Online Services Ecom Interface.

This will present the Epic Games Store checkout overlay to the player. Once the purchase is completed, Epic will return entitlement information that can be used to verify the purchase.

Validate Purchase with LootLocker

Send the Epic entitlement information to LootLocker for validation.

LootLocker will verify the purchase with Epic Games Store to ensure it is valid before granting any rewards.

LootLockerSDKManager.RedeemEpicStorePurchaseForPlayer(
    accountId: epicAccountId,
    bearerToken: epicBearerToken,
    entitlementIds: epicEntitlementIds,
    sandboxId: epicSandboxId,
    onComplete: (response) =>
    {
        if (response.success)
        {
            Debug.Log("Purchase validated and rewards granted!");
            // Refresh player data to see the granted rewards
            LootLockerSDKManager.GetPlayerData((playerResponse) =>
            {
                if (playerResponse.success)
                {
                    Debug.Log("Player data updated with new rewards");
                }
            });
        }
        else
        {
            Debug.LogError("Failed to validate purchase: " + response.errorData.message);
        }
    }
);

Grant Rewards to a Player

After successful validation, LootLocker will grant the configured rewards (Assets, Currency, Progressions) to the player.

Your game should then retrieve the updated player data to reflect the granted rewards.

Grant Rewards to a Class

If your game uses Classes, you can grant rewards directly to those instead of the player.

This is useful for character-specific purchases or unlocks.

Handle Edge Cases

Make sure your implementation accounts for:

  • Failed or cancelled purchases

  • Pending or incomplete checkout flows

  • Duplicate entitlement redemption

  • Redeeming consumable entitlements after they have been granted

  • Restoring or checking ownership for durable entitlements

LootLocker handles purchase validation, but your game is responsible for handling the player experience and refreshing player state after rewards are granted.

Conclusion

You now have the full Epic Games Store purchase flow implemented: initiating a purchase using the Epic Online Services Ecom Interface, validating the entitlement through LootLocker, and granting rewards to the player.

With this setup, you can securely support Epic Games Store in-app purchases while keeping your game logic centralized through LootLocker.

Last updated

Was this helpful?