DocsStripe

Stripe Setup

Stripe is the recommended payment provider for BotSubscription. It allows your subscription bot to accept credit cards, Apple Pay, Google Pay, and various regional payment methods in over 195 countries.

Why Stripe?

  • Global coverage - Accept payments from almost anywhere in the world
  • Seamless Checkout - Supports Apple Pay, Google Pay, and Link for one-click payments
  • Automatic Subscription Management - Handles recurring billing and failed payment retries
  • Fraud Protection - Built-in fraud detection to protect your business
  • Trusted Reliability - The industry standard for online payments

Prerequisites

Before connecting Stripe to your subscription bot, you'll need:

  1. A Stripe account (Sign up here)
  2. A Restricted Key (Recommended) or Secret Key

While BotSubscription works with your account's master Secret Key, we strongly recommend creating a Restricted Key to limit the bot's access to only what it needs.

  1. Log in to your Stripe Dashboard.
  2. Go to Developers > API keys.
  3. Click Create restricted key.
  4. Name it BotSubscription.
  5. Under Permissions, set the following access levels. Most of these are part of the critical infrastructure required for the bot to operate:
CategoryPermissionAccess LevelStatusReason
CoreChargesReadRequiredTo confirm successful payments
CustomersWriteRequiredTo create and manage subscriber profiles
DisputesReadOptionalTo detect and handle chargebacks
Payment IntentsWriteRequiredTo process payments and recurring charges
Payment MethodsWriteRequiredTo save cards for future renewals
ProductsWriteRequiredTo sync your subscription plans
PricesWriteRequiredTo manage pricing tiers
RefundsWriteOptionalTo issue refunds from the bot
Setup IntentsWriteRequiredTo setup payment methods without immediate charge
BillingInvoicesWriteRequiredTo generate billing records
SubscriptionsWriteRequiredTo manage recurring subscriptions
CheckoutCheckout SessionsWriteRequiredTo create payment pages
WebhooksWebhook EndpointsWriteRequiredTo automatically configure payment notifications
  1. Scroll down and click Create key.
  2. Copy the key (it starts with rk_...). You won't be able to see it again.
⚠️Warning

Missing required permissions will break your bot. Ensure every permission marked as Required is set correctly.

Connecting Stripe

Open the bot settings using the /settings command and navigate to Merchant Accounts.

Step 1: Install Merchant Account

Click Install Merchant Account to add a new payment provider.

BotSubscription merchant accounts settings showing Install Merchant Account button
Access Merchant Accounts from the bot settings menu to add Stripe

Step 2: Select Stripe

Choose Stripe from the list of available payment providers.

Payment provider selection screen showing Stripe option
Select Stripe to enable credit card payments

Step 3: Review Requirements

The bot displays the credential needed:

  • Secret Key (or Restricted Key rk_...)

The current environment (Sandbox/Test or Production/Live) is shown. Click Configure to proceed.

Stripe configuration preview displaying required Secret Key field
Review the required Stripe credentials before setup

Step 4: Enter Your Credentials

A secure form appears where you enter your Stripe key:

  1. Paste your Restricted Key (or Secret Key)
Secure form for entering Stripe Secret Key
Enter your Stripe API key securely

Click Submit to complete the setup.

Step 5: Confirmation

Once validated, the bot will automatically configure the necessary webhooks and confirm the connection.

Success confirmation showing Stripe connected to BotSubscription
Stripe successfully connected

Environment Modes

Test Mode (Sandbox)

Use Test Mode to verify your setup without charging real money.

  • Status: Enabled when the bot is in Test Mode.
  • Cards: Use Stripe Test Cards (e.g., 4242 4242 4242 4242).
💡Tip

We recommend running a full test cycle (subscribe -> payment -> role assignment) in Test Mode before going live.

Live Mode (Production)

Switch to Live Mode to accept real payments.

  • Status: Enabled when the bot is in Live Mode.
  • Requirement: You must have a verified business on Stripe.

Troubleshooting

"Invalid API Key" Error

  • Ensure you copied the key correctly without extra spaces.
  • If using a Restricted Key, double-check that all required permissions are set to Write (or Read where specified). Missing permissions are the most common cause of errors.

"Webhook Creation Failed"

  • This usually means your API key lacks the Webhook Endpoints > Write permission.
  • Update the key permissions in Stripe Dashboard or create a new one with the correct access.

Payments Not Confirming

  • Check if your Stripe account has any verification holds.
  • Ensure the webhook was created successfully (check Developers > Webhooks in Stripe).

Last updated: