Use this page with AI

Copy this into your coding assistant and add your request.

Read https://openiap.dev/docs/apis/finish-transaction 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 →

finishTransaction

Complete a purchase transaction. Must be called after verifying the purchase to remove it from the queue.

iOS: Calls Transaction.finish(). Until you do, the same transaction replays through Transaction.updates on every app launch. Apple docs. Android: Acknowledges (acknowledgePurchase) for non-consumables/subscriptions or consumes (consumeAsync) for consumables. Google auto-refunds within 3 days if neither runs. Google docs.

Signature

swift
func finishTransaction(purchase: PurchaseInput, isConsumable: Bool?) async throws

Parameters#

The transaction to close, plus an optional consumable flag:

  • purchase (required, Purchase) — The purchase / transaction to finalize. Must come from requestPurchase or getAvailablePurchases.
  • isConsumable (optional, boolean, default false) — Android. true consumes the token (re-buyable like coins); false just acknowledges (non-consumables, subscriptions). iOS always calls Transaction.finish() regardless.

Returns#

Promise<void> — Resolves once the platform finalizes the transaction.

Throws#

When the platform finalize call fails.

Example

swift
try await OpenIapModule.shared.finishTransaction(
    purchase: purchase,
    isConsumable: false
)