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

# Configure your Stripe account

> Get your Secret API Key and configure the required webhooks in Stripe Dashboard before connecting to Brain Studio.

This guide covers the two tasks you must complete **in Stripe Dashboard** before connecting to Brain Studio:

1. **Get your Secret API Key** (Test or Live) to install Stripe in Marketplace.
2. **Configure webhooks** so Jelou receives payment events and your flow works correctly.

<Check>
  By the end of this guide you will have credentials and webhooks ready to connect Stripe in Brain Studio.
</Check>

***

## Before you begin

<Info>
  You need an **active Stripe account**, access to the **Stripe dashboard**, and permissions to view/create **API Keys** and **Webhooks**.
  No advanced technical knowledge is required.
</Info>

***

## Environments in Stripe (Test vs Live)

Stripe separates environments by **key type**:

* **Test (`sk_test_...`)**: for testing without real transactions.
* **Live (`sk_live_...`)**: for real charges in production.

<Warning>
  Brain Studio connects to Stripe using the key you enter.
  If you install with a **Test** key, your integration stays in **test mode**.
  If you install with a **Live** key, it is ready for **production**.
</Warning>

***

## Part 1 — Get your Secret API Key

<Steps>
  <Step title="Log in to the Stripe dashboard">
    Sign in to the merchant's Stripe account.

    <Frame caption="Stripe Dashboard (merchant account)">
      <img src="https://mintcdn.com/jelouai/y5L6vahGrhMqbaUQ/assets/images/integraciones/pagos/stripe-dashboard.png?fit=max&auto=format&n=y5L6vahGrhMqbaUQ&q=85&s=604fd058d50b0e925635d9acf98a0abc" alt="Stripe main dashboard" width="2048" height="954" data-path="assets/images/integraciones/pagos/stripe-dashboard.png" />
    </Frame>
  </Step>

  <Step title="Go to Developers → API Keys">
    There are two ways to reach **API Keys**:

    * Via settings (icon at the top right → Developers → Manage API keys)
    * In the left side menu, find the **Developers** section and click **API Keys**.

    <Frame caption="Direct access to Developers in the side menu">
      <img src="https://mintcdn.com/jelouai/y5L6vahGrhMqbaUQ/assets/images/integraciones/pagos/stripe-menu-desarrolladores.png?fit=max&auto=format&n=y5L6vahGrhMqbaUQ&q=85&s=b3ca65399a3b0bd0d86373ef5e4ef226" alt="Side menu with direct access to Developers and API Keys" style={{ maxWidth: '200px', margin: '0 auto' }} width="422" height="844" data-path="assets/images/integraciones/pagos/stripe-menu-desarrolladores.png" />
    </Frame>
  </Step>

  <Step title="Choose the environment (Test or Live)">
    Stripe may show test mode in two ways (depending on your account):

    * An option like **"Test mode"** / **"Switch to a test environment"** from the account selector.
    * A **top bar** indicating you are using test data.

    <Frame caption="Switching to 'Test mode'">
      <img src="https://mintcdn.com/jelouai/y5L6vahGrhMqbaUQ/assets/images/integraciones/pagos/stripe-toggle-modo-prueba.png?fit=max&auto=format&n=y5L6vahGrhMqbaUQ&q=85&s=8327d31f16dcb52e7c7522fd91c8832c" alt="Account selector with option to switch to test environment" style={{ maxWidth: '300px', margin: '0 auto' }} width="1060" height="712" data-path="assets/images/integraciones/pagos/stripe-toggle-modo-prueba.png" />
    </Frame>

    <Info>
      If your account is in **Live mode**, it is normal to see keys with `live` in the API Keys section.
      To get **Test** keys, you must enter **Test mode** and return to this same screen.
    </Info>

    <Frame caption="Exiting 'Test mode'">
      <img src="https://mintcdn.com/jelouai/y5L6vahGrhMqbaUQ/assets/images/integraciones/pagos/stripe-salir-modo-prueba.png?fit=max&auto=format&n=y5L6vahGrhMqbaUQ&q=85&s=a7ff3705bf51671a6b46a5f8452ed0eb" alt="Option to exit test mode in Stripe" style={{ maxWidth: '200px', margin: '0 auto' }} width="512" height="556" data-path="assets/images/integraciones/pagos/stripe-salir-modo-prueba.png" />
    </Frame>
  </Step>

  <Step title="Create (or copy) your Secret API Key">
    In **API Keys**, you will see two types of keys:

    * **Publishable key (`pk_...`)** → NOT used to install Stripe in Brain Studio
    * **Secret key (`sk_...`)** → YES, this is the one you need

    <Warning>
      In Brain Studio you must always use a **Secret API Key** (`sk_test_...` or `sk_live_...`).
      Do not use the Publishable Key (`pk_...`).
    </Warning>

    If you already have a **Secret key** ready to use, you can copy it.
    If you need to create a new one, click **Create secret key**.

    <Frame caption="'Standard Keys' section with 'Create secret key' button">
      <img src="https://mintcdn.com/jelouai/y5L6vahGrhMqbaUQ/assets/images/integraciones/pagos/stripe-crear-clave-secreta.png?fit=max&auto=format&n=y5L6vahGrhMqbaUQ&q=85&s=82ac88a6398bf6813dd80b3b479bad8a" alt="Standard keys section and create secret key button" style={{ maxWidth: '500px', margin: '0 auto' }} width="2048" height="401" data-path="assets/images/integraciones/pagos/stripe-crear-clave-secreta.png" />
    </Frame>
  </Step>

  <Step title="Choose the key type (recommended: Standard)">
    When creating a key, Stripe usually shows options such as:

    * **How I'm building my integration** (standard key / full access)
    * **I'm providing this key to another website** (Stripe suggests a restricted key)

    For Marketplace (BYOK) and to avoid friction, **we recommend using a standard key**.

    <Frame caption="Secret key creation options">
      <img src="https://mintcdn.com/jelouai/y5L6vahGrhMqbaUQ/assets/images/integraciones/pagos/stripe-modal-crear-clave.png?fit=max&auto=format&n=y5L6vahGrhMqbaUQ&q=85&s=b64a54463942a5bdfea3f6e16358bef5" alt="Stripe modal for creating a secret key with options" style={{ maxWidth: '300px', margin: '0 auto' }} width="998" height="1260" data-path="assets/images/integraciones/pagos/stripe-modal-crear-clave.png" />
    </Frame>

    <Info>
      Stripe may recommend restricted keys for sharing with third parties.
      In Jelou, the key is stored securely at the platform level (it is not exposed to the end user).
      If you need additional control, review the **Restricted keys (optional)** section at the end of this guide.
    </Info>

    <Check>
      If the key you copied starts with `sk_test_` or `sk_live_`, you have everything you need to install Stripe.
    </Check>

    <Frame caption="Secret key delivery">
      <img src="https://mintcdn.com/jelouai/y5L6vahGrhMqbaUQ/assets/images/integraciones/pagos/stripe-clave-creada-confirmacion.png?fit=max&auto=format&n=y5L6vahGrhMqbaUQ&q=85&s=e0d43cc5e3dce0649f11caf74808c780" alt="Confirmation of secret key created in Stripe" style={{ maxWidth: '300px', margin: '0 auto' }} width="834" height="854" data-path="assets/images/integraciones/pagos/stripe-clave-creada-confirmacion.png" />
    </Frame>
  </Step>

  <Step title="Use the Secret API Key in Brain Studio">
    During installation from **Marketplace**, Brain Studio will ask for a single credential: **API Key**.

    Paste your Secret API Key (`sk_test_...` or `sk_live_...`) and confirm.

    <Frame caption="Brain Studio installation modal requesting 'API Key' for Stripe">
      <img src="https://mintcdn.com/jelouai/y5L6vahGrhMqbaUQ/assets/images/integraciones/pagos/stripe-brain-studio-modal-credenciales.png?fit=max&auto=format&n=y5L6vahGrhMqbaUQ&q=85&s=e7957eb3f53a1939ff114144bb365567" alt="Brain Studio modal requesting API Key to install Stripe" style={{ maxWidth: '480px', margin: '0 auto' }} width="1910" height="684" data-path="assets/images/integraciones/pagos/stripe-brain-studio-modal-credenciales.png" />
    </Frame>

    Once configured:

    * Charges are processed **directly** in the merchant's Stripe account.
    * Jelou **does not hold funds**.
    * The payment result returns to the flow to continue based on the real status.
  </Step>
