How to get IAP country code (in order to know the VAT rate)?

In order to calculate fair prices for a service, (e.g. VoIP calling credit) bought via In App Purchases (IAP), you need to know the VAT rate that applies to the country where Apple ID is registered.


As far as I know, an app can only find the currency of the user's Apple ID, using IAP APIs.


Now, currency code is sufficient if used for only one country for App Store purchases; because then the VAT rate of that country simply applies. But in the euro zone for example, Apple applies the local/varying VAT rate for each country using the EUR.


Is there a way to get to the country code, from a receipt (on either app- or server-side) or iOS APIs?

In the Application Receipt, the in_app array contain a history of all in app purchase receipts for all purchase, except those of type "Consumable". However those receipt do not track the locale that the purchase was made from. There is the transaction_id field which could be associated with the orginal purchase information, but there is no API to use to access additional information about the transaction. You can submit an enhancement request that such API be implemented by using the Apple Developer Bug Report web page - http://bugreport.apple.com.


If this information is needed, the app can know the current locale for the purchase by reviewing the response to the SKProductsRequest - product.priceLocale. If the purchase is made and is successful, the application can associate the purchase with the priceLocale information. I think this is what you referred to in "find the currency of the user's Apple ID, using IAP APIs." Unfortunately, this information is not available for a restored purchase so it would need to be saved on a server.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

How to get IAP country code (in order to know the VAT rate)?
 
 
Q