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

# Set Up Webhooks for Your Stripe Direct Account

> Create the Stripe webhook that pushes payment events back into your Salesforce org for a Stripe Direct account, set up a matching test webhook, and collect the signing secret and API keys.

This guide walks you through connecting your own Stripe account to your Salesforce org using a **webhook**.

A few terms before you start:

* **Stripe** is the payment processor that actually charges the card.
* **Salesforce** is the system that fusionCore runs inside.
* A **webhook** is a URL that Stripe calls to push events back into your org — for example, when a payment succeeds, fails, or is refunded. Without it, your fusionCore records will not stay in sync with what happens in Stripe.
* A **Stripe Direct account** is your own standalone Stripe account connected straight to fusionCore, rather than a connected account routed through the fusionSpan platform account.

<Info>
  This page covers the Stripe-side webhook setup for a Stripe Direct account. For the in-org configuration that precedes it — the Payment Provider Account record, the `Stripe_MDT_Prefix__c` value, and the Payment Provider Secret records — see [Stripe Direct Accounts](/end-user-guides/stripe/stripe-direct-accounts).
</Info>

## Prerequisites

* You can log in to the Stripe account you want to connect.
* The fusionCore Stripe addon and the Commerce package are installed in your Salesforce org.
* Your Salesforce org has a Site URL available (the address ending in `my.salesforce-sites.com`).

## Set Up the Live Webhook

<Steps>
  <Step title="Log into the correct Stripe account">
    Log into your Stripe account on the Stripe website.

    Confirm you are in the correct account — the account name appears in the top left. Setting the webhook on the wrong account is a common cause of payment modals that hang on loading.
  </Step>

  <Step title="Open the Webhooks area">
    Click **Developers**, then click **Webhooks**.

    <Frame caption="Developers menu in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-211828.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=37e14dcbe53a000783748f6ce1bca38f" alt="The Stripe dashboard with Developers selected in the top navigation" width="1899" height="810" data-path="images/end-user-guides/5242585109/image-20260409-211828.png" />
    </Frame>

    <Frame caption="Webhooks area in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-211911.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=c32303b726b5b73fda018bc91fb67d80" alt="The Stripe Developers menu showing the Webhooks list" width="1905" height="801" data-path="images/end-user-guides/5242585109/image-20260409-211911.png" />
    </Frame>
  </Step>

  <Step title="Create the event destination">
    Click **Create an event destination**.

    <Frame caption="Create an event destination in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-212033.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=0672b8f2398d8c7f03d3d281fe955519" alt="The Stripe Webhooks page with the Create an event destination button" width="1889" height="813" data-path="images/end-user-guides/5242585109/image-20260409-212033.png" />
    </Frame>
  </Step>

  <Step title="Add the events fusionCore handles">
    Click the **All events** tab and add the following 15 events. You can paste each name into the search bar to find it quickly.

    * `charge.refund.updated`
    * `payment_intent.canceled`
    * `payment_intent.payment_failed`
    * `payment_intent.processing`
    * `payment_intent.requires_action`
    * `payment_intent.succeeded`
    * `customer.created`
    * `customer.updated`
    * `setup_intent.canceled`
    * `setup_intent.requires_action`
    * `setup_intent.setup_failed`
    * `setup_intent.succeeded`
    * `payment_method.updated`
    * `payment_method.automatically_updated`
    * `payment_method.detached`

    <Tip>
      Copy each name directly from this list and paste it into the Stripe search bar.
    </Tip>

    <Info>
      If you see 16 events after saving 15, this is normal. Stripe automatically adds `payment_method.card_automatically_updated` alongside `payment_method.automatically_updated`. It will not affect your integration.
    </Info>

    <Warning>
      Subscribe to **only** these events. fusionCore's webhook endpoint rejects event types it does not handle, which adds noise to the `Stripe_API_Log__c` records and makes real failures harder to spot.
    </Warning>

    <Frame caption="Selecting the events fusionCore handles">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-212536.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=636c0018864fe8c368e543e53a5542d0" alt="The Stripe All events tab with the 15 fusionCore webhook events added" width="1878" height="816" data-path="images/end-user-guides/5242585109/image-20260409-212536.png" />
    </Frame>
  </Step>

  <Step title="Choose the destination type">
    Click **Continue**, select **Webhook endpoint** as your destination type, then click **Continue** again.

    <Frame caption="Choosing the destination type in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-213145.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=1fdd0ee6111340b3aee1de51c0a96296" alt="The Stripe destination type selection with Webhook endpoint chosen" width="1881" height="765" data-path="images/end-user-guides/5242585109/image-20260409-213145.png" />
    </Frame>
  </Step>

  <Step title="Build the endpoint URL">
    Your endpoint URL is your Salesforce Site URL with the fusionCore webhook path added to the end.

    1. Take your Site URL, which is in the format `[yourURL].my.salesforce-sites.com`.
    2. Add `/services/apexrest/FCORE_PSTRIPE/Stripe` to the end of it.
    3. The final URL resembles `business-fun-2656.my.salesforce-sites.com/services/apexrest/FCORE_PSTRIPE/Stripe`.

    Check the URL carefully. Extra slashes (`/`), extra spaces, or misspellings will cause the webhook to fail.

    <Tip>
      Paste the final URL into a plain notepad first to verify it before entering it as the endpoint URL.
    </Tip>

    <Frame caption="Building the endpoint URL in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-213236.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=b1aa82866db76d8afe305e7abfef6041" alt="The Stripe endpoint URL field with the Salesforce site URL and fusionCore webhook path entered" width="1898" height="810" data-path="images/end-user-guides/5242585109/image-20260409-213236.png" />
    </Frame>
  </Step>

  <Step title="Create the destination">
    Click **Create destination** at the bottom left. Your webhook is now created.

    <Frame caption="Creating the webhook destination in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-213519.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=996c4a84253d81fa67a2dd1fec7c351a" alt="The Stripe Create destination button and the newly created webhook" width="1898" height="814" data-path="images/end-user-guides/5242585109/image-20260409-213519.png" />
    </Frame>
  </Step>
