Question

Forward Stripe Webhooks

  • 26 June 2022
  • 1 reply
  • 151 views

Badge +4

Hi, 

 

We already have a Stripe webhook endpoint that does preprocessing and database updates for the webhooks listed here among others on our Express server. Is there a way to `forward` that webhook that Stripe sent our server to RevenueCat once our updates are done rather than having Stripe send RevenueCat the webhook directly?

 

Inside those webhooks from Stripe am I simply able to call the following endpoint and the subscription status would automatically updated in RevenueCat, thereby triggering a RevenuCat webhook?

await axios.post('https://api.revenuecat.com/v1/receipts',{ app_user_id: userId, fetch_token: subscription.id },{ headers: { 'X-Platform': 'stripe', Authorization: `Bearer ${config.revenueCat.stripe}` } })

1 reply

Userlevel 5
Badge +9

Inside those webhooks from Stripe am I simply able to call the following endpoint and the subscription status would automatically updated in RevenueCat, thereby triggering a RevenueCat webhook?

Yeah I believe that would trigger the subscription to refresh on the RevenueCat side and trigger any webhooks from RevenueCat. 

 

My understanding also is that you can set up multiple webhooks though in Stripe, so you can keep the one you have and set up a second one to go to RevenueCat?

You’ll still need to call that POST /receipt endpoint to send the initial Stripe subscription into RevenueCat, the Stripe webhooks are only used to help keep the subscription status up-to-date - they do not create subscriptions. 

Reply