Skip to content

· 10 min read · Nadeera Silva

Payments

Google Play Purchase Not Acknowledged: Stop 3-Day Refunds

Google Play refunds purchases that are not acknowledged within 3 days. Fix completePurchase() in Flutter and add a server backstop that acknowledges.

Glass hourglass with amber sand nearly run out beside an Android phone showing a blurred teal confirmation card, a hand about to tap it, standing for the 3-day window to acknowledge a Google Play purchase

If your Google Play purchase is not acknowledged within 3 days, Google refunds the order and takes the item or subscription back from the user. Your sales report shows the money arriving and then leaving, and the customer loses access they paid for. It is a common bug in Flutter apps that use the in_app_purchase plugin and call completePurchase() in the wrong place. This post shows how to confirm that unacknowledged purchases are the cause, how to fix the Flutter code, and how to add a server-side backstop so it can't happen again.

Quick answer

Google Play requires every purchase to be acknowledged within three days, or it is automatically refunded and the entitlement revoked. In Flutter, acknowledging happens when you call InAppPurchase.instance.completePurchase() for every purchase with pendingCompletePurchase == true, from a listener that starts when the app starts. Add a server job that checks acknowledgementState with the Play Developer API and acknowledges anything your app missed.

What this means for your app or business

  • Lost revenue that looks like refunds. Every unacknowledged order is returned to the buyer in full. For a subscription app, that can be a large share of new sign-ups before anyone notices.
  • Angry paying users. People pay, get access, then lose it a few days later without asking for a refund. That leads to support emails and 1-star reviews.
  • It is usually a small code fix. Expect a few dozen lines of app code plus a server check. With testing on license testers, plan for roughly half a day to a day of work.
  • When to get help. If your Play Console Orders page shows refunds you did not issue, or users say their purchase "disappeared", get a developer to check the purchase flow before your next release.

How do I know my purchases were not acknowledged?

There are three quick checks.

  1. Play Console orders. In Play Console, open Order management and look for refunded orders that nobody on your team refunded, clustered about three days after purchase.
  2. License tester emails. For license testers, the window is only 3 minutes, and Google sends an email about the cancellation. If test purchases vanish a few minutes after buying, you have the same bug as production.
  3. The Voided Purchases API. Each voided purchase has a voidedReason. The value 8 means `Unacknowledged_purchase` in the voided purchases reference. This is the clearest proof.
SignalWhat it tells youWhere to look
Refund about 3 days after purchasePurchase never acknowledgedPlay Console order management
Test purchase gone after about 3 minutesSame bug, seen in testingLicense tester email, Orders tab
voidedReason: 8Google refunded it for missing acknowledgementVoided Purchases API
acknowledgementState: 0 on a live tokenStill inside the window, can be fixed nowpurchases.products.get
ACKNOWLEDGEMENT_STATE_PENDINGSubscription not yet acknowledgedpurchases.subscriptionsv2.get
Flow from purchase to acknowledgement in a Flutter app, with the 3 day and 3 minute windows and the voidedReason 8 refund path
Every Google Play purchase has to reach step 5 before the window closes.

Why does Google Play refund purchases after 3 days?

Since Play Billing Library 2.0, Google treats acknowledgement as your app's promise that it delivered what the user paid for. The Billing Library release notes state that failing to acknowledge a purchase results in a refund. Consuming a consumable also counts as acknowledging it.

In Flutter, the plugin does the acknowledging for you, but only when you call completePurchase(). The Android implementation skips purchases that are already acknowledged and calls acknowledgePurchase for the rest. So the refund means completePurchase() never ran for that purchase, or it ran and failed.

What causes unacknowledged purchases in Flutter?

These are the usual patterns.

The listener lives on the paywall screen

The in_app_purchase README says to start listening to purchaseStream as early as possible, so you catch updates from previous sessions too. If you subscribe in the paywall's initState and cancel in dispose, any purchase that finishes after the user leaves that screen, or after the app was killed mid-purchase, is never completed.

Only purchased is handled, not restored

