Hello,
I am wondering if it is possible for stripe checkout metadata to be propagated from the revenue cat webhooks that get sent to my server. I understand how we can set the app_user_id ( a combination of setting the metadata in checkout.sessions.create ) but is is possible to set other metadata on the stripe session that will propagate to my server? This feature would be useful in cases where the I have a ton of different products and I could link it the db identifier on my end to avoid looking up the product from stripes api.
Thanks!
Forward Metadata from Strip to RevenueCat Webhooks
Best answer by jeffrey_bunn
The reason why I care about any of this is I am trying to know the price_id from stripe, not the product_id. It is nice that the product_id comes in from the webhooks from RC but that doesnt tell me which specific offering within that product was purchased… So I am forced to have only one offering within my product from stripe, which is not ideal
That makes sense. This is probably rough, but would you be able to know by the price paid?
Also, if I post receipts like this to revenue cat, will a webhook for the INITIAL_PURCHASE of the subscription be sent from RC?
Yes, the initial_purchase webhook will be triggered for a new purchase posted to us.
I am also wondering, since it isn’t clear to me in the docs - if we should not listen to customer.subscription.created and checkout.session.completed in the direct stripe → rev cat “server to server” architecture. I’d imagine in the flow I am building that there would be a race condition between my server listening to that + updating the customer attributes and RC’s server getting the events and generating the webhook “before” I am able to update customer attributes?
Please ensure you have Stripe server notifications enabled, but importantly, do not enable “Track new purchases from server-to-server notifications”. The latter option will result in us creating the purchase in RevenueCat, while the former will not process Stripe server notifications if the purchase has not already been posted to us by you.
I think if RC had an option to just forward stripe metadata to their webhooks to our servers this problem would get a lot easier from a developers perspective.
100%. Hopefully we can support this in the near future.
Please let me know if you have additional questions. Thanks, Tony!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
