← All posts

October 27, 2026 · 11 min read · AppUsta

How to avoid billing errors with Google Play subscriptions

Most Google Play billing bugs don't crash anything. The purchase screen works, the user taps "Subscribe", Play shows its little green checkmark, and everyone moves on. Then three days later the order gets refunded, or a user who upgraded from monthly to yearly opens the app and sees the paywall again, or someone whose card expired keeps premium access for two months for free.

None of these show up in Crashlytics. You find them in your Play Console order list, in one-star reviews ("I PAID and it still asks me to pay!!"), or not at all.

We run several subscription apps on Google Play, and over the years we've stepped on most of these. This is the list we wish someone had handed us before our first Android launch. It's written for people integrating the Play Billing Library directly, but most of it applies if you use RevenueCat, Adapty or a similar SDK too. Those tools handle the plumbing, but you still have to understand what's happening underneath when something goes wrong.

1. Acknowledge every purchase, or Google refunds it

This is the big one, and it catches a lot of teams.

Since Billing Library 2.0, every purchase has to be acknowledged within three days. If it isn't, Google automatically refunds the user and revokes the entitlement. Your app doesn't get an error. The money just goes back.

The usual ways this goes wrong:

  • You grant access in the app but never call acknowledgePurchase() at all, because the purchase "worked" in testing.
  • You acknowledge only inside onPurchasesUpdated, so purchases that complete while your app isn't running (more on that below) never get acknowledged.
  • The acknowledge call fails once because of a flaky network, and you don't retry.
  • A wrapper plugin (Unity IAP, an old Flutter or Cordova plugin) handles it for you, except in some edge case it doesn't.

The fix is boring but it works. Acknowledge only purchases that are actually in the PURCHASED state, only after you've granted the entitlement, and retry with backoff when it fails:

if (purchase.purchaseState == Purchase.PurchaseState.PURCHASED && !purchase.isAcknowledged) {
    val params = AcknowledgePurchaseParams.newBuilder()
        .setPurchaseToken(purchase.purchaseToken)
        .build()
    billingClient.acknowledgePurchase(params) { result ->
        // ERROR, SERVICE_DISCONNECTED and SERVICE_UNAVAILABLE are worth retrying.
        // Acknowledgement can happen in the background, so exponential backoff is fine.
    }
}

If you have a backend, acknowledge from there using purchases.subscriptions.acknowledge after you've verified the token. That way a user who kills the app right after paying still gets acknowledged.

One more thing that wasted half a day for us: with license tester accounts the window is about five minutes, not three days. If your test subscriptions keep getting refunded right after you buy them, that's almost certainly why. Annoying, but it's a useful early warning.

Don't use the three-day window to reject purchases