A purchase can come back as PurchaseStatus.restored. The plugin docs say you are responsible for completing every purchase whose status is purchased or restored. Code that only checks purchased leaves restored ones hanging.

An exception skips completePurchase()

If server verification throws (timeout, 500, expired token), the code jumps past completePurchase(). The purchase stays unacknowledged, and nothing retries it.

Pending payments are treated like normal purchases

Some payment methods are delayed. Grant access and acknowledge only when the status becomes purchased. The docs warn that completing a pending purchase throws an exception.

The Android result code is ignored

Consumables bought with autoConsume: false

buyConsumable() has autoConsume set to true by default. If you turn it off, you must call consumePurchase() from InAppPurchaseAndroidPlatformAddition yourself within the window.

How do I fix it in Flutter?

Step 1: Listen from app start

Create one purchase service when the app starts and keep it alive for the whole session.

// lib/purchases/purchase_service.dart
import 'dart:async';
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:in_app_purchase_android/in_app_purchase_android.dart';
import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart';

class PurchaseService {
  PurchaseService(this._verifyAndGrant);

  /// Calls your backend. Returns true when the purchase is valid and access was granted.
  final Future<bool> Function(PurchaseDetails) _verifyAndGrant;
  StreamSubscription<List<PurchaseDetails>>? _sub;

  void start() {
    _sub ??= InAppPurchase.instance.purchaseStream.listen(
      (list) async {
        for (final p in list) {
          await _handle(p);
        }
      },
      onError: (Object e) {
        // Log it. The server backstop (step 3) still acknowledges valid purchases.
      },
    );
  }

  Future<void> _handle(PurchaseDetails p) async {
    if (p.status == PurchaseStatus.pending) return; // wait for purchased

    if (p.status == PurchaseStatus.purchased ||
        p.status == PurchaseStatus.restored) {
      try {
        final ok = await _verifyAndGrant(p);
        if (!ok) return; // invalid: do not grant, let Google refund it
      } catch (_) {
        return; // backend down: the server backstop or the next launch retries
      }
    }

    if (p.pendingCompletePurchase) {
      await _complete(p);
    }
  }

  Future<void> _complete(PurchaseDetails p) async {
    final platform = InAppPurchasePlatform.instance;
    if (platform is InAppPurchaseAndroidPlatform) {
      final result = await platform.completePurchase(p);
      if (result.responseCode != BillingResponse.ok) {
        // Not acknowledged. Report it so the server job picks it up.
        throw StateError('Acknowledge failed: ${result.responseCode}');
      }
    } else {
      await InAppPurchase.instance.completePurchase(p);
    }
  }

  /// Lets other code (step 2) run a purchase through the same logic.
  Future<void> handleExternal(PurchaseDetails p) => _handle(p);

  void dispose() => _sub?.cancel();
}

Start it in main() before runApp, after WidgetsFlutterBinding.ensureInitialized(). Add in_app_purchase_android and in_app_purchase_platform_interface to pubspec.yaml, since the code imports them directly.

Step 2: Pick up anything left from earlier sessions

On Android, ask Play for purchases it still has, and run them through the same handler. queryPastPurchases() is on InAppPurchaseAndroidPlatformAddition.

Future<void> reprocessAndroidPurchases(PurchaseService service) async {
  final addition = InAppPurchase.instance
      .getPlatformAddition<InAppPurchaseAndroidPlatformAddition>();
  final response = await addition.queryPastPurchases();
  for (final p in response.pastPurchases) {
    await service.handleExternal(p);
  }
}

Step 3: Acknowledge on the server as a backstop

The app can be killed or offline at the wrong moment. Your backend already receives the token for verification, so let it acknowledge too. Google's integration guide recommends Purchases.products:acknowledge from a secure backend, after checking acknowledgementState.

This Node script checks one token and acknowledges it if needed. It uses google-auth-library and a service account that has access to the app in Play Console. If you get a 403, see my post on the Google Play "caller does not have permission" error.

