I'm trying to figure out how to fetch the price schedules for my in-app purchases using the app store connect API: https://developer.apple.com/documentation/appstoreconnectapi/read_the_price_schedule_for_an_in-app_purchase
Using the api endpoints in the docs, I can get a list of all schedules (for every in app purchase in the whole app), as well as a list of all price points – but there doesn't seem to be a way to associate them with the specific in app purchase, or to figure out which schedule is associated with which price tier.
Here's the endpoints I'm using, ad examples of the responses I'm getting: (in this data {id} is the id of the specific in app purchase, and {product_id} is the product id that was used to create it)
v1/apps/{settings.ITUNES_APPLE_ID}/inAppPurchasesV2
with the parameters
{
'filter[productId]': {{product_id}},
'fields[inAppPurchasePriceSchedules]': 'inAppPurchase'
}
gets a response that looks like this:
{
"data": [
{
"type": "inAppPurchases",
"id": "xxxx",
"attributes": {
"name": "***",
"productId": "xxxx",
"inAppPurchaseType": "NON_CONSUMABLE",
"state": "APPROVED",
"reviewNote": null,
"familySharable": false,
"contentHosting": false,
"availableInAllTerritories": true
},
"relationships": {
"pricePoints": {
"links": {
"self": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/relationships/pricePoints",
"related": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/pricePoints"
}
},
"content": {
"links": {
"self": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/relationships/content",
"related": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/content"
}
},
"iapPriceSchedule": {
"links": {
"self": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/relationships/iapPriceSchedule",
"related": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/iapPriceSchedule"
}
}
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}"
}
}
],
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/apps/{id}/inAppPurchasesV2?filter%5BproductId%5D={product_id}&fields%5BinAppPurchasePriceSchedules%5D=inAppPurchase"
},
"meta": {
"paging": {
"total": 1,
"limit": 50
}
}
}
fetching the iap from https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}
gets a very similar response
Fetching the price schedules from https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/iapPriceSchedule
gets something like this:
{
"data": {
"type": "inAppPurchasePriceSchedules",
"id": {id},
"relationships": {
"manualPrices": {
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/{id}/relationships/manualPrices",
"related": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/{id}/manualPrices"
}
}
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/{id}"
}
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/iapPriceSchedule"
}
}
getting the manual prices from https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/{id}/manualPrices
returns something like this:
{
"data": [
{
"type": "inAppPurchasePrices",
"id": "eyJpIjoiMTM0Njg1ODA5NSIsImQiOjE3NTcwLCJjIjoiVFVSIn0",
"attributes": {
"startDate": "2018-02-08"
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePrices/eyJpIjoiMTM0Njg1ODA5NSIsImQiOjE3NTcwLCJjIjoiVFVSIn0"
}
},
{
"type": "inAppPurchasePrices",
"id": "eyJpIjoiMTM0Njg1ODA5NSIsImQiOjE3NTcwLCJjIjoiTEJZIn0",
"attributes": {
"startDate": "2018-02-08"
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePrices/eyJpIjoiMTM0Njg1ODA5NSIsImQiOjE3NTcwLCJjIjoiTEJZIn0"
}
},
... 48 more
],
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/{id}/manualPrices",
"next": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/{id}/manualPrices?cursor=Mg.QxIT0w&limit=50"
},
"meta": {
"paging": {
"total": 8575,
"limit": 50
}
}
}
fetching the price points from https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/pricePoints
returns something like this:
{
"data": [
{
"type": "inAppPurchasePricePoints",
"id": "MTM0Njg1ODA5NV9id18w",
"attributes": {
"customerPrice": "0.0",
"proceeds": "0.0",
"priceTier": "0"
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePricePoints/MTM0Njg1ODA5NV9id18w"
}
},
{
"type": "inAppPurchasePricePoints",
"id": "MTM0Njg1ODA5NV9kbV8w",
"attributes": {
"customerPrice": "0.0",
"proceeds": "0.0",
"priceTier": "0"
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePricePoints/MTM0Njg1ODA5NV9kbV8w"
}
},
... 48 more
],
"links": {
"self": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/1346858095/pricePoints",
"next": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/1346858095/pricePoints?cursor=Mg.NkAOYA&limit=50"
},
"meta": {
"paging": {
"total": 16625,
"limit": 50
}
}
}
GET
ing the individual links for inAppPurchasePrices
and inAppPurchasePricePoints
nets me a 403
I can't for the life of me figure out how to stitch these together into something useful. Is there something I'm missing here? It should be possible to get this info from this api, right?
We've been using the old xml uploader up to now, but got an email that it's going to be EOL'd in November.