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

    Connect Google Play to BillDog

    To connect Google Play to BillDog, create a Google Cloud service account with a JSON key, invite it in Play Console with financial-data permissions, and upload the key under Project Settings → Settings → Store Setup. Then point a Pub/Sub push subscription for real-time developer notifications at your project's own endpoint, and create one BillDog product per base plan, with a Play id like premium:monthly.

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

    What you'll build

    • A verified Google Play connection, so BillDog can check every Play purchase with Google
    • Real-time developer notifications for renewals, cancellations and refunds
    • BillDog products that match your Play subscriptions and base plans, attached to an entitlement

    What you'll need

    • A Google Play Console developer account with your app created, and admin access to it
    • A Google Cloud project you can create service accounts and Pub/Sub topics in
    • A BillDog project you own (only the project owner can save store credentials)
    • The BillDog Android SDK in your app. If not, start with Show your first paywall in an Android app

    1. Create your subscription in Play Console

    10 min

    In Play Console, open your app and go to Monetize with Play → Products → Subscriptions. Create a subscription (for example premium), add one or more base plans (for example monthly and yearly), and activate them. Offers such as free trials belong to a base plan. Google's guide covers every field: Create and manage subscriptions.

    Play Console only lets you create products after you upload a build that includes the Play Billing Library. The BillDog billdog-paywall artifact brings it in, so upload one build to the Internal testing track first.

    Write down the subscription id and each base plan id. Base plan and offer ids use lowercase letters, digits and hyphens. You will type them into BillDog in step 5.

    2. Create a service account and JSON key

    8 min

    BillDog reads purchases from the Google Play Developer API as a service account that you own.

    1. In Google Cloud Console, pick or create a project and open APIs & Services → Library. Search for Google Play Developer API and enable it.
    2. Open IAM & Admin → Service Accounts and click Create Service Account. A name like billdog-play-api is fine.
    3. Open the new account, go to the Keys tab and choose Add Key → Create new key → JSON. Keep the downloaded file safe; it is a credential.
    4. In Play Console, open Users and permissions and click Invite new users. Enter the service account email (the client_email value in the JSON file).
    5. Grant View app information and download bulk reports, View financial data, orders, and cancellation survey responses and Manage orders and subscriptions, then click Invite user.

    View financial data is not optional. BillDog proves the app is yours by reading its voided purchases, and reads each purchase's order for the price. Without that permission, Google answers 403 and verification fails.

    3. Upload the JSON key in BillDog

    4 min
    1. In the BillDog dashboard, open Project Settings → Settings and select the Store Setup tab (or go straight to /dashboard/settings?tab=store).
    2. In the Google Play card, enter your Package Name, for example com.example.app.
    3. Under Service Account JSON, click Choose .json file and pick the key from step 2, or paste the file's contents.
    4. Leave Pub/Sub Topic (optional) empty for now, or enter the full topic name if you already have one.
    5. Click Save & Verify.

    When Google confirms the app belongs to this service account, you see a Google Play connected message and the card shows RTDN push endpoint and audience: a URL unique to your project. You need it in the next step.

    A Play app can be proven by one BillDog project at a time. If another project already holds it, release it there first.

    Play permissions for a newly invited service account can take a while to apply, sometimes up to about a day. If verification fails with Play refused com.example.app (403), check the three permissions from step 2, wait, and click Save & Re-verify.

    4. Set up real-time developer notifications

    12 min

    Google Play publishes subscription changes (renewals, cancellations, refunds) to a Pub/Sub topic. A push subscription forwards them to BillDog.

    1. In Google Cloud Console, open Pub/Sub → Topics, click Create Topic and use an id such as play-subscriptions. Copy the full name, for example projects/YOUR_PROJECT/topics/play-subscriptions.
    2. On the topic's Permissions, add the principal google-play-developer-notifications@system.gserviceaccount.com with the Pub/Sub Publisher role.
    3. On the topic, click Create Subscription. Set Delivery type to Push and paste the RTDN push endpoint and audience URL from BillDog as the endpoint.
    4. Tick Enable authentication and choose the service account from step 2. Leave Audience blank, so Pub/Sub uses the endpoint URL, which is what BillDog expects. You need the Service Account User role on that service account, or creating the subscription fails.
    5. In Play Console, go to Monetize with Play → Monetization setup, find Real-time developer notifications, select Enable real-time notifications, paste the full topic name into Topic name and click Save changes.
    6. Back in BillDog's Google Play card, enter the push subscription's service account email (the client_email from step 2) and click Set push service account.

    The endpoint ends in ?r= plus your project's route key. The bare https://api.billdog.io/v1/webhooks-google URL refuses every notification. BillDog also refuses every Play notification until the push service account is set, and refuses pushes signed by any other identity.

    To check it, click Send Test Message in Play Console's real-time developer notifications section. The Google Play card replaces "No notification received yet." with Last notification and a time.

    5. Add products with matching Play ids

    6 min

    BillDog needs a product for each thing your paywall sells. The quickest route: click Sync products on the Google Play card, then open Monetization → Synced Products and click Import on each row.

    A sync imports a subscription under its bare id. If your subscription has several base plans, create one BillDog product per base plan in Monetization → Products → New Product and set Play Store Product ID to subscriptionId:basePlanId:

    • premium:monthly and premium:yearly: two products. Each shows and buys exactly that base plan, with its own price, period, free trial and intro price.
    • premium:yearly:intro-50: also pins that offer. A user who is not eligible for it buys the base plan without a discount.
    • premium (bare): the SDK picks the first base plan Play lists and, among its offers, the longest free trial, else the cheapest intro price.

    The Product Identifier field is BillDog's own name for the product (for example premium-monthly) and is separate from the Play id. The same subscriptionId:basePlanId format is what RevenueCat uses, so ids carry over if you migrate.

    Base-plan ids need Android SDK 1.1.1-beta.4 or later. Older app builds can't find a subscriptionId:basePlanId product in Play, so keep a bare id while those builds are still in use.

    6. Attach products to an entitlement and an offering

    4 min
    1. Open Monetization → Entitlements, click New Entitlement, set the Identifier to premium, and tick your Play products under Product Mapping. A purchase only unlocks something when its product is attached to an entitlement.
    2. Open Monetization → Offerings, click New Offering, tick Mark as current offering, and click Create Offering. BillDog opens the offering's editor: click Add Product, tick a product, type a Package Identifier, click Add Package, and repeat for each product, then Save Changes.
    3. Link the offering to a placement under Monetization → Placements, as in the Android paywall codelab.

    7. Verify with a purchase

    5 min

    Your paywall buys these products for you. To check one product directly, call purchase from an Activity with the same id you put in Play Store Product ID:

    MainActivity.kt
    import android.util.Log
    import androidx.activity.ComponentActivity
    import androidx.lifecycle.lifecycleScope
    import io.billdog.core.BillDog
    import io.billdog.core.PurchaseResult
    import kotlinx.coroutines.launch
    
    class MainActivity : ComponentActivity() {
        fun buyMonthly() {
            lifecycleScope.launch {
                when (val result = BillDog.purchase(this@MainActivity, "premium:monthly")) {
                    is PurchaseResult.Purchased -> Log.d("BillDog", "Bought ${result.productId}")
                    is PurchaseResult.Pending -> Log.d("BillDog", "Waiting for payment")
                    is PurchaseResult.Cancelled -> Log.d("BillDog", "User cancelled")
                    is PurchaseResult.Failed -> Log.e("BillDog", "Purchase failed: ${result.error.message}")
                    is PurchaseResult.Restored -> Log.d("BillDog", "Already owned, restored")
                }
            }
        }
    }

    Use a license tester account so you aren't charged. The full walkthrough is in Test real Google Play purchases. Purchases made before the connection was verified wait and are recorded once it is.

    Frequently asked questions

    View app information and download bulk reports, View financial data, orders, and cancellation survey responses, and Manage orders and subscriptions. View financial data is required: BillDog verifies the app by reading its voided purchases and reads each order for its price, and Google refuses both without it.

    Your project's own URL, shown as RTDN push endpoint and audience on the Google Play card under Project Settings, Settings, Store Setup, after Save & Verify succeeds. It ends in ?r= and a route key. The bare webhooks-google URL without a route refuses every notification.

    Create two BillDog products and set their Play Store Product ID to subscriptionId:basePlanId, for example premium:monthly and premium:yearly. Add a third segment to pin an offer, such as premium:yearly:intro-50.

    The usual causes are a push subscription without Enable authentication, an Audience that doesn't match the endpoint URL, the bare endpoint without ?r=, or no push service account set on the Google Play card. BillDog refuses every Play notification until that service account is set.

    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.