This has been going on for a while now and there hasnt been any clarity from apple and the documentation is a disaster. In my case, Im trying to automate creating new apps and submitting for review through fastlane and all of sudden submission no longer works asking for the app pricing and availability. The documentation only shows the territory part and its just a read resource. There is nothing about setting the price through the api. I then began this rabbit hole of trying to get this to work, even creating my own api requests with similar paths posted on this thread. Still no luck until now and it has been a while since I started this. I'm still waiting for anyone to be able to FINALLY go around this ridiculous and poorly documented resource. For such a very simple piece of information we need, the amount of work to get it is ridiculous. Hope we get anything from apple soon.
Post
Replies
Boosts
Views
Activity
If I may add as well, this is how I get price points for $0.0 in USD and CAD, you can replace it with any currency.:
lane :get_app_price_points do |options|
require 'json'
require 'net/http'
auth_token = options[:auth_token] # Your App Store Connect API token
app_id = options[:app_id] # The app ID for which you want to list subscriptions
# Define the URL for fetching subscriptions
url = URI("https://api.appstoreconnect.apple.com/v1/apps/#{app_id}/appPricePoints?filter%5Bterritory%5D=USA,CAN&include=territory")
# Create the HTTP request
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
# Set up headers for the App Store Connect API request
headers = {
"Authorization" => "Bearer #{auth_token}",
"Content-Type" => "application/json"
}
# Prepare the GET request
request = Net::HTTP::Get.new(url, headers)
# Execute the request
response = http.request(request)
# Handle the response
if response.code == "200"
app_prices = JSON.parse(response.body)
# UI.message("Subscriptions for app #{app_id}: #{response.body}")
# Use the find method to get the free price point ID directly
free_price_point = app_prices["data"].find do |price_point|
price_point["attributes"]["customerPrice"] == "0.0"
end
free_price_point_id = free_price_point ? free_price_point["id"] : nil
UI.message("Free Price Point ID: #{free_price_point_id}")
# Return the ID of the price point with 0.0 price
free_price_point_id
else
UI.error("Failed to fetch subscriptions: #{response.body}")
end
end
Okay I have combined my solutions for FastLane on an answer here. Thank you @GrayDev