</Steps>

## Set Up a Test Webhook for Each Environment

Alongside your live webhook, set up a test webhook so you can verify the Stripe connection before taking real payments.

Set up one test webhook for **each** Salesforce environment you run fusionCore in. For example, with three environments — Production, Partial sandbox, and Full sandbox — you set up three Stripe test webhooks.

The steps are identical to the live webhook above, with one difference: you create each test webhook inside a **Stripe sandbox** rather than on your live account. Open a sandbox by clicking your Stripe account name in the top left and selecting the sandbox you want.

<Frame caption="Stripe sandbox switcher">
  <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260410-140335.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=433a6ea161432961cbad536ce75dcdc1" alt="The Stripe account menu used to switch into a sandbox for a test webhook" width="624" height="506" data-path="images/end-user-guides/5242585109/image-20260410-140335.png" />
</Frame>

<Info>
  If you do not have a sandbox yet, follow Stripe's [create a sandbox](https://docs.stripe.com/sandboxes/dashboard/manage#create-a-sandbox) instructions, then repeat the live webhook steps inside it.
</Info>

## Obtain the Signing Secret and API Keys

fusionSpan needs your signing secret and API keys to finish the webhook setup. These are sensitive credentials, so handle and transfer them only through a secure channel.

* The **signing secret** proves that events reaching your webhook genuinely come from Stripe and not from a malicious sender.
* The **API keys** let Stripe authenticate fusionCore's requests.

<Steps>
  <Step title="Copy the signing secret">
    Go to **Developers → Webhooks → \[your webhook]**.

    Click the eye icon to reveal the signing secret, then click the clipboard icon to copy it.

    <Frame caption="Revealing the signing secret in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-213615.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=7709516f7cb73059885b965b4df6d362" alt="The Stripe webhook detail page with the eye icon to reveal the signing secret and the clipboard icon to copy it" width="1896" height="813" data-path="images/end-user-guides/5242585109/image-20260409-213615.png" />
    </Frame>
  </Step>

  <Step title="Copy the API keys">
    Go to **Developers → Overview** (bottom left) and scroll to the **API keys** section.

    Copy the **Publishable key** (starts with `pk`) and the **Secret key** (starts with `sk`).

    <Frame caption="API keys section in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260409-211629.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=5d5e815f8bd33497a09a09e39ad76d3e" alt="The Stripe Developers Overview page showing the API keys section with the Publishable key and Secret key" width="1889" height="770" data-path="images/end-user-guides/5242585109/image-20260409-211629.png" />
    </Frame>
  </Step>
