1. Documentation /
  2. Stripe WooCommerce Extension /
  3. Setup and Configuration of the Stripe WooCommerce Extension /
  4. Setting up webhooks

Setting up webhooks

Once you connect your Stripe account, you’ll want to make sure that the Stripe WooCommerce Extension on your site and your Stripe account are both communicating properly with each other.

This process is handled by something called “webhooks.” This guide covers how to configure these webhooks so that your Stripe account and your WooCommerce site work together seamlessly.

To start configuring your webhooks, you will need to:

  1. Find your webhook endpoint.
  2. Use that endpoint to configure your webhooks in Stripe.
  3. Add your webhook secret in your Stripe WooCommerce Extension settings.

Find your site’s webhook endpoint

↑ Back to top

In order for Stripe’s servers to properly communicate with your site, you’ll need to add a specific URL to your Stripe settings, which is called the “webhook endpoint.”

To find the webhook endpoint:

  1. Navigate to WooCommerce > Settings > Payments > Stripe > Settings from your admin dashboard.
  2. Once there, select Edit account keys:

This will bring up a modal titled Edit live account keys & webhooks.

  1. Highlight the webhook endpoint — which is usually your site’s URL followed by ?wc-api=wc_stripe — and copy it to your clipboard:

Configure webhooks in Stripe

↑ Back to top

Now that you have your webhook endpoint, it’s time to bring that information to your Stripe dashboard and configure the types of webhook events that will be communicated between your account and your WooCommerce site via the Stripe WooCommerce Extension.

To do this, you’ll:

  1. Add the webhook endpoint to your Stripe account.
  2. Choose which events your WooCommerce site will listen to.

Adding the webhook endpoint

↑ Back to top
  1. Navigate to your Stripe dashboard at dashboard.stripe.com.
  2. Select the Developers item on the top-right of the page.
  3. Select the Webhooks tab on the next page.
  4. Select the Add an endpoint button:
  1. Paste the webhook endpoint URL you copied previously in the Endpoint URL field.
  2. Add an optional description.

Choose which events to listen to

↑ Back to top

With the webhook endpoint in place, we will want to tell Stripe which events to listen for. If information from your WooCommerce site matches the events configured in your Stripe dashboard, then your Stripe account and your site will be in sync.

To choose which events to listen to:

  1. Select the Events on your account option under the Listen to heading.
  2. Add the events that you’d like to listen to.
    • At a minimum, there are 16 events that you will want to listen to. Those are:
      • charge.captured
      • charge.dispute.closed
      • charge.dispute.created
      • charge.failed
      • charge.refunded
      • charge.succeeded
      • payment_intent.amount_capturable_updated
      • payment_intent.payment_failed
      • payment_intent.requires_action
      • payment_intent.succeeded
      • review.closed
      • review.opened
      • setup_intent.setup_failed
      • setup_intent.succeeded
      • source.canceled
      • source.chargeable
  3. Select the Add endpoint button after selecting the desired events:

Adding your webhook secret

↑ Back to top

Now that we’ve added the webhook endpoint and determined which webhooks to listen to, you can add the webhook signing secret to your Stripe payment gateway’s settings.

To add the webhook signing secret to your site:

  1. Navigate to your Stripe dashboard at dashboard.stripe.com.
  2. Select the Developers item on the top-right of the page.
  3. Select the Webhooks tab on the next page.
  4. Select the webhook you configured under the Hosted endpoints heading.
    • The Hosted endpoints section may have multiple entries. If it does, select the option that corresponds with the WooCommerce site you are currently configuring.
  5. Select the Reveal option under Signing secret in the webhook details:

The Reveal option will turn into a webhook signing secret key, which will be a string of characters that begins with whsec_:

  1. Highlight the webhook signing secret and copy it to your clipboard.
  2. Navigate to WooCommerce > Settings > Payments > Stripe > Settings from your admin dashboard.
  3. Select Edit account keys to bring up the Edit live account keys & webhooks modal.
  4. Paste the webhook signing secret into the WEBHOOK SECRET section of the Edit live account keys & webhooks popup.
  1. Select Save live keys to save the Edit live account keys & webhooks settings.

Successful webhook configuration

↑ Back to top

Once you’ve successfully configured your webhooks, you will see a green Enabled indicator under the Account details section of the Stripe WooCommerce Extension settings at WooCommerce > Settings > Payments > Stripe > Settings.

Going further

↑ Back to top

Once you’ve properly configured your webhooks, you can start accepting payments.

The next steps are up to you and depend on what you’d like to accomplish. For example, you can: