Purchasely Webhook is a unified interface that streams subscription Events to the Client Backend.
This interface has 2 purposes :
Notifying the client backend each time an event occurs on a subscriber
Unifying the Events from each store into a common language, to simplify much the integration for the client backend
In other words, the main advantage of the Webhook is that it avoids to the client backend team, to develop and maintain a specific interface for each Mobile Application Store and to have to validate the native receipts.
The Webhook is used in 2 main use-cases :
when a new in-app purchase is performed by a user inside the mobile application.
when any life-cycle event happens on a subscription
At the client backend level, an endpoint must be developed to :
receive the subscription Events coming from the Webhook
transform these Events into actual user Entitlements
acknowledge the good reception of the receipt to the Purchasely Cloud Platform
The client backend is also in charge of :
managing the user Entitlements and providing them to the mobile applications
managing the access to the contents depending on the user Entitlements
The first case where an Event is sent on a Webhook is when an in-app subscription is purchased by the user in the mobile application. An Event is sent on the Webhook to notify the client backend that this particular user must be entitled with the rights corresponding to the subscription.
The second case where Events are sent on the Webhook is when something happens in a subscription lifecycle. The main Events are :
the renewing of a subscription
the cancellation of the auto-renewing a subscription
the expiration of a subscription
the billing failure of a subscription
Most of these Events are coming directly from the Application Store and their Server-to-server notifications that Purchasely Cloud Platform receives.