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

    Stripe Integration Guide

    See it in the demo — Stripe billing & web checkout (~60s)

    Stripe + BillDog

    BillDog integrates with Stripe to power web checkout, subscription management, and payment processing. This guide walks you through connecting your Stripe account and configuring webhooks.

    Prerequisites

    • A Stripe account (test or live mode)
    • Access to your Stripe Dashboard API keys
    • Your products set up in BillDog (Stripe prices can be created from them, or imported from Stripe)

    Step 1: Get Stripe API Keys

    Navigate to your Stripe Dashboard to find your API keys:

    1. Go to Stripe Dashboard → Developers → API keys
    2. Copy your Secret key (starts with sk_test_ or sk_live_)
    3. For test mode, use keys starting with sk_test_
    4. In BillDog, open Settings → Web Checkout. In the Stripe Integration card, choose the Direct API Keys tab and paste the key into Stripe Secret Key. You'll paste the webhook signing secret into the field below it in Step 2.

    Security Note

    Never expose your secret key in client-side code. BillDog stores your key securely and only uses it server-side.

    Step 2: Configure Webhook

    Webhooks allow BillDog to receive real-time payment events from Stripe:

    Webhook Configuration

    Webhook URL:

    https://api.billdog.io/v1/webhook-stripe?project_id=<PROJECT_ID>

    The ?project_id= part is required: it tells BillDog to check the event's signature against your signing secret. Without it, every event from your Stripe account is rejected with 401 Invalid signature. Copy the exact URL, with your project ID already filled in, from Settings → Web Checkout → Direct API Keys → Manual Webhook Configuration.

    Events to subscribe (all 17):

    checkout.session.completed
    checkout.session.async_payment_succeeded
    checkout.session.async_payment_failed
    checkout.session.expired
    customer.subscription.created
    customer.subscription.updated
    customer.subscription.deleted
    customer.subscription.trial_will_end
    invoice.paid
    invoice.payment_failed
    invoice.payment_action_required
    payment_intent.succeeded
    payment_intent.payment_failed
    charge.failed
    charge.refunded
    charge.dispute.created
    charge.dispute.closed

    Don't skip charge.refunded and the charge.dispute.* events: they are how BillDog revokes access after a refund or a lost dispute. The same list is shown in Settings → Web Checkout for copying.

    Created your endpoint before? Add checkout.session.async_payment_succeeded and checkout.session.async_payment_failed to it. A purchase paid by a delayed method (SEPA, ACH, Boleto, OXXO) completes only when its payment settles, and these are the events that say so.

    1. Go to Stripe Dashboard → Developers → Webhooks
    2. Click "Add endpoint"
    3. Paste the webhook URL from Settings → Web Checkout (including ?project_id=)
    4. Select the 17 events listed above
    5. Click "Add endpoint"
    6. Copy the endpoint's Signing secret (starts with whsec_)
    7. Back in BillDog, paste it into Stripe Webhook Secret (Settings → Web Checkout → Direct API Keys) and click Save Web Checkout Settings

    Step 3: Give each web product a Stripe price

    A BillDog product's Stripe Price ID is read-only on the product page. It is filled in one of two ways, both from Products:

    • BillDog creates the Stripe price. In the product form, set Price (USD) and turn on Enable Web Checkout. Then click Sync All at the top of the list, or the sync icon in the product's Stripe column. BillDog creates the Stripe product and price (recurring for subscription products, at the product's duration; one-time otherwise) and stores their IDs.
    • The products already exist in Stripe. Click Import from Stripe, pick the products, and click Import. BillDog creates or updates the matching products and stores each one's Stripe price ID.

    Step 4: Check the link

    Open the product. Its Store Configuration card shows the Stripe Price ID next to the App Store and Play Store IDs, so one BillDog product covers native in-app purchase and web checkout:

    Product: Premium Monthly
    ├── App Store Product ID: com.app.premium.monthly
    ├── Stripe Price ID: price_1ABC123xyz...   (set by Sync or Import)
    └── Product Type: subscription

    Test Mode vs Live Mode

    Test Mode

    • API keys start with sk_test_
    • Use test card numbers
    • No real charges processed
    • Separate from live data

    Live Mode

    • API keys start with sk_live_
    • Real payment processing
    • Actual customer charges
    • Production environment

    With Direct API Keys, the mode is decided by the key you paste: an sk_test_ key creates test checkouts and an sk_live_ key creates real charges. The Enable Test Mode switch in Settings → Web Checkout does not change which Stripe key is used; it controls whether BillDog treats checkouts as sandbox (and accepts only sandbox credentials for them). Keep it matched to your key: turn it on with an sk_test_ key while testing, and turn it off when you paste your sk_live_ key and live signing secret.

    Test Cards

    Use these test card numbers when in test mode:

    Card NumberBrandResult
    4242 4242 4242 4242VisaSuccess
    4000 0025 0000 3155VisaRequires 3DS
    4000 0000 0000 9995VisaDeclined
    5555 5555 5555 4444MastercardSuccess

    Webhook Security

    Signature Verification

    BillDog automatically verifies webhook signatures using your signing secret. This ensures that webhook events are genuinely from Stripe and haven't been tampered with.

    Troubleshooting

    Checkout session not created

    • • Verify your Stripe secret key is correct
    • • Check that the product has a Stripe Price ID, and that the price exists and is active in Stripe

    Webhook events not received

    • • Verify the webhook URL is exactly the one shown in Settings → Web Checkout, including ?project_id=
    • • Check that you've subscribed to the required events
    • • Test the webhook using Stripe's "Send test webhook" feature

    Signature verification failed

    • • Ensure webhook signing secret starts with whsec_
    • • Verify the secret matches your webhook endpoint
    • • Make sure the endpoint URL ends in ?project_id=<your project ID>; without it, BillDog can't find your secret and every event fails with 401
    • • Don't mix test and live mode secrets

    Next Steps

    Was this page helpful?

    Or rate this page:

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