Use this page with AI

Copy this into your coding assistant and add your request.

Read https://openiap.dev/docs/apis/android/consume-purchase-android and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.

My request: [describe what customers should be able to do]
See an example request →

Android consumePurchaseAndroid

Consume a consumable purchase, allowing repurchase. Automatically acknowledges the purchase.

Wraps BillingClient.consumeAsync(ConsumeParams) — for consumables (re-buyable like coins). Same 3-day deadline as acknowledge. See the Google Play Billing reference.

Signature

kt
suspend fun consumePurchase(purchaseToken: String): Boolean

Parameters#

  • purchaseToken (required, string) — Purchase token from the Play Billing transaction.

Returns#

Promise<boolean> — true once the purchase has been consumed.

Example

kt
openIapStore.consumePurchase(purchase.purchaseToken)

Note: Called automatically by finishTransaction() when isConsumable is true.