Skip to main content
Botflow uses RevenueCat for subscriptions and in-app purchases in Swift apps. This guide walks through the complete Test Store path first: it works in the simulator, needs no App Store Connect setup, and never charges real money.
RevenueCat payments are available for Pro and Max Swift projects with a managed backend. The Payments tab appears after you ask the agent to add in-app purchases.

Before you start

You will need a RevenueCat account and a RevenueCat project. You do not need an App Store Connect app to test purchases in the simulator. Ask the Botflow agent to open setup:
Then open the Payments tab in the workspace. It contains the same checklist and links referenced below, so you can leave and resume setup at any time.

Connect RevenueCat to Botflow

1

Create or open a RevenueCat project

In the RevenueCat dashboard, create a project or open the project you want this app to use. Every new project includes a Test Store for development purchases.
2

Copy the API v2 Project ID

Open Project settings → General and copy the Project ID. It begins with proj (for example, proj1a2b3c4d).
Do not use the short ID in the RevenueCat dashboard URL. Botflow calls RevenueCat’s API v2, which requires the separate proj… Project ID shown in Project settings.
3

Create a V2 secret API key

Open Project settings → API keys, click New secret API key, and choose V2 for API version. Give it a descriptive label such as Botflow and generate the key.Copy the sk_… value immediately and keep it private. RevenueCat V1 secret keys cannot access the API v2 endpoints Botflow uses.
4

Copy the Test Store SDK key

On the same API keys page, find Test Store under SDK API keys. Reveal and copy the public key beginning with test_.
5

Paste the three values into Botflow

Return to Payments in Botflow and paste:
  • the V2 secret key (sk_…)
  • the Test Store SDK key (test_…)
  • the API v2 Project ID (proj…)
Select Connect RevenueCat. Botflow verifies the account before saving anything, encrypts the secret key, and writes the Test Store key only into development builds.

RevenueCat API v2 key guide

RevenueCat’s guide to creating V2 secret keys and choosing permissions.

RevenueCat Test Store guide

RevenueCat’s current Test Store and SDK configuration reference.

Configure a test subscription

Connecting the account enables Botflow to wire the SDK into your Swift app. RevenueCat still needs something to sell. In RevenueCat, configure these three pieces:
  1. In Product catalog, choose New product and select Test Store. Create a monthly product, for example premium_monthly.
  2. In Entitlements, create an entitlement such as premium and attach the product to it.
  3. In Offerings, create or edit the Default offering and add the product as its monthly package.
Then tell the Botflow agent what the paywall should do:
Botflow uses RevenueCat’s SDK and your configured offering rather than hand-written StoreKit purchase logic.

Test in the simulator

Build and run the Swift app from Botflow’s simulator preview. The Test Store purchase dialog is simulated: no Apple sandbox account and no real payment method are required. After a successful test purchase, verify all three outcomes:
  • The app unlocks the feature protected by your premium entitlement.
  • Restore Purchases restores the entitlement after restarting or signing in again.
  • The Payments tab records the test event and shows that it reached the backend receiver.
If no package appears, check that the product is attached to an entitlement and is part of the Default offering. A Test Store key can connect successfully even when no products or offerings exist yet.

Set the webhook

Once the connection is verified, Botflow displays a webhook URL and authorization value in the Payments tab. In RevenueCat, open Integrations → Webhooks, add a webhook, and paste both values. This lets Botflow deliver entitlement changes to your app’s managed backend. Keep the authorization value private.

Go live on the App Store

Test Store keys are for development only. Before shipping:
  1. Add your App Store app in RevenueCat and configure its App Store Connect credentials.
  2. Create the production products in App Store Connect and import or attach them in RevenueCat.
  3. Copy the app-specific SDK key beginning with appl_ into Botflow’s Payments tab.
  4. Validate a purchase with Apple’s sandbox before submitting the app for review.
Botflow keeps test_ keys out of release builds. A release build needs an appl_ key, so a Test Store key cannot accidentally reach the App Store.

Troubleshooting