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
Section titled “Prerequisites”- Epic Games Store IAP configured for your game
- A Catalog Listing configured for Epic Games Store IAP
- Unity, Unreal, or Godot SDK installed and configured in your project (not required for REST).
- An active Game Session
Initiate Purchase In-Game
Section titled “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
Section titled “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); } });Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Grant Rewards to a Player
Section titled “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
Section titled “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); } });Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Handle Edge Cases
Section titled “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
Section titled “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.