Grant and Consume a Consumable Purchase
A 4-step recipe with Android. We can help you get access.
Recipe · 4 steps
Grant and Consume a Consumable Purchase
with Android · Entitlement Enforcement
Verify, acknowledge, and consume a consumable in-app product purchase.
- Validate the consumable purchase token and read its purchase and consumption state before granting anything to the user.
- Acknowledge the purchase after the in-game currency or consumable entitlement has been credited to the user's account.
- Consume the purchase so the SKU becomes available for the user to buy again. Only call this once the entitlement has actually been granted.
- Read the purchase back to confirm Google Play now reports the item as consumed and therefore repurchasable.
What you'll need to have ready
- packageName: The package name of the application (e.g. com.example.myapp).
- productId: The consumable in-app product SKU (e.g. com.example.myapp.coins100).
- purchaseToken: The purchase token supplied to the app by Google Play at purchase time.
- developerPayload: Optional developer-specified string recorded against the purchase when acknowledging, typically an internal grant reference.
For your developer
Arazzo workflow android:grant-consumable-purchase, 4 operations: getPurchaseProduct → acknowledgePurchaseProduct → consumePurchaseProduct → getPurchaseProduct. Specs on APIs.io.