My app backend needs to add balance to my user’s account for each new subscription purchase, what is the delay before a new subscription is sent to my configured webhook?
What is the delay SLA for webhook calls?
Hi
Most webhooks will be delivered in near real-time, but delays are possible. Most cases this is just a second or so, but could be minutes, or in rare cases hours. For INITIAL_PURCHASES
(the case you’re describing here), if the purchase was initiated in the app, the SDK would notify RevenueCat and webhook event will be dispatched. For any purchases made outside of the app (e.g: renewals, upgrades/downgrades, etc) this will be sent to RevenueCat via S2S notifications.
To help reduce any delays, we recommend setting up Platform Server (S2S) Notifications: https://docs.revenuecat.com/docs/server-notifications
If you’re just looking for the webhook to confirm purchase of a product, you can build redundancies in the app by pinging your servers in the purchase completion block and make a call server side to RevenueCat’s GET /subscribers endpoint to unlock any access or map the product to a specific balance to add to the account.
![Strength In Numbers Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/ad9785ad-84a4-4bde-98db-d0de530785fc_thumb.png)
Hi
When I call GET subscriber there is no information about recent transactions, it only tells me the entitlements, this is not enough because I need to add balance to users for certain subscriptions.
Only knowing whether user has entitlement cannot prevent user from calling the backend API multiple times to add balances multiple times for a subscription initial purchase.
![One Year Wiser Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/199b3856-4040-459a-ac89-09699ef6f081_thumb.png)
In the redundancy case you mentioned above, is there a way to translate the webhook transaction_id
field (described as “Transaction identifier from Apple/Google” in the webhook doc here) into the RevenueCat unique id that is retrieved from GET /subscribers or in the PurchaserInfo object? I don’t see the unique RevenueCat id in the webhook events.
Hey
There unfortunately isn’t a way to translate the Apple/Google transaction ID into the RevenueCat transaction ID - we’ll hopefully be cleaning this up in the next API and Webhooks versions, but those are on the mid to longer term roadmap.
As a workaround, you may need to have the webhook event trigger an API call to GET /subscribers to get the additional information you need. I know it’s not the cleanest but should work.
![One Year Wiser Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/199b3856-4040-459a-ac89-09699ef6f081_thumb.png)
Thanks
Thank you
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.