// play-ack-check.mjs
// Check (and optionally fix) Google Play purchases that were never acknowledged.
// Usage:
//   node play-ack-check.mjs key.json com.example.app product   <productId> <purchaseToken> [--ack]
//   node play-ack-check.mjs key.json com.example.app subscription <productId> <purchaseToken> [--ack]
//   node play-ack-check.mjs key.json com.example.app voided
import { readFileSync } from 'node:fs';
import { JWT } from 'google-auth-library';

const [keyFile, pkg, kind, productId, token] = process.argv.slice(2);
const doAck = process.argv.includes('--ack');
if (!keyFile || !pkg || !['product', 'subscription', 'voided'].includes(kind)) {
  console.error('Usage: node play-ack-check.mjs <key.json> <package> product|subscription|voided [productId token] [--ack]');
  process.exit(2);
}

const API = (process.env.PLAY_API_BASE ?? 'https://androidpublisher.googleapis.com') +
  '/androidpublisher/v3/applications/' + encodeURIComponent(pkg);

async function accessToken() {
  if (process.env.PLAY_ACCESS_TOKEN) return process.env.PLAY_ACCESS_TOKEN; // e.g. from gcloud
  const key = JSON.parse(readFileSync(keyFile, 'utf8'));
  const jwt = new JWT({ email: key.client_email, key: key.private_key,
    scopes: ['https://www.googleapis.com/auth/androidpublisher'] });
  return (await jwt.getAccessToken()).token;
}
const auth = { Authorization: 'Bearer ' + (await accessToken()) };

async function call(path, method = 'GET') {
  const res = await fetch(API + path, { method, headers: { ...auth, 'Content-Type': 'application/json' },
    body: method === 'POST' ? '{}' : undefined });
  const text = await res.text();
  if (!res.ok) throw new Error(res.status + ' ' + text);
  return text ? JSON.parse(text) : {};
}

const t = encodeURIComponent(token ?? '');
const p = encodeURIComponent(productId ?? '');

if (kind === 'voided') {
  // Lists refunds and revocations from the last 30 days (API default window).
  const data = await call('/purchases/voidedpurchases?type=1&maxResults=1000');
  const list = data.voidedPurchases ?? [];
  const unacked = list.filter((v) => v.voidedReason === 8); // 8 = Unacknowledged_purchase
  console.log('Voided purchases:', list.length, '| refunded because never acknowledged:', unacked.length);
  for (const v of unacked) console.log(' ', v.orderId, new Date(Number(v.voidedTimeMillis)).toISOString());
} else if (kind === 'product') {
  const d = await call('/purchases/products/' + p + '/tokens/' + t);
  const state = ['purchased', 'canceled', 'pending'][d.purchaseState] ?? d.purchaseState;
  console.log('Order', d.orderId, '| state:', state, '| acknowledged:', d.acknowledgementState === 1,
    '| consumed:', d.consumptionState === 1);
  if (doAck && d.purchaseState === 0 && d.acknowledgementState === 0) {
    await call('/purchases/products/' + p + '/tokens/' + t + ':acknowledge', 'POST');
    console.log('Acknowledged now.');
  }
} else {
  const d = await call('/purchases/subscriptionsv2/tokens/' + t);
  console.log('Subscription state:', d.subscriptionState, '| ack:', d.acknowledgementState);
  if (doAck && d.acknowledgementState === 'ACKNOWLEDGEMENT_STATE_PENDING' &&
      ['SUBSCRIPTION_STATE_ACTIVE', 'SUBSCRIPTION_STATE_IN_GRACE_PERIOD'].includes(d.subscriptionState)) {
    await call('/purchases/subscriptions/' + p + '/tokens/' + t + ':acknowledge', 'POST');
    console.log('Acknowledged now.');
  }
}

I tested this script on Node 24 against a local mock of the three endpoints: it reads the state, acknowledges once, and the next run reports acknowledged: true. Run it with --ack only for tokens your server has verified and granted.

For subscriptions, the `subscriptionsv2` resource reports ACKNOWLEDGEMENT_STATE_PENDING until it is acknowledged. The acknowledge call still uses `purchases.subscriptions.acknowledge`.

