Launch offer for the first 500 accounts: $10K MTR free for 24 months + $100 credit →
    .io
    Testing
    Android
    Intermediate
    31 min

    Test real Google Play purchases

    To test real Google Play purchases without being charged, add your Google account as a license tester in Play Console, upload a build to the internal testing track, install it from the tester link, and buy with Test card, always approves. Google marks the order as a test purchase, so BillDog records it in Sandbox. Use your bd_public_test_ key and check the customer with the dashboard's Sandbox switch on.

    Steps last checked against the SDK source on 15 Nov 2026.

    What you'll build

    • A license tester account that buys your subscription with no real charge
    • A sandbox purchase in BillDog that unlocks the premium entitlement
    • Renewals every few minutes, so you can watch a full subscription lifecycle

    What you'll need

    • Google Play connected to BillDog, with products attached to an entitlement. See Connect Google Play to BillDog
    • An app with the BillDog Android SDK (billdog-compose and billdog-paywall), as in the Android paywall codelab
    • A real Android device signed in to the Google account you will test with, with the Play Store app installed

    1. Add license testers

    3 min

    In Play Console, go to the All apps page and open Settings → License testing in the left menu (it applies to your whole developer account, not one app) and add the Google account emails you will test with. Google's guide: Test in-app billing with application licensing.

    License testers get test payment methods, so they are never charged, and their subscriptions renew in minutes instead of months.

    Internal testers who are not also license testers pay real money. Add every test account to License testing, not only to the testing track.

    2. Build with your test key

    3 min

    Configure the SDK with the bd_public_test_ key from Integration & Data → API Keys, and leave simulatedPurchases at its default (false) so purchases go to real Google Play Billing.

    MyApplication.kt
    import android.app.Application
    import io.billdog.core.BillDog
    
    class MyApplication : Application() {
        override fun onCreate() {
            super.onCreate()
            BillDog.configure(this, "bd_public_test_YOUR_KEY")
        }
    }

    Which environment a Play purchase is recorded in is decided by Google, not by your key. BillDog asks Google about every purchase token, and a license tester's purchase comes back marked as a test purchase, so it is recorded as sandbox. The key decides which side your customer lives on: with the test key, the customer and the purchase are both in Sandbox, where the dashboard shows them together.

    3. Upload a build to internal testing

    10 min
    1. Build a signed release bundle (./gradlew bundleRelease) with the same package name as your Play app and a higher versionCode than any earlier upload.
    2. In Play Console, open Testing → Internal testing, create a release, upload the .aab and roll it out.
    3. On the Testers tab, add your license tester accounts (an email list works) and copy the opt-in link.

    Your subscription and its base plans must also be Active in Play Console. A product in draft is never returned to the app.

    Google lets license testers sideload debug builds too, as long as the package name matches your Play app. Installing from the testing track is the most reliable route, because it rules out a signing or package mismatch. A new release can take a while to reach testers.

    4. Install from the Play Store link

    3 min
    1. On the test device, open the opt-in link while signed in as a license tester and accept the invitation.
    2. Follow the link to the Play Store listing and install the app from there.
    3. If the device has several Google accounts, Play bills the account that downloaded the app. Make sure that is the license tester.

    5. Buy with a test card

    4 min

    Open your paywall (or call BillDog.purchase(activity, "premium:monthly") with your own Play id). The purchase sheet shows a test notice, and the payment methods include test cards:

    • Test card, always approves: a successful purchase.
    • Test card, always declines: a failed payment, useful for grace period and account hold.
    • Slow test card, approves after a few minutes: a pending purchase. The SDK returns PurchaseResult.Pending, and BillDog unlocks only once Google reports it paid.

    Then refresh customer info and confirm the entitlement is active:

    MainActivity.kt
    import android.util.Log
    import androidx.activity.ComponentActivity
    import androidx.lifecycle.lifecycleScope
    import io.billdog.core.BillDog
    import kotlinx.coroutines.launch
    
    class MainActivity : ComponentActivity() {
        fun checkAccess() {
            lifecycleScope.launch {
                BillDog.getCustomerInfo(forceRefresh = true)
                    .onSuccess { info ->
                        Log.d("BillDog", "User ${BillDog.getAppUserId()} premium=${info.hasEntitlement("premium")}")
                    }
                    .onFailure { Log.e("BillDog", "Could not read entitlements", it) }
            }
        }
    }

    6. Check the purchase in the dashboard

    3 min
    1. Turn on the Sandbox switch in the dashboard header. With it off you see Production, and test purchases stay hidden.
    2. Open Audience → Customers and find the user ID the log printed. Open the customer to see the purchase and the active entitlement.
    3. Leave the subscription running. Test subscriptions renew about every 5 minutes for a monthly or weekly plan and every 30 minutes for a yearly plan, up to six renewals, then expire. Each renewal reaches BillDog through real-time developer notifications.

    To test a failed renewal, change the payment method in the Play Store app under the subscription's settings to Test card, always declines before the next renewal. Google's full timing table, including free trial and grace period lengths, is in Test your Google Play Billing Library integration.

    7. Fix common errors

    5 min
    • Product not found or item unavailable: Play sells no product with that id to this app. Check that the Play Store Product ID in BillDog matches Play Console, that the product is active, that the package name matches, and that the device account is a license tester.
    • Billing not available on this device: the device has no signed-in Play Store account, or it is an emulator image without Google Play.
    • Purchase succeeded but nothing unlocked: the product isn't attached to an entitlement. Tick it under Product Mapping on the entitlement. A Play id BillDog has never seen is added as a new product with no entitlement.
    • Purchase rejected with a test key: a bd_public_test_ key refuses a purchase Google did not mark as a test purchase. The account that paid is not a license tester.
    • Nothing in the dashboard: the header switch is on Production. Test purchases are in Sandbox.

    Want to test paywall logic before any of this is ready? The Test Store codelab creates sandbox purchases with no Play account at all.

    Frequently asked questions

    You need at least one upload before Play Console lets you create products. After that, license testers can sideload builds with the same package name, but installing from the internal testing track is the most reliable way to test.

    BillDog checks every purchase token with Google. A license tester's purchase comes back marked as a test purchase, so it is recorded as sandbox, whichever key the app uses. A bd_public_test_ key refuses a purchase that Google did not mark as a test.

    About every 5 minutes for weekly and monthly plans, 10 minutes for 3 months, 15 minutes for 6 months and 30 minutes for yearly plans. They renew at most six times, then expire.

    No. License testers pay with test cards such as Test card, always approves. Testers on a testing track who are not license testers are charged real money.

    Reference

    Ship it on a free project

    Create a project, grab your SDK key and follow along. Sandbox purchases and data stay separate from production, so test transactions never mix with real revenue.

    We use cookies and process your data to provide our services. By continuing, you agree to our Terms and Privacy Policy.