When you turn a paid app to a free app with in-app purchase, you don't want your existing users to lose access to features they already paid for. To handle this, Apple provides the users' original download version. Here's how to access it with iaptic.
Whenever the app starts, make sure you validate the application receipt (the receipt which is generated by Apple when the application is downloaded). This is enabled by default in the plugin.
As soon as the first receipt validation has occurred, you can use iaptic's /v3/search
endpoint to retrieve the original download version like this:
https://validator.iaptic.com/v3/search/[application_username]
Pick the first result row with context.eventType == "receipt.validated"
and you should find the originalVersion
info in content.appDownload
.
This endpoint is authenticated like all other server API endpoints with the Authorization
header, using basic authentication with your App Name as username and Secret Key as password.
Example: Authorization: Basic ${base64(appName + ':' + secretKey)}
Note: To make the API cleaner, we plan on adding a /v3/customers/[application_username]/downloads
endpoint, stay tuned.