BASE_TERRITORY="USA"
app_id = "*******" # your app id
app_price_points_id = "eyJzIjoiNjc1MTMwOTAyNiIsInQiOiJVU0EiLCJwIjoiMTAwMTEifQ" # query and get
manual_price_id = "manualPrice-0"
update_app_price_url = "https://api.appstoreconnect.apple.com/v1/appPriceSchedules"
update_app_price_payload = {
"data": {
"type": "appPriceSchedules",
"relationships": {
"app": {
"data": {"type": "apps", "id": app_id}
},
"baseTerritory": {
"data": {"type": "territories", "id": BASE_TERRITORY}
},
"manualPrices": {
"data": [{"id": manual_price_id, "type": "appPrices"}]
}
}
},
"included": [
{
"type": "appPrices",
"id": manual_price_id,
"attributes": {"startDate": None},
"relationships": {
"appPricePoint": {
"data": {"type": "appPricePoints", "id": app_price_points_id}
}
}
}
]
}
update_app_price_resp = requests.post(update_app_price_url, headers=headers, data=json.dumps(update_app_price_payload))
if update_app_price_resp.status_code == 201:
update_app_price_id = update_app_price_resp.json()["data"]["id"]
print(f"✅ Success : {update_app_price_id}")
else:
print(f"❌ Failed : {update_app_price_resp.status_code} {update_app_price_resp.text}")
sys.exit(1)
There was no problem a week ago, but now it reports an error
❌ Failed : 409 {
"errors" : [ {
"id" : "69a6e006-b99c-4d58-880c-0225c1eff581",
"status" : "409",
"code" : "ENTITY_ERROR.INCLUDED.INVALID_ID",
"title" : "The provided entity id is invalid",
"detail" : "The provided included entity id 'USA-1.0' has invalid format",
"source" : {
"pointer" : "/included/0/id"
}
} ]
}