How do I verify the fix?

  1. Add a license tester in Play Console and install a build from an internal testing track.
  2. Buy a product, then force-close the app before the success screen appears.
  3. Reopen the app. The purchase should come through purchaseStream or queryPastPurchases() and be completed.
  4. Wait more than 3 minutes. The order should still be active, with no cancellation email.
  5. Run node play-ack-check.mjs key.json com.your.app product <productId> <token> and confirm acknowledged: true.
  6. Run the voided mode after a week of real sales and confirm there are no new voidedReason: 8 entries.

How do I prevent it next time?

  • Start the purchase listener in main(), never only on a paywall screen.
  • Handle purchased and restored, skip pending.
  • Check the Android BillingResponse from completePurchase().
  • Keep a server backstop that acknowledges verified tokens.
  • Add a weekly alert on voidedReason: 8 from the Voided Purchases API.
  • Re-test with a license tester whenever you upgrade in_app_purchase or the Billing Library. My post on the Play Billing Library deadline covers that upgrade.

If you use RevenueCat, it completes purchases for you by default. Only when you set purchasesAreCompletedBy to your app (formerly observer mode) do you have to acknowledge yourself, as RevenueCat's docs explain. If your paywall shows no products at all, that is a different problem, covered in Flutter in-app purchase product not found.

Frequently asked questions

Why was my Google Play purchase refunded after 3 days?

Google Play refunds and revokes any purchase that the app or backend does not acknowledge within three days. In Flutter this usually means completePurchase() was never called for that purchase, or it failed silently.

How do I acknowledge a purchase in Flutter?

Call InAppPurchase.instance.completePurchase() for every purchase whose pendingCompletePurchase is true, after you have verified it and granted access. On Android the plugin then calls acknowledgePurchase for you.

How long do license testers have to acknowledge a purchase?

Three minutes. Google refunds an unacknowledged license tester purchase after 3 minutes and sends an email about the cancellation, which makes the bug easy to reproduce.

How can I prove a refund was caused by a missing acknowledgement?

Call the Google Play Developer API voided purchases list. A voidedReason of 8 means Unacknowledged_purchase, so Google refunded it because nobody acknowledged it.

Can I acknowledge Google Play purchases from my server?

Yes. Use purchases.products.acknowledge for one-time products and purchases.subscriptions.acknowledge for subscriptions, after checking acknowledgementState. Google recommends this when you have a secure backend.

Should I acknowledge a pending purchase?

No. Wait until the status changes to purchased. The Flutter plugin throws an exception if you try to complete a pending purchase.

Does consuming a product count as acknowledging it?

Yes. Consuming a consumable, which in_app_purchase does by default with autoConsume, also acknowledges it. If you set autoConsume to false you must consume it yourself within the window.

Does RevenueCat acknowledge Google Play purchases for me?

Yes by default. If you configure purchasesAreCompletedBy as your app, formerly observer mode, your own code must acknowledge each purchase.

Sources

  1. Integrate the Google Play Billing Library into your app (Android Developers)
  2. Test your Google Play Billing Library integration (Android Developers)
  3. Google Play Billing Library release notes (Android Developers)
  4. Fight fraud and abuse (purchase security) (Android Developers)
  5. purchases.voidedpurchases resource (Google for Developers, 2026-09-28)
  6. Method: purchases.voidedpurchases.list (Google for Developers)
  7. purchases.products resource (Google for Developers)
  8. Method: purchases.products.acknowledge (Google for Developers)
  9. Method: purchases.subscriptions.acknowledge (Google for Developers)
  10. purchases.subscriptionsv2 resource (Google for Developers)
  11. in_app_purchase 3.3.1 (pub.dev (flutter.dev))
  12. in_app_purchase_android 0.5.5 changelog (pub.dev (flutter.dev))
  13. InAppPurchaseAndroidPlatform.completePurchase (pub.dev (flutter.dev))
  14. InAppPurchase.completePurchase (pub.dev (flutter.dev))
  15. InAppPurchasePlatform.buyConsumable (pub.dev (flutter.dev))
  16. Using the SDK with your own IAP code (RevenueCat)
SharePost on XLinkedIn

Comments

Share a question or note about this article.

Loading comments…