Skip to main content

Sync webhooks

Using webhooks to synchronize your server with IAPHUB offers many advantages, validating an in-app purchase from your server is always the safest implementation.

If you're looking to sync the state of your subscriptions and process consumables, which is what 99% of our users need, you'll find the perfect example on Github here.

The example is in Node.JS but it shouldn't be an issue if you're using a different language, the purpose of this example is for you to understand the logic behind it.

By implementing webhooks just like the example below, you'll be able to:

  • Detect when a user buys a consumable
  • Detect when a user refund a consumable
  • Detect when a user buys a subscription and always be up to date with the latest state of the subscription (in order to restrict the access to certain features depending on the subscription state).

No need to say you also won't need to rely on IAPHUB using the getActiveProducs() method on the client side to check if the user has an active subscription, you'll be able to use your API 🙂

You can find the webhooks documentation here.