Consumable products are the most common type of in-app purchase in mobile games. They can be purchased multiple times because they are "consumed" after use.
Examples include coins, gems, energy, extra lives, hints, boosters, and other virtual currencies.
This guide explains how to implement consumable purchases using Unity IAP with a production-ready workflow.
Complete the previous guides before continuing:
A consumable product can be purchased repeatedly.
Every successful purchase grants the player additional resources.
Examples:
- 100 Coins
- 500 Coins
- 1000 Gems
- Extra Lives
- Energy Refill
- Hint Pack
Unlike non-consumables, ownership is not permanent.
A standard consumable purchase follows this sequence:
Player taps Buy Button
│
▼
Unity IAP starts purchase
│
▼
Store processes payment
│
▼
Purchase Successful
│
▼
Validate Product
│
▼
Reward Player
│
▼
Complete Transaction
Use clear and descriptive Product IDs.
com.company.game.coin100
com.company.game.coin500
com.company.game.coin1000
com.company.game.energy
com.company.game.hints
Avoid changing Product IDs after publishing.
When initializing Unity IAP, register each consumable product.
Example:
builder.AddProduct(
"com.company.game.coin100",
ProductType.Consumable
);
builder.AddProduct(
"com.company.game.coin500",
ProductType.Consumable
);Repeat this process for every consumable item in your game.
When the player presses a purchase button, initiate the purchase using the Product ID.
Example:
controller.InitiatePurchase("com.company.game.coin100");Unity IAP communicates with Google Play or the App Store and handles the payment process.
When a purchase succeeds:
- Verify the purchased Product ID.
- Reward the player.
- Save the updated player data.
- Complete the transaction.
Example:
switch(product.definition.id)
{
case "com.company.game.coin100":
playerCoins += 100;
break;
}Always grant rewards only after confirming the purchase was successful.
After rewarding the player, save the updated data immediately.
Example:
Purchase Success
↓
Grant Coins
↓
Save Game
↓
Update UI
Saving immediately helps prevent progress loss if the game closes unexpectedly.
Not every purchase will succeed.
Possible reasons include:
- Payment cancelled
- Network error
- Store unavailable
- Invalid Product ID
- Billing unavailable
Always inform the player with a clear, user-friendly message instead of failing silently.
Consumable purchases are not restored.
Once consumed, they are considered used.
Examples:
- Coins
- Gems
- Energy
If your game needs to restore consumable balances across devices, implement a secure cloud-based inventory system.
Before publishing your game:
- Test every consumable product.
- Verify the correct reward is granted.
- Confirm purchases complete successfully.
- Test failed purchases.
- Test repeated purchases.
- Check that saved data updates correctly.
Never release without testing every purchase flow.
Follow these recommendations:
- Use descriptive Product IDs.
- Grant rewards only after successful purchases.
- Save player progress immediately.
- Prevent duplicate rewards.
- Display loading indicators during purchases.
- Handle errors gracefully.
- Log purchase events for debugging.
- Keep purchase logic centralized in one manager class.
Avoid these common issues:
- Rewarding players before purchase confirmation.
- Using incorrect Product IDs.
- Forgetting to save player data.
- Ignoring failed purchases.
- Hardcoding values throughout the project.
- Allowing duplicate purchase processing.
For larger games:
- Create a dedicated
IAPManager. - Store Product IDs in constants or ScriptableObjects.
- Separate UI from purchasing logic.
- Log purchases for analytics.
- Validate receipts for high-value purchases.
- Keep purchasing code reusable and modular.
This approach makes your purchasing system easier to maintain as your game grows.
Consumable products are only one type of purchase.
The next guide explains Non-Consumable Purchases, which unlock permanent content such as Remove Ads, Premium Versions, and Character Packs.
You can also jump to any section of the guide: