Google Play Billing (Consumable) 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 (Consumable) 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 (Consumable Purchases) for Android

Consumable in Google Play Billing is an INAPP product that must be explicitly "consumed" through consumeAsync() after purchase. Until the purchase is consumed, repeated purchase of the same product is impossible: BillingClient.launchBillingFlow returns ITEM_ALREADY_OWNED. This is the main difference from iOS, where consumable logic is determined on the application side, not the platform.

Order of consume and double-charge risk

The "buy → credit → consume" pattern works only with stable network. In reality:

// Wrong: consume immediately after receiving purchase
billingClient.consumeAsync(params) { result, token ->
    if (result.responseCode == BillingClient.BillingResponseCode.OK) {
        addCoins(100) // crash here = consume passed, coins not credited
    }
}

Correct order with server architecture:

  1. Get purchaseToken from PurchasesUpdatedListener
  2. Send token to server — server verifies the purchase through Google Play Developer API and idempotently credits currency
  3. Only after 200 OK response — call consumeAsync on the client
  4. Without step 3 — no consume, transaction remains open
scope.launch {
    val credited = serverApi.creditPurchase(purchase.purchaseToken)
    if (credited) {
        val consumeParams = ConsumeParams.newBuilder()
            .setPurchaseToken(purchase.purchaseToken)
            .build()
        val result = billingClient.consumePurchase(consumeParams)
        if (result.billingResult.responseCode != BillingClient.BillingResponseCode.OK) {
            // Log, but don't panic — consume next time on queryPurchasesAsync
        }
    }
}

Incomplete consume on restart

On every app startup — queryPurchasesAsync for INAPP products. If we find a purchase in PURCHASED state — this is an incomplete transaction (either consume didn't arrive or crash). Repeat verification and consume steps.

Server must store purchaseToken as an idempotency key. Repeated request with the same token does not credit currency twice — returns the previously created result.

Pending purchases for consumables

In regions where payment through kiosks or cash-on-delivery is available (India, Brazil, Southeast Asia), a purchase can be PENDING for hours. enablePendingPurchases() with enableOneTimeProducts() is mandatory from Billing Library 6. For pending state — do not consume, wait for transition to PURCHASED through PurchasesUpdatedListener or queryPurchasesAsync on next startup.

Estimated time — 2–3 days: integration with idempotent server logic, pending handling, testing through Google Play licensed testers.