'how to get price of an in app purchase item on my server using product id
I have a receipt verification server. iOS application sends me the receipt, I validate the receipt using Apple's api, and I return a json with the required fields for the app. In the process if the user's subscription is started, I want to log that subscription with the price of the product. However I do not have the information for the price in the receipt. I just have product id. Is there an API for me to just ask Apple for the price of a given product id?
Thanks in advance
Solution 1:[1]
If you have access to AppStoreConnect for your application, you can use the AppStoreConnect API to drill down to prices for product IDs, it requires you to set up a shared secret to make use of the API:
https://developer.apple.com/documentation/appstoreconnectapi
Solution 2:[2]
I am facing the same problem. AppStore api does not provide prices for products or not even provide prices for Tiers.
But you can get the price of the products from your client end. So on the client-side, when a purchase is successful, post the product's price and transactionId. This way you can match the transactionId and know the price of that sale. But you have to be aware of the price differences. SKProduct only gives you localized price, so your obtained info from client will be localized. You have to convert them to the same currency to have a meaningful result.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kendall Helmstetter Gelner |
| Solution 2 | ouflak |
