Launch offer for the first 500 accounts: $10K MTR free for 24 months + $100 credit →
    .io
    Monetization
    Any platform
    Intermediate
    39 min

    Recover failed subscription payments

    To recover failed renewals with BillDog, turn on the billing grace period in App Store Connect and Google Play so users keep access while the store retries the card. During grace, getCustomerInfo() returns isInGracePeriod: true, so your app can show a banner that opens showManageSubscriptions(). As soon as the renewal payment fails, BillDog sends the subscription.billing_issue webhook and the Billing Issue journey trigger, so you can reach the user while they still have access.

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

    What you'll build

    • Store grace periods turned on, so a failed card doesn't cut access straight away
    • An in-app banner that sends users in grace to the store's payment screen
    • A journey that messages users whose access was paused by a billing issue
    • A server that knows which subscriptions are in grace or billing retry

    What you'll need

    • An app that already shows a paywall and unlocks premium (iOS, Android)
    • App Store Server Notifications or Google Play RTDN connected to BillDog (App Store setup, Google Play setup)
    • For step 6: a project where you can create Test Store purchases

    1. Understand grace, billing retry and lapse

    4 min

    When a renewal payment fails, the store doesn't end the subscription at once. It retries the card for weeks, and many of those retries succeed. BillDog follows the store's state for each purchase and changes access, customer info and webhooks to match:

    • Grace period (store state in_grace): the payment failed, but the user keeps access until the grace period ends. The entitlement stays active with state grace_period, and customer info has isInGracePeriod: true. Webhook: subscription.billing_issue with "state": "in_grace". Journey trigger: Billing Issue.
    • Billing retry (in_billing_retry on the App Store, on_hold on Google Play, called account hold): the store is still retrying, but access has stopped. The entitlement is no longer returned. Webhook: subscription.billing_issue if the subscription had no grace period, otherwise subscription.updated with the new state.
    • Recovered: a retry succeeds. The store books a new period, access comes back, and BillDog sends subscription.renewed.
    • Lapsed: the retry window ends without payment. BillDog sends subscription.expired.

    For App Store and Google Play purchases, subscription.billing_issue fires once per failed renewal, when the payment first fails: on entering grace, or on entering billing retry or account hold when there is no grace period. Moving on from grace to billing retry, or from billing retry to account hold, is sent as subscription.updated with the new state. If the renewal later succeeds and a later one fails, that is a new billing issue.

    Stripe web subscriptions work differently: the first failed invoice sends subscription.billing_issue right away and starts a 7-day grace period. Its payload has a different shape (status: "past_due", grace_period_expires_at). It is sent once per failed renewal too: Stripe's retries of the same invoice don't send it again or extend the grace period, and a new one comes only after a renewal succeeds.

    2. Turn on grace periods in the stores

    5 min

    Grace periods are a store setting, not a BillDog one. BillDog reads the grace end date from each store notification, so there's nothing to configure in the dashboard.

    • App Store Connect: open your app, go to Subscriptions and turn on Billing Grace Period. Choose a length (3, 16 or 28 days; weekly plans allow less) and whether it applies to all renewals or only paid-to-paid ones. Without it, a failed payment goes straight to billing retry and access stops at once.
    • Google Play Console: open Monetize → Products → Subscriptions, open the subscription, then edit each base plan. Set the Grace period and Account hold lengths. Play applies a grace period by default; check the values match what you want.

    Apple and Google change these options from time to time. Check the current lengths in the App Store Connect help and the Play subscription docs.

    3. Prompt users in grace to fix their payment

    10 min

    A user in grace still has access, so nothing in your app changes unless you tell them. Read isInGracePeriod from customer info and show a banner whose button opens the store's subscription screen, where they can update the card.

    On iOS, showManageSubscriptions() is an async method that opens Apple's subscription management sheet:

    Swift
    import SwiftUI
    import BillDogFull
    
    struct BillingIssueBanner: View {
        @State private var inGrace = false
    
        var body: some View {
            Group {
                if inGrace {
                    VStack(alignment: .leading, spacing: 8) {
                        Text("We couldn't renew your subscription").font(.headline)
                        Text("Update your payment method to keep Premium.")
                        Button("Update payment") {
                            Task { await BillDog.shared.showManageSubscriptions() }
                        }
                    }
                    .padding()
                }
            }
            .task {
                if let info = try? await BillDog.shared.getCustomerInfo() {
                    inGrace = info.isInGracePeriod
                }
            }
        }
    }

    On iOS 16 and later, BillDog also shows Apple's own App Store messages automatically, including Apple's billing issue sheet when Apple has one for the user. To decide yourself, pass a handler to BillDog.shared.setAppStoreMessageHandler and return true for messages you handled.

    On Android, BillDog.showInAppMessages(activity) asks Google Play to show its own transactional message (such as a declined payment) if it has one. BillDog.showManageSubscriptions(activity, subscriptionId) opens the Play subscription screen; pass your Play product ID to open that subscription directly.

    Kotlin
    import androidx.activity.ComponentActivity
    import androidx.lifecycle.lifecycleScope
    import io.billdog.core.BillDog
    import kotlinx.coroutines.launch
    
    class MainActivity : ComponentActivity() {
        override fun onResume() {
            super.onResume()
            // Google Play's own "fix your payment" message, if Play has one for this user.
            BillDog.showInAppMessages(this)
    
            lifecycleScope.launch {
                BillDog.getCustomerInfo()
                    .onSuccess { info -> showBillingBanner(info.isInGracePeriod) }
            }
        }
    
        // Call this from your banner's "Update payment" button.
        private fun onUpdatePaymentTapped() {
            BillDog.showManageSubscriptions(this, subscriptionId = "premium_monthly") // your Play product ID
        }
    
        private fun showBillingBanner(visible: Boolean) {
            // Show or hide your own banner here.
        }
    }

    Customer info is cached for a few minutes. When the user comes back from the store screen, call getCustomerInfo(forceRefresh: true) (iOS) or getCustomerInfo(forceRefresh = true) (Android) so the banner disappears once the store has charged the card.

    4. Message users whose payment failed

    6 min

    The in-app banner only reaches users who open the app. A journey can send them a push or email as soon as the payment fails, while they still have access.

    1. Open Engagement → Journeys and click Create Journey.
    2. Under Create a New Journey, enter a Journey Name and choose Billing Issue (under Purchases) as the Entry Trigger. You can pick the premium entitlement to limit it to subscriptions that unlock it. Click Create Journey to open the canvas.
    3. On the canvas, drag Send Notification from the Step Palette and connect it after the Billing Issue trigger step (drag that from Triggers first if the canvas is empty). Write a short message that says the payment failed and how to update the payment method.
    4. Click Publish.

    Push needs your APNs and FCM keys and a device token for the user. If those aren't set up yet, follow Send push and in-app messages first.

    5. Track billing issues on your server

    6 min

    If your backend grants access or sends its own email, subscribe a webhook endpoint to subscription.updated, subscription.billing_issue, subscription.renewed and subscription.expired. Setup and signature checks are covered in Receive BillDog webhooks on your server. A billing issue on an App Store purchase looks like this:

    JSON
    {
      "event_type": "subscription.billing_issue",
      "event_id": "4f0b2c9e-...",
      "store_purchase_id": "9a1d...",
      "state_version": 4,
      "state": "in_grace",
      "will_auto_renew": true,
      "expires_at": "2026-12-15T10:00:00+00:00",
      "customer_id": "c2f7...",
      "app_user_id": "user_123",
      "platform": "ios",
      "store": "app_store",
      "product_kind": "auto_renewable",
      "store_product_id": "com.example.premium.monthly",
      "product_id": "premium_monthly",
      "is_sandbox": false
    }
    • state is the store state after the change: in_grace, in_billing_retry (App Store) or on_hold (Google Play). A billing issue is sent once per failed renewal, so read state to know whether the user still has access.
    • state_version goes up with every change to the purchase. Events can arrive out of order, so ignore one whose state_version is lower than the last you stored for that store_purchase_id.
    • app_user_id is your own user ID. customer_id is BillDog's internal ID.

    To see the trend, open Analytics → Billing Issues. It shows how many subscriptions entered a billing issue, how many recovered, the recovery rate, and how many are in grace or billing retry now.

    6. Test the whole flow

    8 min

    The Test Store can play out a failed renewal at real store timings, so you can check your journey, webhooks and backend without waiting for a real card to fail.

    1. Go to /dashboard/test-store. In Create Mock Purchase, enter a Test User ID, pick a monthly product that grants premium, set Test Scenario to Renewal payment fails (grace, retry, lapse), and click Create Test Purchase.
    2. Open the Time Travel tab, enter the same Test User ID, set Days Forward to 32 and click Advance Time. The result lists Payment failed: grace period. Your webhook endpoint receives subscription.billing_issue with state in_grace, and a published Billing Issue journey enrolls the user.
    3. Advance another 17 days. The result lists Billing retry: access paused, and your endpoint receives subscription.updated with state in_billing_retry.
    4. Advance 90 days. The result lists Lapsed after billing retry and subscription.expired is sent.

    Test Store users follow the App Store timings: a 16-day grace period inside a 60-day retry window. Check the grace state from your server with a sandbox secret key:

    Terminal
    curl -X POST https://api.billdog.io/v1/get-customer-info \
      -H "X-BillDog-API-Key: bd_secret_test_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{"app_user_id": "test_user_123"}'

    During grace, data.isInGracePeriod is true and the premium entitlement has "state": "grace_period". In billing retry, premium is missing from data.entitlements.

    Your app can't read a Test Store user with a public key, so test the in-app banner with a store sandbox account instead. Apple's sandbox and Google's licence testers can both simulate a failed renewal; see iOS sandbox testing and Android sandbox testing.

    Frequently asked questions

    Yes. While the store reports the subscription in grace, BillDog keeps the entitlement active until the grace period ends, and customer info returns isInGracePeriod true. Access stops when the store moves the subscription to billing retry (App Store) or account hold (Google Play).

    For App Store and Google Play purchases, once per failed renewal, as soon as the payment fails: when the subscription enters grace, or billing retry or account hold if there is no grace period. Later steps of the same failure are sent as subscription.updated. Stripe web subscriptions follow the same rule: one subscription.billing_issue at the first failed invoice payment, none for Stripe's retries, and a new one only after a renewal succeeds.

    Call BillDog.shared.showManageSubscriptions() on iOS or BillDog.showManageSubscriptions(activity) on Android. Both open the store's own subscription screen, where the user can change the card. On Android, BillDog.showInAppMessages(activity) can also show Google Play's own payment message.

    The store books a new period. BillDog restores the entitlement and sends subscription.renewed, and isInGracePeriod goes back to false.

    Yes. In the BillDog Test Store, create a purchase with the Renewal payment fails scenario and use Time Travel to move through grace, billing retry and lapse. Each step updates the customer and sends the matching webhook.

    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.