We want to apply additional business logic based on customers’ billing related transactions like subscription/renewal etc. on the server side.
For eg : Whenever there is a paid subscription by a user, provide some incentives or something similar.
What would be the best approach in order to get the transactions information?
- Is there an API which we can poll for transactions from the server at regular intervals?
- Will Webhooks solve this problem? Where can I find some examples of Webhooks?
We are currently using Free plan.
Best answer by Björn WagnerView original
I am currently experimenting with Webhooks and I guess that would be the perfect fit for you, as they support specific event types. Once the event was triggered, you can run custom code to grant the benefits you described.
A list with supported types can be found here: https://docs.revenuecat.com/v1.2/docs/webhooks#event-types
There is also a RestAPI that can be used to pull information about a subscriber: https://docs.revenuecat.com/reference#subscribers
Hope this helps :)
Thank you for the reply.
Will try the Webhooks feature for sure. The API to pull the subscribers information looks costlier as this has to be done per customer.
Any examples if you can point out for the Webhooks feature.
+1 to the suggestion to use webhooks provided by
@Björn Wagner. For a backend example you can take a look at our Firebase sample code which catches webhooks. You can also take a look at this guide which implements automated cancellation surveys using Zapier and RevenueCat webhooks. While neither probably fits your use case exactly, they can show you real-world examples of how webhooks can be used to achieve something like you want to do.