> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Automate White Label Billing with Stripe in ChatbotX

> Guide to connect Stripe with ChatbotX White Label to create SaaS packages, automate recurring billing, and manage client subscriptions.

Billing automation allows you to use Stripe to automatically charge clients for using your portal. This guide is for ChatbotX White Label SaaS plan partners who want to connect their own Stripe account to automate payments and renewals. You can configure flat-rate plans or flexible billing based on the resource usage of each client workspace.

## How to Retrieve the Secret Key and Connect Stripe

To enable automated billing, you need to connect your Stripe account to your portal using a secret API key.

<Steps>
  <Step title="Retrieve Secret Key from Stripe">
    To obtain your API key, perform the following steps:

    * Log in to your Stripe dashboard.
    * Click the **Developers** menu in the top-right corner, then select the **API keys** tab.
    * Under the **Standard keys** section, locate the key named **Secret key**.
    * Click the button to reveal the key and copy the entire string (the string starts with the prefix `sk_live_` for live environments or `sk_test_` for test environments).

    <Frame>
      <img src="https://mintcdn.com/chatbotx/XkhCsofw6s97ZmA0/images/chatbotx_whitelabel_get_secret_key.png?fit=max&auto=format&n=XkhCsofw6s97ZmA0&q=85&s=e6846f6ddab031a28ed33b3b2bd183ed" alt="Chatbotx Whitelabel Get Secret Key" width="2891" height="1613" data-path="images/chatbotx_whitelabel_get_secret_key.png" />
    </Frame>
  </Step>

  <Step title="Open payment processor configuration">
    Log in to your Portal admin dashboard, locate the **SaaS** section on the left navigation menu, and select **Payment Processor**.
  </Step>

  <Step title="Paste key and activate connection">
    * Paste the copied secret key into the **Secret key** field on the **Payment Processor** page.
    * Click **Save configuration** to complete the connection.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/XkhCsofw6s97ZmA0/images/chatbotx_whitelabel_payment_processor_stripe.png?fit=max&auto=format&n=XkhCsofw6s97ZmA0&q=85&s=cf8acd3929fae67fa5c942a6705aef5e" alt="Chatbotx Whitelabel Payment Processor Stripe" width="1842" height="1196" data-path="images/chatbotx_whitelabel_payment_processor_stripe.png" />
    </Frame>

    Once you save the configuration, the system automatically registers a webhook endpoint on your Stripe account. The interface will display a green checkmark next to the **Secret key** field and a **registered** label on the **Webhook** line to confirm the connection is active.
  </Step>
</Steps>

<Warning>
  Your Stripe Secret Key is highly sensitive and is stored fully encrypted. Never share this key in public documents, frontend source code, or video tutorials to prevent unauthorized account access.
</Warning>

## Create Products and Recurring Pricing in Stripe

To sell subscription plans, you must create products and configure pricing on your Stripe account:

