App-to-Web with Stripe
App-to-Web with Stripe
In an app-to-web funnel, your app shows the paywall and your website takes the payment: the user sees an offer in the app, taps out to a web page, and pays through Stripe. This guide walks the whole loop in one place. Each step links to a deeper page if you need the full detail.
The short version
Three things make app-to-web work, and only the first involves writing API calls:
- Serve the paywall in the app. Your server asks Botsi which offer to show this user.
- Take the payment on the web. Stripe, in whatever form you use, with two pieces of metadata attached.
- Connect Stripe to Botsi. A one-time setup, after which every purchase, renewal, and refund flows back to Botsi automatically.
The customer_user_id you set in Stripe metadata ties steps 2 and 3 back to the profile from step 1.
Step 1: Serve the paywall in the app
Your server creates a Botsi profile for the user, fetches the paywall Botsi predicts for them, and reports a paywall_shown event when the user sees it. All three calls use your Botsi secret key and are covered step by step in the AI Pricing Web API guide. If your app uses the Botsi mobile SDK instead, the SDK covers this step.
Keep the response values paywallId, placementId, isExperiment, and aiPricingModelId: they come back in step 2.
Step 2: Take the payment on the web
Charge the user through Stripe however you like: Checkout, Payment Links, or your own form with the Stripe API. Botsi does not care which. What matters is the metadata you attach:
- Identity. Set
customer_user_idin the Stripe Customer's metadata to the samecustomerUserIdyou use with Botsi in the app. This is the single most important line in the whole flow: it is how the web payment is matched to the person who saw the paywall. - Attribution. Attach the paywall response values from step 1 (
paywallId,placementId,isExperiment,aiPricingModelId) as metadata on the subscription. For one-time products, attach them to the PaymentIntent instead.
Step 3: Connect Stripe to Botsi
The Stripe connection is a one-time setup: a restricted Stripe API key and a webhook, both saved in App Settings. Once connected, Stripe notifies Botsi of every purchase, renewal, and refund, and Botsi matches each one to the right profile and pricing prediction. You never call an API to report a purchase, and events that happen months later, like renewals and refunds, are captured automatically.
What does Botsi do with the purchase data?
Each purchase is matched to the profile that saw the paywall and credited to the pricing prediction it came from. That feeds your analytics, your experiment results (AI pricing vs. control), and the training data that improves the model's future predictions.
Botsi also tracks access levels from these events, so it can tell you whether a user is currently paid. If you manage entitlements in your own system, that is fine too: nothing else is required from you, and the data still powers pricing and analytics.
Checklist
- Profile created and paywall fetched in the app via the Web API (or SDK)
paywall_shownevent sent when the user sees the offercustomer_user_idset on the Stripe Customer, matching your BotsicustomerUserId- Paywall response values attached as subscription (or PaymentIntent) metadata
- Stripe connection active in App Settings, with your Stripe products added in Botsi