How to Handle Refund Notifications?

In apple’s document: https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/handling_refund_notifications

memtion in document: Your server is responsible to parse and interpret all notifications from App Store Server. For the REFUND notification, identify the specific transaction, product ID, and relevant dates from the response:

Find the most-recent transaction for the product_id in the unified_receipt.latest_receipt_info by checking the purchase_date to select the most-recent transaction.

The date when App Store issued the refund is in the cancellation_date_ms field for this transaction.

  • My problem is that , we find that unified_receipt.latest_receipt_info is an array, It contains multiple trasactions and these t'rascations all have ”cancellation_date_ms“ field .

I would like to know if I should process all the trasactions have field ”cancellation_date_ms“ or just the latest one?

please help!!

Accepted Reply

For this reason I would recommend using the v2 Server Notifications as those notifications will only contain the transaction for the event. But typically for v1 notifications for a type of REFUND or CANCEL, it is recommended to sort transactions by cancellation_date, typically there will be a transaction with a cancellation date near when the notification was first sent.

  • Other transactions with cancellation_date should I handle? Even though these transactions not the most-recent one

Add a Comment

Replies

One place to start is to match the transaction IDs from the notification that you got against the latest receipt -- with this amount of information, it is uncertain exactly what you need to process – please also ensure the bundleId and appAdamId matches your application.

For this reason I would recommend using the v2 Server Notifications as those notifications will only contain the transaction for the event. But typically for v1 notifications for a type of REFUND or CANCEL, it is recommended to sort transactions by cancellation_date, typically there will be a transaction with a cancellation date near when the notification was first sent.

  • Other transactions with cancellation_date should I handle? Even though these transactions not the most-recent one

Add a Comment