App Store Pricing Matrix
A simple module that holds currencies and prices from the Apple's iOS App Store.
Install
gem install app_store_pricing_matrix
Usage
price = AppStorePricingMatrix.find_by(tier: 1, country: 'US')
price.country
price.country_code
price.currency_symbol
price.currency_code
price.wholesale_price
price.retail_price
price.formatted_retail_price
price.formatted_wholesale_price
AppStorePricingMatrix.stems
AppStorePricingMatrix.countries
AppStorePricingMatrix.currencies
Updating the price
The pricing matrix JSON is taken from Apple's hidden API at the following URL.
https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/#{AppStoreID}/pricing/matrix
The URL is accessible when you are logged in to iTunes Connect with your browser.
When you need to update the pricing matrix,
- Login to iTunes Connect with your developer account.
- Run
rake aspm:open
and enter any App Store ID that you own. - Your default browser will launch and load the JSON. Copy the entire content and paste into
input/pricing_matrix.json
. - Run
rake
to check if anything is broken. - Send a pull request with updated
input/pricing_matrix.json
.
Changelog
v3.0.0 (May 2, 2016)
- Complete overhaul. Now we use the JSON data fetched from Apple's hidden API.
v2.1.0 (October 26, 2012)
- Based on v14.
- Added RUB, TRY, INR, IDR, ILS, ZAR, SAR and AED
v2.0.0 (July 18, 2012)
- Based on v13.
- Added SGD, HKD and TWD.
CURRENCY_MAP
and REVERSE_CURRENCY_MAP
are removed. They are all self-referential now.CUSTOMER_CURRENCIES
and DEVELOPER_CURRENCIES
are removed. Use CURRENCIES
instead.