I'm trying to change subscription prices programmatically and found two relevant API methods:
The first method requires ID of price point that can be retrieved by the second one. The second method returns price points in the following format:
{
"type" : "appPricePoints",
"id" : "eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ",
"attributes" : {
"customerPrice" : "3.99",
"proceeds" : "2.8"
},
"relationships" : {
"equalizations" : {
"links" : {
"self" : "https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ/relationships/equalizations",
"related" : "https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ/equalizations"
}
}
},
"links" : {
"self" : "https://api.appstoreconnect.apple.com/v3/appPricePoints/eyJzIjoiMTU2MTYxMTU2OSIsInQiOiJBRkciLCJwIjoiMTAwNDkifQ"
}
}
where ID of price point is a base64-encoded JSON with three fields: s
, t
, and p
.
UPD
Thanks to @inkerdusk, I got that Price Changes are pre-created by Apple and I should use them instead of creating my own ones.
So, I tried to send the following request where use base64 itself or every of three values of JSON that is represented as this base64.
{
"data": {
"attributes": {
},
"relationships": {
"subscription": {
"data": {
"id": "subscription-id",
"type": "subscriptions"
}
},
"subscriptionPricePoint": {
"data": {
"id": <HERE_TRIED_TO_SPECIFY_BASE64_ITSELF_OR_ANY_OF_THREE_VALUES_OF_DECODED_JSON>,
"type": "subscriptionPricePoints"
}
}
},
"type": "subscriptionPrices"
}
}
But every time I get the error:
{
"errors" : [ {
"id" : "466aa984-1491-4da3-8e5d-9b26dc9e844f",
"status" : "422",
"code" : "ENTITY_UNPROCESSABLE",
"title" : "The request entity is not a valid request document object",
"detail" : "Unexpected or invalid value at 'data.relationships.subscriptionPricePoint.data.id'.",
"meta" : {
"position" : {
"row" : -1,
"column" : -1
}
}
} ]
}
How do I create a new Price Change?