How does Apple notify iOS apps of refunds of in-app purchases (IAP)? How does Apple notify iOS apps of refunds of in-app purchases (IAP)? ios ios

How does Apple notify iOS apps of refunds of in-app purchases (IAP)?


The in-app purchasing guide discusses the concept of "cancellation" of subscriptions. This is the only place I've seen discussing the subject.

Further details about the cancellation date field can also be found in the App Store receipt validation documentation.

cancellation_date

After decoding a receipt, you can get the cancellation date which will tell you the following:

For a transaction that was canceled by Apple customer support, the time and date of the cancellation.


Update June 24, 2020:

At WWDC 2020, a new notification was introduced that informs you of refunds: https://developer.apple.com/documentation/storekit/in-app_purchase/handling_refund_notifications


Original answer:

I received a response from Apple Developer Relations today (Dec 6, 2018):

Hello Johannes,

In response to your question, unfortunately, there is no supported means to detect that the user has contacted Apple Care and received a refund for the In-App Purchase of a consumable item. The only option which I can refer you to is to submit an API enhancement request for an API to be made available for an app to detect that a refund was provided to a user of an In-App Purchase. Currently, this support is realistically only available to apps which offer auto-renewable subscription In-App Purchase.

You can submit the enhancement request using the Apple Developer Bug Report web page - http//bugreport.apple.com

As this is an enhancement request type issue, I'm going to arrange for this incident to be unbilled from your account for use on a future issue.

So there we have it.


The strategy is:

  1. You save the latest_receipt ("MIIUJgYJKoZIhvc..." base64) field in your DB, associated with the user account.

  2. Every day you query apple to validate all the receipts, by sending them the base64 receipt from saved latest_receipt field.

  3. In the receipt you check if there is a cancellation_date field. If you find it, treat it according to documentation:

Treat a canceled receipt the same as if no purchase had ever been made.

Same way you also checking subscription renewals (check expires_date_ms field).