Skip to content

Make Purchases Through Epic Games Store

This how-to implements the in-game purchase flow for Epic Games Store, from initiating a purchase to validating it and granting rewards to the player.

Prerequisites

Initiate Purchase In-Game

Trigger the Epic Games Store purchase flow from your game using the Epic Online Services Ecom Interface. This presents the Epic Games Store checkout overlay to the player. Once the purchase completes, Epic returns entitlement information you can use to verify the purchase.

Validate Purchase with LootLocker

Send the Epic entitlement information to LootLocker for validation. LootLocker verifies the purchase with Epic Games Store 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 grants the configured rewards (Assets, Currency, and Progressions) to the player. Your game should then retrieve the updated player data to reflect the granted rewards.

Grant Rewards to a Character Class

If your game uses Character Classes, you can grant rewards directly to a Character Class instead of the player. This is useful for character-specific purchases or unlocks.

LootLockerSDKManager.RedeemEpicStorePurchaseForClass(
accountId: epicAccountId,
bearerToken: epicBearerToken,
entitlementIds: epicEntitlementIds,
sandboxId: epicSandboxId,
classId: playerClassId,
onComplete: (response) =>
{
if (response.success)
{
Debug.Log("Purchase validated and rewards granted to class!");
}
else
{
Debug.LogError("Failed to validate purchase: " + response.errorData.message);
}
}
);

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've already been granted
  • Restoring or checking ownership for durable entitlements

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

Conclusion

You've implemented the full Epic Games Store purchase flow: initiating a purchase through the Epic Online Services Ecom Interface, validating the entitlement through LootLocker, and granting rewards to the player. Review LootLocker's full feature set to decide which other features to implement.