If a purchase fails your own checks (fraud, a token you can't verify, an account mismatch), it's tempting to simply not acknowledge it and let Google refund it. Google explicitly asks you not to do that. An expired acknowledgement window looks the same to them as your backend being down. Revoke it on purpose instead: for subscriptions, call purchases.subscriptionsv2.revoke with a full refund in the revocation context. It's immediate and unambiguous.

2. Don't grant access for pending purchases

In a lot of markets people pay with cash at a convenience store, through carrier billing, or with other slow payment methods. Those purchases come back as PENDING, not PURCHASED.

A pending purchase isn't paid yet. Don't unlock premium, and don't try to acknowledge it, because you can't. When the payment goes through, the purchase moves to PURCHASED and you handle it like any other. If it never completes, it gets cancelled and nothing happened.

The bug we usually see is a check like if (purchases.isNotEmpty()) unlockPremium(). Always check purchaseState.

3. Purchases happen outside your purchase flow

onPurchasesUpdated only fires for purchases made while your BillingClient is connected and listening. Plenty of purchases don't fit that:

  • A pending payment that completes two days later.
  • A promo code redeemed in the Play Store app.
  • A user who resubscribes from the Play Store's subscription screen.
  • The app process gets killed between payment and the callback.

So call queryPurchasesAsync() when your app starts and when it comes back to the foreground, and run every result through the same processing code as a fresh purchase: check the state, grant, acknowledge. This one habit fixes a surprising share of "I paid but didn't get premium" tickets.

4. Handle the connection properly

BillingClient talks to the Play Store app over a service connection, and that connection drops. The Play Store updates itself in the background, the system kills it, and suddenly your calls return SERVICE_DISCONNECTED.

On recent library versions you can turn on automatic service reconnection when building the client, and let the library deal with it. If you're on an older setup, reconnect with startConnection() before the next call instead of assuming the client is still ready.

It also helps to know which errors are worth retrying:

Code What it usually means What to do
SERVICE_DISCONNECTED Connection to Play dropped Reconnect, then retry
SERVICE_UNAVAILABLE Transient network or Play issue Retry with backoff
ERROR Generic internal error Retry a limited number of times
ITEM_ALREADY_OWNED Your local state is out of date Re-query purchases and grant access
DEVELOPER_ERROR You're calling the API wrong Read debugMessage, fix the code
USER_CANCELED User backed out Do nothing, don't show an error

ITEM_ALREADY_OWNED deserves a special mention. When a user hits it, they've already paid and your app doesn't know. Showing them a generic "purchase failed" message is the worst possible response. Re-query, restore, and say thanks.

And log debugMessage along with the response code. During development it often tells you exactly what's wrong, like a product ID that doesn't exist or an offer token from a different base plan.

5. Upgrades, downgrades and resubscribes create a new purchase token

This one causes the most confusing support tickets.

When a user switches plans (monthly to yearly, basic to pro) or resubscribes from inside your app before their old subscription expired, Google invalidates the old purchase and creates a new one with a new purchase token. The new subscription has a linkedPurchaseToken field pointing at the old one.

If your backend keys entitlements on purchase tokens and ignores linkedPurchaseToken, two things can happen:

  • The user ends up with two active entitlements, because the old token is still marked active in your database.
  • Or, more often, a later notification expires the old token and your system revokes access, even though the user is happily paying for the new plan.

When you get a new token, look up linkedPurchaseToken, find the user it belonged to, move the entitlement to the new token and mark the old one as replaced. Also note that Google blocks plan changes while the current subscription is still waiting to be acknowledged, which is one more reason to get rule #1 right.

While you're there, pass an obfuscatedAccountId (a hashed version of your user ID) in BillingFlowParams when you launch a purchase. It helps Google's fraud detection, and it gives you a reliable way to tie a purchase back to an account. It's especially handy when someone resubscribes after their old subscription fully expired and there's no linked token to follow.

6. Your server should be the source of truth

You can ship a subscription app that only checks queryPurchasesAsync() on the device, and for a small app it mostly works. But you'll be blind to a lot: refunds, chargebacks, payment failures and cancellations that happen while the app is closed.

The setup that holds up over time:

  1. Turn on Real-Time Developer Notifications (RTDN) in Play Console. They're delivered through Google Cloud Pub/Sub.
  2. When a notification arrives, don't trust its contents as the final state. Notifications can arrive twice, out of order, or occasionally not at all. Treat each one as a signal to call purchases.subscriptionsv2.get and store whatever Google says is true right now.
  3. Don't poll the API on a timer for every subscriber. It's slow, you'll hit quotas, and RTDN exists so you don't have to.
  4. Handle notification types you don't recognise by fetching the subscription state anyway. Google adds new types from time to time, and an unknown type shouldn't crash your handler.

For refunds specifically, keep an eye on SUBSCRIPTION_REVOKED notifications and the Voided Purchases API. Users can get refunds from Google directly, and if you don't listen for that, they keep premium for free.

7. Failed renewals: grace period and account hold

Payment failures are where Google Play quietly loses the most money. Cards expire, prepaid balances run out, carrier billing fails. RevenueCat's data puts Google Play's involuntary churn at roughly twice the App Store's, and that matches what we see.

Google gives you two tools here, and both are on by default for auto-renewing base plans:

  • Grace period: Google keeps retrying the payment and the user keeps access. queryPurchasesAsync() still returns the subscription as active, so a basic client-side check handles this automatically.
  • Account hold: after grace (plus a short silent retry of up to 48 hours), the subscription goes on hold. The user should lose access, but they can still fix their payment and get the subscription back without buying again. When they do, the renewal date resets.

The mistakes we've seen (and made):

  • Shortening or turning off the grace period because "it's free premium for non-payers." You can set it shorter than the default, but Google warns this recovers fewer subscriptions, and we've found that to be true. Most of those users meant to keep paying.
  • Treating account hold like a cancellation. The user didn't cancel. Show them a clear "your payment failed, tap here to fix it" screen, not a generic paywall that tries to sell them a new subscription.
  • Not telling the user anything. Google emails them, but people ignore those emails.

The cheapest win here is Google's In-App Messaging API. Call billingClient.showInAppMessages() with the transactional category when your app starts. If the user is in grace period or account hold, Google shows its own small message with a link to fix the payment method. It's a few lines of code, and Google says it roughly doubles recovery. If you're on RevenueCat's SDK, version 7 and later already does this for you.

For your own messages, deep link straight to the subscription in the Play Store instead of explaining where to find it:

https://play.google.com/store/account/subscriptions?sku=YOUR_PRODUCT_ID&package=YOUR_PACKAGE_NAME

8. Price changes can cancel subscribers you didn't mean to lose

When you raise the price for existing subscribers, Play may treat it as opt-in: users have to accept the new price. Anyone who hasn't accepted by the time they renew at the higher price is automatically cancelled, and you get a SUBSCRIPTION_CANCELED notification.

That surprises people. You raise prices by a dollar, and a slice of your loyal, happy subscribers churn simply because they never opened the email. Before a price increase, read the current Play Console rules for whether your change is opt-in or opt-out in each country, plan some in-app messaging around it, and watch cancellations closely for the next couple of renewal cycles.

9. Keep your Billing Library version current

Google deprecates old versions of the Play Billing Library on a schedule, and once a version is past its deadline you can't publish app updates with it. Since August 31, 2026, new apps and updates must use Billing Library 8 or newer. Teams that asked for an extension have until November 1, 2026, which is days away as we write this. Apps already in the store keep working; it's your next update that gets blocked.

Version 8 also removed some APIs people still relied on, including queryPurchaseHistoryAsync() and querySkuDetailsAsync(). If you were using purchase history for "restore purchases", that code won't compile anymore. Use queryPurchasesAsync() for active purchases, and keep the history on your own backend.

Don't leave this upgrade for the week of a release. Billing code is the last thing you want to change in a hurry.

A pre-release checklist

Before any release that touches billing, we run through this with a license tester account and a real device:

  • Buy a subscription and confirm it's acknowledged (in the Play Console order list it should not get refunded a few minutes later).
  • Use the "slow test card" to make a pending purchase. Confirm no access is granted, then approve it and confirm access appears without reopening the purchase screen.
  • Kill the app right after paying. Reopen it. Access should be there.
  • Upgrade monthly → yearly. Check that your backend moved the entitlement to the new token.
  • Use the "test card, always declines" to force a renewal failure. Check grace period behaviour, then account hold, then recovery.
  • Refund a test order from Play Console. Confirm access is revoked.
  • Turn on airplane mode mid-purchase and make sure nothing gets stuck.

License testers get accelerated renewals (a monthly subscription renews every few minutes), so you can walk through a full lifecycle in under an hour.

The short version

If you only take a few things from this:

  1. Acknowledge every PURCHASED purchase, with retries, ideally from your server.
  2. Never grant access for PENDING.
  3. Call queryPurchasesAsync() on every app start and resume.
  4. Follow linkedPurchaseToken when tokens change.
  5. Let RTDN tell you when something changed, and the Developer API tell you what changed.
  6. Keep grace period on, show in-app messages, and treat account hold as "fix your card", not "buy again".

Billing is the one part of an app where a small bug turns directly into lost revenue, and usually without you noticing. It's worth an afternoon of tests.


Sources and further reading