Receipt validation for in-app purchases

At a glanceReceipt validation is provided for in-app purchases made in the iOS and Android app stores.

Receipt validation flow

The Receipt Validation flow is as follows:

  1. User performs an in-app purchase.
  2. The app store notifies the app of the successful purchase.
  3. App developer calls the SDK Receipt Validation function.
    validateAndTrackInAppPurchase
  4. The SDK calls the AppsFlyer validation service.
  5. AppsFlyer validates the purchase to ensure it is not fraudulent.
  6. Upon success, AppsFlyer internally creates a regular af_purchase event. Otherwise, the created event is tagged as fraudulent (available via Protect360). 
  7. The AppsFlyer validation service transfers the response to the SDK.
  8. The SDK transfers the receipt validation response to the app (either success or fail).

For details about the implementation of Receipt Validation, refer to the:

 Important!

Calling validateAndTrackInAppPurchase also generates an af_purchase in-app event. As such, don't generate an af_purchase event when validating. Doing so results in duplicate revenue events.

Was this article helpful?