Typically you should be looking for the revocation fields' presence in the signed transaction as an indication that content has been revoked (due to a refund or a family sharing revocation):
https://developer.apple.com/documentation/appstoreserverapi/revocationdate
https://developer.apple.com/documentation/appstoreserverapi/revocationreason
At this time you can revoke any content that was granted as part of the purchase, e.g. ceasing subscription access or disabling a non-consumable feature unlock. Note that refunds may be reversed in some scenarios, in which case these fields will be removed from the transaction and you should re-enable this content once more. The best way to keep track of refunds and refund reversals is with App Store Server Notifications V2, as we have a notificationType for each of these scenarios (see REFUND
and REFUND_REVERSED
):
https://developer.apple.com/documentation/appstoreservernotifications/notificationtype
Note that for auto-renewable subscriptions, refunds may be granted for renewal purchases other than the current active one. For example, if the user has an active subscription for June (now) and receives a refund for their May (previous month) renewal transaction, you should not disable their access to subscription content, as they still have a paid period that's currently active. An easy way to track this scenario is with the status
field available in notifications (including refund-related notifications) and from the Get All Subscription Statuses endpoint of the App Store Server API. In the scenario I described above, the subscription associated with the refunded transaction would still have the status as Active (1).
https://developer.apple.com/documentation/appstoreservernotifications/status
https://developer.apple.com/documentation/appstoreserverapi/status
The only other scenario in which you may wish to revoke content is if you query the App Store Server API for a transaction and receive one of these errors:
https://developer.apple.com/documentation/appstoreserverapi/transactionidnotfounderror
https://developer.apple.com/documentation/appstoreserverapi/originaltransactionidnotfounderror
In this case you should follow the steps described in that documentation to ensure there isn't an issue with your request causing the error. Assuming there isn't, you may disable access to the content for that transaction.