Introduction

IAPHUB can send a notification to your server when an event occurs.
You can enable webhooks by providing in the settings the endpoint of your server that should be reached.

Request

The webhook will be sent as a POST request to your server, you should check the X-Auth-Token header to validate that the request comes from IAPHUB. Your server must return a 200 status code.

note

If the request fails, we'll send you an alert and retry directly one more time and then again in 1 minute, 10 minutes, 1 hour and 24 hours. You can retry sending a request directly from the dashboard as well.

Request body

The body of the request will contain a JSON object with some properties common to any event:

{
id: "5e7fdfe22a3cff5084466e79"
type: "..."
createdDate: "2019-10-12T17:34:35.256Z"
version: "1.3.0"
}
id
StringId of the webhook event
type
StringThe type of event, it can be one of the following:
NameDescription
purchaseA product has been purchased (triggered for subscriptions as well if it isn't a renewal)
refundA purchase has been refunded
user_id_updateA user id has been updated
subscription_renewalA subscription has been renewed
subscription_renewal_retryA subscription renewal has failed but will be retried
subscription_grace_period_expireA subscription grace period has ended
subscription_product_changeA subscription product has been changed (will be replaced at the next renewal date)
subscription_replaceA subscription has been replaced by a new subscription with a different product
subscription_cancelA subscription auto-renewal has been cancelled (but is still active)
subscription_uncancelThe auto-renewal of a subscription previously cancelled is now active
subscription_expireA subscription has expired
subscription_pauseA subscription has been paused (Android only)
subscription_pause_enabledA subscription pause has been enabled (Android only)
subscription_pause_disabledA subscription pause has been disabled (Android only)
version
StringVersion of the webhook format, using semantic versioning.
The latest version available is 1.3.0, you must update your settings to upgrade your webhooks format to a MAJOR version.