</Steps>

<Info>
  Send the signing secret and API keys to the fusionSpan team through a secure channel, and label each one clearly by environment. This includes the test webhook signing secrets and API keys, so they can be told apart from the live ones.
</Info>

## Enable Payment Methods

Make sure every payment method you want to accept is enabled on your Stripe account.

<Steps>
  <Step title="Open payment method settings">
    Log into Stripe, then go to **Settings → Payments → Payment methods**.

    <Frame caption="Payment methods settings in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/Screenshot_2026-03-12_at_10.30.13-AM.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=0b3b113b4741dbabe424dafbbd8d0669" alt="The Stripe Settings page open to Payments and Payment methods" width="260" height="126" data-path="images/end-user-guides/5242585109/Screenshot_2026-03-12_at_10.30.13-AM.png" />
    </Frame>
  </Step>

  <Step title="Enable the methods you want">
    Click **Default**, then under **Default** click **Enable** for each payment method you want to offer.

    Stripe Direct accounts support Card, ACH, WeChat Pay, and Alipay.

    <Frame caption="Enabling payment methods in Stripe">
      <img src="https://mintcdn.com/fusionspan/PQhCyVfBbt1uWfmh/images/end-user-guides/5242585109/image-20260312-153242.png?fit=max&auto=format&n=PQhCyVfBbt1uWfmh&q=85&s=4e913ad4a217b6ab259096729494556c" alt="The Stripe Default payment methods view with Enable controls for Card, ACH, WeChat Pay, and Alipay" width="1377" height="704" data-path="images/end-user-guides/5242585109/image-20260312-153242.png" />
    </Frame>
  </Step>
</Steps>

## Limitations and Common Pitfalls

<Warning>
  **Validate the Payment Provider Account after the webhook exists.** Validation completes in two stages. Clicking **Validate** on the Payment Provider Account record does not by itself mark it `Succeeded`; it sets up a Stripe test customer and then waits for the inbound `customer.created` or `customer.updated` webhook event to flip `FCORE_PAY__Validation_Status__c` to `Succeeded`. If the webhook is missing or misconfigured, validation never completes even when your keys are correct.
</Warning>

<Warning>
  **Editing key fields silently resets validation.** Changing `FCORE_PAY__External_Id__c`, `FCORE_PAY__Request_Signature_Secret__c`, or `Stripe_MDT_Prefix__c` on the Payment Provider Account clears `FCORE_PAY__Validation_Status__c`. You must re-run **Validate** afterward.
</Warning>

<Warning>
  **Failed webhook events fail quietly.** fusionCore rejects an inbound request — returning an HTTP 204 that Stripe treats as success and does not retry — when the `Stripe-Signature` header is missing or invalid, the signature does not match your signing secret, or the request is older than 300 seconds. Events meant for a different org or for the wrong live/test mode are also dropped silently. Because Stripe sees a success, these failures are easy to miss; if records stop syncing, check that the signing secret and endpoint URL exactly match.
</Warning>

<Warning>
  **Use exactly the listed endpoint path and event set.** A typo, extra slash, or extra space in `/services/apexrest/FCORE_PSTRIPE/Stripe` breaks the webhook. Subscribing to events outside the 15 listed above causes the endpoint to error on those events.
</Warning>

<Note>
  **Pending payments can auto-cancel.** Payments left awaiting member action are cancelled after method-specific timeouts: 60 minutes for Card, 7 days for ACH, and 5 minutes for Alipay and WeChat Pay. A member who delays completing 3-D Secure or microdeposit verification past these windows will have the payment cancelled.
</Note>
