Search code examples
iosapp-storeapp-store-connect

App Store Server Notifications: How to get a price of a transaction?


I want to create statistics based on the price a subscription was purchased with or renewed with. I don't see such field anywhere in the App Store Server Notifications api.

Can somebody advise on what to do?


Solution

  • You are not able to get the price of a transaction with App Store Server Notifications or via the the JSON data returned in the response from the App Store.

    What you can do is get the ID of the transaction and look for it in the Sales & Trends dashboard. The easiest way to create statistics for your app is likely to have a separate database that stores transactions sent via your application through custom POST methods. What you're trying to do is not what the App Store Server Notifications API was built for, so you will run into problems. Specifically, their documentation says "Use the data in the notifications to update your user-account database, and to monitor and respond to in-app purchase refunds." Thus; this API was built for sales and customer support, not statistics and trends.