In this guide, we will walk through how to implement the in-game purchase flow for PlayStation Store using LootLocker, from initiating a purchase to validating and granting rewards to the player.
Prerequisites
- A LootLocker account
- At least one created game in the LootLocker Web Console
- PlayStation Store IAP configured for your game
- A Catalog Listing configured for PlayStation Store IAP
- LootLocker SDK integrated into your game
Initiate Purchase In-Game
Trigger the PlayStation Store purchase flow from within your game using the PlayStation commerce APIs.
Validate Purchase with LootLocker
Send the PlayStation entitlement information to LootLocker for validation.
LootLocker will verify the purchase with PlayStation Store to ensure it is valid before granting any rewards.
LootLockerSDKManager.RedeemPlaystationStorePurchaseForPlayer( transaction_id: transactionIdFromPlayStation, auth_code: authCodeFromPlayStation, entitlement_label: "entitlement_label_configured_in_np_service", 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
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.
LootLockerSDKManager.RedeemPlaystationStorePurchaseForClass( transaction_id: transactionIdFromPlayStation, auth_code: authCodeFromPlayStation, entitlement_label: "entitlement_label_configured_in_np_service", 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
Handle Edge Cases
Make sure your implementation accounts for:
- Failed or cancelled purchases
- Pending or incomplete purchase flows
- Duplicate entitlement redemption
- Refund handling for consumed purchases
- Restoring or checking ownership for durable entitlements
LootLocker handles purchase validation and reward granting, but your game is responsible for handling the player experience and refreshing player state after rewards are granted.
Conclusion
You now have the full PlayStation Store purchase flow implemented: initiating a purchase using PlayStation commerce APIs, validating the entitlement through LootLocker, and granting rewards to the player.
With this setup, you can securely support PlayStation Store in-app purchases while keeping your game logic centralized through LootLocker.