<Steps>
  <Step title="Open Product catalog">
    In the Stripe dashboard, open the **Product catalog** menu on the left sidebar and click the **+ Create product** button in the top-right corner.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/N5ARDMp-TfhcLtOO/images/stripe_product_catalog.png?fit=max&auto=format&n=N5ARDMp-TfhcLtOO&q=85&s=e02c776addf18bee1ed69ecd5257525c" alt="Stripe Product Catalog" width="2912" height="1025" data-path="images/stripe_product_catalog.png" />
    </Frame>
  </Step>

  <Step title="Enter basic product and pricing info">
    In the **Add a product** form, fill in the following details:

    * **Name (required)**: The subscription plan name.
    * **Description**: A short description of the plan.
    * **Pricing**: Select **Recurring** to configure subscription pricing. Enter the cost in the **Amount** field and select your currency.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/N5ARDMp-TfhcLtOO/images/stripe_add_product_form.png?fit=max&auto=format&n=N5ARDMp-TfhcLtOO&q=85&s=e43ebb4ad9155a6d36f9851149efc42b" alt="Stripe Add Product Form" width="1909" height="1683" data-path="images/stripe_add_product_form.png" />
    </Frame>
  </Step>

  <Step title="Configure billing period">
    In the **Billing period** field, select your desired billing cycle (such as Monthly to charge users every month or Yearly to charge annually).

    <Frame>
      <img src="https://mintcdn.com/chatbotx/N5ARDMp-TfhcLtOO/images/stripe_billing_period_options.png?fit=max&auto=format&n=N5ARDMp-TfhcLtOO&q=85&s=e30a5c799cafefc04111d8949ecd17a9" alt="Stripe Billing Period Options" width="998" height="714" data-path="images/stripe_billing_period_options.png" />
    </Frame>
  </Step>

  <Step title="Select pricing model">
    Under the advanced pricing options, locate the **Choose your pricing model** section:

    * **Flat rate**: Apply a fixed price for the entire plan.
    * **Tiered pricing**: Price based on resource quantity thresholds.
    * **Usage-based**: Bill based on the actual resource consumption of the client.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/N5ARDMp-TfhcLtOO/images/stripe_choose_pricing_model.png?fit=max&auto=format&n=N5ARDMp-TfhcLtOO&q=85&s=9abc39bcf2f76e4cfe6f0b8939601357" alt="Stripe Choose Pricing Model" width="1908" height="1688" data-path="images/stripe_choose_pricing_model.png" />
    </Frame>
  </Step>

  <Step title="Configure advanced pricing details">
    * If you selected **Tiered pricing**, choose the tiering method:
      * **Volume**: The price of all units is calculated based on the final tier reached (corresponding to the Volume pricing model supported by the portal).
      * **Graduated**: The price is calculated progressively across each quantity threshold.
    * If you selected **Usage-based**, choose the measurement unit:
      * **Per unit**: Bill per user or unit used.
      * **Per package**: Bill per package unit.
      * **Per tier**: Bill based on quantity thresholds.
  </Step>

  <Step title="Configure usage meter">
    For the **Usage-based** model, declare your usage meter:

    * **Meter**: Select a meter under **Choose a meter** or click **+ Create meter** to track client usage data.
    * **Billing period**: Select the billing cycle (typically Monthly).
    * **Lookup key**: Enter a unique lookup key in the **Advanced** section (e.g., `standard_monthly`) to easily manage the pricing via the API.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/N5ARDMp-TfhcLtOO/images/stripe_usage_meter_configuration.png?fit=max&auto=format&n=N5ARDMp-TfhcLtOO&q=85&s=164fa086fa835b44b2ca17eff4e9c968" alt="Stripe Usage Meter Configuration" width="2293" height="1689" data-path="images/stripe_usage_meter_configuration.png" />
    </Frame>
  </Step>

  <Step title="Create the product">
    Once you have configured the pricing, click the **Add product** button to create the product on Stripe.
  </Step>
</Steps>

## Retrieve the Price ID from Stripe

After creating the product on Stripe, locate and copy the Price ID to link it to your portal.

Click the product action menu and select **Copy price ID**. The ID starts with the prefix `price_`.

<Frame>
  <img src="https://mintcdn.com/chatbotx/N5ARDMp-TfhcLtOO/images/stripe_copy_price_id_menu.png?fit=max&auto=format&n=N5ARDMp-TfhcLtOO&q=85&s=9679eac6988aa935a1eb89f227da45bc" alt="Stripe Copy Price Id Menu" width="2114" height="1502" data-path="images/stripe_copy_price_id_menu.png" />
</Frame>

## Next Steps

After copying the **Price ID** from Stripe, return to your Portal admin dashboard to configure resource quotas and link this Price ID to the corresponding plan.

Follow the instructions in the [Configure and Manage Plans](/whitelabel/plans) guide to complete setting up plans for your clients.

<Note>
  Before launching payments live, perform tests using trial cards in Stripe's Test Mode to verify that invoices and resource quotas are applied correctly.
</Note>
