Post

Replies

Boosts

Views

Activity

Reply to Bug: App Store Connect API no longer permits updating app prices
This turned out to be my fault. I was trying to post like this: { "data": { "type": "apps", "id": XXXXXXXXX, "relationships": { "prices": { "data": [ { "type": "appPrices", "id": "${price1}" } ] } } }, "included": [ { "type": "appPrices", "id": "${price1}", "attributes": { "startDate": null }, "relationships": { "priceTier": { "data": { "type": "priceTiers", "id": "2" } } } } ] } My mistake? The type of the priceTier object isn't priceTiers, it's appPriceTiers. 😭 I wish the API had given me a clearer error message for this, but at least Apple responded to my FB report and told me how to fix my code.
Jan ’23
Reply to How to use iapPriceSchedule?
This API is VERY confusing, but it's not entirely broken. First, you might want to review this WWDC video from 2020, which explains how app prices work. https://developer.apple.com/videos/play/wwdc2020/10004/ Note that a "price point" is a mapping from price tiers (there are 95 of those) to territories (175 of those), and defines the localized price for that tier in that territory. Thus there are 95 x 175 = 16,625 price points as I write this comment. Unfortunately, the IAP price API works very differently from the API for full-app prices documented at WWDC 2020. 😖 The big difference is that the /v1/apps/:appId/prices endpoint allows you to ?include=priceTier to see the tier of the price. IAP prices don't do that; inAppPurchasePriceSchedules links directly to inAppPurchasePrices, each of which only includes a start date and a relationship to its price point. Therefore, you're gonna see 175 inAppPurchasePrices for each entry in the price schedule! Worse, the API doesn't actually show the territory for a price point unless you explicitly request to include it, so the API results initially look like nonsense. For example, the following request will simply return all 16,625 possible available price points. https://api.appstoreconnect.apple.com/v2/inAppPurchases/:iapId/pricePoints But worse, most of the points in data look indistinguishable, because the price points don't mention their territory. This request is actually understandable: https://api.appstoreconnect.apple.com/v2/inAppPurchases/:iapId/pricePoints?include=territory When you do that, you'll be able to see the territory associated with each price point. OK, so, how do you get the schedule for just one IAP? That's documented here: https://developer.apple.com/documentation/appstoreconnectapi/read_price_information_for_an_in-app_purchase_price_schedule (You did manage to find that on your own!) You're meant to read the "manual prices" for using the IAP's Apple ID. But to get a useful view of the "manual prices" price schedule, you'll have to include the price points and the territory on every request. https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/:iapId/manualPrices?include=inAppPurchasePricePoint,territory That will include all price points for all territories for all time for that IAP. For my IAP, which had changed prices only once, the API wanted to return me 525 inAppPurchasePrices objects, each of which linked to 350 inAppPurchasePricePoints for 175 territories. (Without include=inAppPurchasePricePoint, you only see the start dates repeated 175 times per calendar entry, and without include=territory, you can't see which price point is which!) But who needs 175 price points per schedule entry?! You almost certainly just wanted the price tier for each price schedule entry. So, instead, try filtering by a single territory, USA (and now we can skip including territory because we know they're all the same territory): https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/:iapId/manualPrices?include=inAppPurchasePricePoint&filter[territory]=USA For me, that returned just three inAppPurchasePrices objects, one with startDate: null (which, as the WWDC video explains, is the current, actual price) and two with real start dates. In included, I see two associated price points, including a customerPrice in USA dollars and a priceTier. (The current (null) price and the latest entry on the schedule point to the same price point.) Annoyingly, Apple provides no way to pass a filter argument for startDate=null, so if you want the current latest price, you'll just have to filter out the inAppPurchasePrices with non-null start dates yourself on the client side. I hope this helps! (It took me all day to figure it out.)
Jul ’22