Google Play Billing (One-Time Purchases) for Android

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Google Play Billing (One-Time Purchases) for Android
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing Google Play Billing (One-Time Purchases) for Android

Google Play Billing Library 6+ (mandatory for new applications since 2023, for updates since 2024) restructured the purchase API. BillingClient.queryPurchasesAsync replaced the synchronous queryPurchases, and PendingPurchasesParams was introduced for deferred transactions. Applications on BillingClient 4 and below are rejected during publication.

One-time products: INAPP vs DURABLE

In Play Billing 6+, one-time purchases are divided into two subtypes:

  • INAPP (legacy type) — consumables and non-consumables in one cart
  • DURABLE — explicitly non-consumable, new type with BillingClient 6

In practice, for "remove ads" and "unlock levels" we use ProductType.INAPP with acknowledged status as an ownership marker.

Acknowledgement — where everything breaks

Every purchase must be confirmed within 3 days through acknowledgePurchase() or consumePurchase() (for consumables). If not confirmed — Google automatically refunds the money and revokes the purchase. This is not obvious from the documentation.

val billingClient = BillingClient.newBuilder(context)
    .setListener { billingResult, purchases ->
        purchases?.forEach { purchase ->
            if (purchase.purchaseState == Purchase.PurchaseState.PURCHASED) {
                if (!purchase.isAcknowledged) {
                    val params = AcknowledgePurchaseParams.newBuilder()
                        .setPurchaseToken(purchase.purchaseToken)
                        .build()
                    billingClient.acknowledgePurchase(params) { result ->
                        if (result.responseCode == BillingClient.BillingResponseCode.OK) {
                            unlockFeature(purchase.products.first())
                        }
                    }
                }
            }
        }
    }
    .enablePendingPurchases(
        PendingPurchasesParams.newBuilder()
            .enableOneTimeProducts()
            .build()
    )
    .build()

enablePendingPurchases() is now mandatory. Without it, BillingClient.startConnection() throws an exception. Pending purchases (cash payments through Google Pay partners in some regions) transition to PURCHASED not immediately — you need to listen for updates through PurchasesUpdatedListener.

Purchase restoration on reinstall

On app reinstall, purchases are restored through queryPurchasesAsync(QueryPurchasesParams). Call on every startup:

val params = QueryPurchasesParams.newBuilder()
    .setProductType(BillingClient.ProductType.INAPP)
    .build()

billingClient.queryPurchasesAsync(params) { billingResult, purchaseList ->
    purchaseList.filter {
        it.purchaseState == Purchase.PurchaseState.PURCHASED && it.isAcknowledged
    }.forEach { restoreAccess(it) }
}

Server verification

For server-side applications — send purchaseToken to your backend, which verifies purchaseState and acknowledgementState through Google Play Developer API (purchases.products.get). Only then unlock content in the database.

Estimated time — 2–3 days: Billing Library 6 integration, handling all purchase states, server verification, testing through Google Play Console License Testing.