Stripe Server Notifications

Sending Stripe server notifications to RevenueCat

RevenueCat does not require server notifications from Stripe, however doing so can speed up webhook and integration delivery times and reduce lag time for Charts.

🚧

Send Stripe token to RevenueCat

Stripe Server Notifications only work if the receipt exists in RevenueCat when the event is dispatched from Stripe. If the receipt doesn't exist, the event will fail. This includes test events from Stripe.

You'll need to follow our Stripe Web Payments guide and send your purchase tokens to RevenueCat before proceeding with this guide.

stripe notifications

Required and optional notifications from Stripe

Setup Instructions

  1. Navigate to your app settings in the RevenueCat dashboard by selecting your app from Project Settings > Apps.
  2. Expand the Webhook Configuration section and copy the endpoint provided under Stripe Webhook Endpoint.
1778
  1. Log in to Stripe and go to the Webhooks dashboard.
  2. Click Add endpoint, paste the URL in the Endpoint URL field and select the following events:
  • customer.subscription.updated
  • customer.subscription.deleted
  • charge.refunded
  • invoice.updated

It's important to only select these events.

1518

🚧

If you choose other events besides what's listed above, our API will respond with an error, and Stripe will eventually disable the webhook.

  1. Click Add endpoint. You might be asked to enter your password.
  2. Copy the Signing Secret value and go back to your app settings in the RevenueCat Dashboard (select your app under Project Settings > Apps).
2806
  1. Paste it in the Stripe Webhook Secret input field and save. The input field should now look like this:

Stripe Webhook 400 Errors

Sometimes you may experience 400 errors when connecting to Stripe. Generally these happen when there is something wrong with your configuration or your Stripe account is not properly connected to RevenueCat.

Configuration

Two common configuration errors are with events and the webhook secret.
One webhook endpoint should contain all of the events, not one endpoint per event, and the only events supported are those listed above in step 4. The Stripe Webhook Secret should be properly set in your RevenueCat project settings in the Stripe Webhook Secret field. If this field is missing or not identical to the secret generated in Stripe, 400 errors will occur.

Reconnecting Stripe

When debugging connection issues with Stripe, it may be necessary to reconnect Stripe and RevenueCat. Make sure to use the email that owns RevenueCat project. To reconnect, follow these steps:

  1. Disconnect from Stripe in the RevenueCat dashboard
  2. Uninstall the app from your Stripe account in the Stripe Dashboard
  3. In the RevenueCat dashboard, click 'Connect to Stripe'
  4. Install the RevenueCat app in the Stripe dashboard
  5. Ensure the 'test mode' switch is off in Stripe
  6. Click 'Sign in with RevenueCat' in Stripe in the RevenueCat app's settings

🚧

When reconnecting to Stripe, the webhook secret can change so make sure it is the same in both Stripe and RevenueCat.