How to validate App Store receipts and check subscription status from my server?

Hello,

I have an app on the App Store that offers in-app purchases (consumable, non-consumable) and auto-renewable subscriptions.

My goal is to verify the validity of purchase receipts on my own backend server, to prevent fraudulent transactions.

My questions:

Does Apple provide an API that allows my server to validate a receipt (the one generated after a purchase) and confirm whether it is genuine?

For auto-renewable subscriptions, can I retrieve renewal dates, expiration dates, and current renewal status using that same API?

From reading the documentation, I understand that Apple provides the App Store Server API and the App Store Server Notifications. Is this the correct approach for receipt validation and subscription status checking?

Any clarification or code example would be greatly appreciated. Thank you.

Answered by App Store Commerce Engineer in 886853022

Hello! You are definitely heading in the right direction. The best way to validate the in-app purchases you mentioned is through the App Store Server API and App Store Server Notifications.

To learn more about how to implement this, I recommend reviewing the following documentation and WWDC sessions:

Documentation

WWDC Sessions

Additionally, be sure to check out the App Store Server Library. Available in Swift, Java, Python, and Node, these open-source libraries significantly simplify server integration. You can also find practical use cases in their respective repositories:

Hello! You are definitely heading in the right direction. The best way to validate the in-app purchases you mentioned is through the App Store Server API and App Store Server Notifications.

To learn more about how to implement this, I recommend reviewing the following documentation and WWDC sessions:

Documentation

WWDC Sessions

Additionally, be sure to check out the App Store Server Library. Available in Swift, Java, Python, and Node, these open-source libraries significantly simplify server integration. You can also find practical use cases in their respective repositories:

How to validate App Store receipts and check subscription status from my server?
 
 
Q