I'm trying to use AppStore Connect API to create and configure a simple pricing for In App Purchase.
I successfully created the IAP using POST v2/inAppPurchases
Now I want to simulate setting the price based in CZK currency as base. Basically I want to replicate these actions in UI
So I followed the official AppStore Connect docs.
POST v2/inAppPurchases
. I remember the returned IAP ID.GET /v2/inAppPurchases/{id}/pricePoints
and get its ID.POST /v1/inAppPurchasePriceSchedules
, I'm following the documentation preciesly but it's not working. The response is complaining about startDate
and endDate
and some timelines but I have no idea what these fields should contain. I tried setting it to an empty values or some dates but this is not what the API is expecting.My request
{
"data": {
"type": "inAppPurchasePriceSchedules",
"relationships": {
"baseTerritory": {
"data": {
"id": "CZE",
"type": "territories"
}
},
"inAppPurchase": {
"data": {
"id": "6477355320",
"type": "inAppPurchases"
}
},
"manualPrices": {
"data": [
{
"id": "eyJzIjoiNjQ3NzM1NTMyMCIsInQiOiJDWkUiLCJwIjoiMTAwNTEifQ",
"type": "inAppPurchasePrices"
}
]
}
}
},
"included": [
{
"id": "eyJzIjoiNjQ3NzM1NTMyMCIsInQiOiJDWkUiLCJwIjoiMTAwNTEifQ",
"type": "inAppPurchasePrices",
"attributes": {
"startDate": "2024-02-04",
"endDate": "2024-02-05"
},
"relationships": {
"inAppPurchasePricePoint": {
"data": {
"id": "eyJzIjoiNjQ3NzM1NTMyMCIsInQiOiJDWkUiLCJwIjoiMTAwNTEifQ",
"type": "inAppPurchasePricePoints"
}
},
"inAppPurchaseV2": {
"data": {
"id": "6477355320",
"type": "inAppPurchases"
}
}
}
}
]
}
Response
HTTP 409
{
"errors" : [ {
"id" : "b42142d7-d656-45c6-ad3a-8a7f19ce6974",
"status" : "409",
"code" : "ENTITY_ERROR.INVALID_END_DATE",
"title" : "There is a problem with the request entity",
"detail" : "Entire timeline must be covered for CZE. Rightmost interval must not have an end date: [2024-02-04T00:00 - 2024-02-05T00:00]",
"source" : {
"pointer" : "/data/relationships/manualPrices/data/0/attributes/endDate"
}
} ]
}
Okay so that was stupid.
I simply set startDate
and endDate
to null
. Which for some reason I did not try up until now. And it works as I expected.