</Steps>

***

## Test vs Live in Brain Studio

* If you install with `sk_test_...`, you operate in **test mode**.
* If you install with `sk_live_...`, you operate in **production**.

<Warning>
  To change from **Test → Live** (or vice versa), you currently need to:
  **uninstall Stripe** in Marketplace and **reinstall** with the new key.
</Warning>

***

## Restricted keys (optional)

Stripe allows creating **Restricted Keys** (usually seen as `rk_...`) with specific permissions.

You can use a restricted key if your organization requires greater control, but you must ensure you enable the necessary permissions for Stripe to work correctly in Brain Studio.

<Tip>
  If you want to learn more, review the official Stripe documentation on API keys:
  [https://docs.stripe.com/keys](https://docs.stripe.com/keys)
</Tip>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="I cannot find 'Test mode' or 'View test data'">
    In some Stripe accounts, Test access appears in the **account selector** (top left) as:

    * **Switch to a test environment**
    * **Test mode**
    * **Manage test environments**

    If you are already in test mode, a **top bar** usually appears indicating you are using test data.
  </Accordion>

  <Accordion title="I copied a key starting with `pk_` and Brain Studio does not accept it">
    You are using a **Publishable key** (`pk_...`).

    Go back to **Developers → API Keys** and copy a **Secret key** (`sk_...`).
  </Accordion>

  <Accordion title="I created a key and cannot see it in full again">
    Stripe shows the full key **only once** at the moment of creation.

    If you did not save it:

    * create a new key
    * save it in a safe place (password manager / secret vault)

    <Info>
      This is normal Stripe behavior to protect secret keys.
    </Info>
  </Accordion>
</AccordionGroup>

***

## Best practices

<AccordionGroup>
  <Accordion title="Secret API Key security">
    * Do not share your `sk_...` by chat or email.
    * Store it in a password manager or secret vault.
    * If you suspect exposure, rotate it from the Stripe dashboard and reinstall Stripe in Brain Studio with the new key.
  </Accordion>

  <Accordion title="Usage per environment">
    * Use `sk_test_...` for internal testing and QA.
    * Before going live, install with `sk_live_...` and validate a real end-to-end payment.
  </Accordion>
</AccordionGroup>

***

## Part 2 — Configure webhooks in Stripe (required)

Jelou needs Stripe to **send payment events** to the platform to align the charge result with your flow in Brain Studio. This is configured **in Stripe Dashboard**: you create a webhook endpoint and select the events listed below.

<Warning>
  Without correct webhooks, a payment may complete in Stripe and yet the flow in Brain Studio can remain **inconsistent** (for example, stuck as pending or not advancing to the expected node output).
</Warning>

<Info>
  Stripe distinguishes **test mode (Test)** and **production mode (Live)**. Configure **one webhook per mode** if you plan to use both. The **Secret API Key** you will install in Marketplace (`sk_test_...` or `sk_live_...`) must correspond to the same mode as the webhook you are configuring in the dashboard.
</Info>

### Open Developers, Workbench, and Webhooks

<Steps>
  <Step title="Open Developers">
    In **Stripe Dashboard**, locate the **Developers** section (in some accounts it appears in the bottom bar).
  </Step>

  <Step title="Open Workbench">
    Open the **Workbench** from the access Stripe provides (for example, the upward arrow icon in the developer bar).
  </Step>

  <Step title="Go to the Webhooks tab">
    Inside the Workbench, select the **Webhooks** tab and create a **new destination** or **new endpoint** (the exact name may vary depending on the panel version).
  </Step>
</Steps>

<Frame caption="Stripe Workbench: access to the Webhooks tab">
  <img src="https://mintcdn.com/jelouai/n3bukj6jLe8mOQaO/assets/images/integraciones/pagos/stripe-webhook-workbench.png?fit=max&auto=format&n=n3bukj6jLe8mOQaO&q=85&s=1cfd402a788ee00c2640c7963e8a3bb5" alt="Stripe Dashboard: Workbench with the Webhooks tab visible" width="1024" height="471" data-path="assets/images/integraciones/pagos/stripe-webhook-workbench.png" />
</Frame>

### Choose events and destination type

<Steps>
  <Step title="Select events">
    When the wizard asks which events to notify, search for `payment_intent` and select **only** these three:

    * `payment_intent.succeeded`
    * `payment_intent.requires_action`
    * `payment_intent.payment_failed`
  </Step>

  <Step title="Event origin">
    If Stripe asks for the origin, choose **Your account**.
  </Step>

  <Step title="Destination type">
    Choose **Webhook endpoint** (HTTPS URL), not other connectors like EventBridge.
  </Step>
</Steps>

<Frame caption="payment_intent events selected in the Stripe wizard">
  <img src="https://mintcdn.com/jelouai/n3bukj6jLe8mOQaO/assets/images/integraciones/pagos/stripe-webhook-events.png?fit=max&auto=format&n=n3bukj6jLe8mOQaO&q=85&s=9f9c4cfc01584290e6038faadd28257b" alt="Stripe event list with payment_intent.succeeded, requires_action, and payment_failed checked" width="1024" height="475" data-path="assets/images/integraciones/pagos/stripe-webhook-events.png" />
</Frame>

### Endpoint URL by environment

Copy the URL that corresponds to the active mode in the Dashboard (bar or indicator of **test mode** / **live**).

<Tabs>
  <Tab title="Test mode">
    ```text theme={null}
    https://chat-payments.jelou.dev/link-webhook?provider=STRIPE
    ```
  </Tab>

  <Tab title="Production mode (Live)">
    ```text theme={null}
    https://chat-payments.jelou.ai/link-webhook?provider=STRIPE
    ```
  </Tab>
</Tabs>

<Steps>
  <Step title="Paste the URL and save">
    In the endpoint URL field, paste the address from the tab above according to the mode you are working in. Review the summary: it should show the **three events** and the **webhook** type. **Create** or **save** the destination.
  </Step>

  <Step title="Repeat for the other mode (if applicable)">
    If you use Test and Live, go back and create the endpoint in the other Dashboard mode with the other URL (`jelou.dev` for Test, `jelou.ai` for Live).
  </Step>
</Steps>

<Frame caption="Jelou webhook URL entered in the Stripe endpoint">
  <img src="https://mintcdn.com/jelouai/n3bukj6jLe8mOQaO/assets/images/integraciones/pagos/stripe-webhook-endpoint.png?fit=max&auto=format&n=n3bukj6jLe8mOQaO&q=85&s=f061c89ab243e7a0b5e5290fa05eda53" alt="Stripe form to create a webhook destination with the Jelou URL and destination name" width="1024" height="474" data-path="assets/images/integraciones/pagos/stripe-webhook-endpoint.png" />
</Frame>

### Verify the endpoint in Stripe

Before continuing, confirm in the dashboard that the destination was correctly registered:

<Steps>
  <Step title="Review the destination list">
    In **Stripe → Workbench → Webhooks**, the newly created endpoint should appear with status **Active**.
  </Step>

  <Step title="Confirm events and URL">
    Open the destination detail and verify that:

    * It listens to exactly the **three events** (`payment_intent.succeeded`, `payment_intent.requires_action`, `payment_intent.payment_failed`)
    * The URL points to the correct Jelou address for your environment (`jelou.dev` for Test, `jelou.ai` for Live)
  </Step>
</Steps>

<Check>
  If the destination appears as Active with the three events and the Jelou URL, the Stripe configuration is complete.
</Check>

<Tip>
  If something doesn't match, check in this order: that the Dashboard mode (Test vs Live) matches the URL, that the three events are selected, and that the URL has no extra spaces or characters.
</Tip>

***

## Next step

<Card title="Connect in Brain Studio" href="/guides/integraciones/pagos/proveedores/stripe/conectar-en-brain-studio" icon="plug">
  Install Stripe in Marketplace and connect your account using your Secret API Key.
</Card>
