我正在尝试使用 AppStore Connect API 为应用内购买创建和配置简单的定价。
我使用
POST v2/inAppPurchases
成功创建了 IAP
现在我想模拟以捷克克朗货币为基础设置价格。基本上我想在 UI 中复制这些操作
所以我遵循了官方的AppStore Connect 文档。
POST v2/inAppPurchases
创建 IAP。我记得返回的 IAP ID。GET /v2/inAppPurchases/{id}/pricePoints
找到 价格点并获取其 ID。
POST /v1/inAppPurchasePriceSchedules
,我正在快速遵循文档,但它不起作用。回复是抱怨 startDate
和 endDate
以及一些时间表,但我不知道这些字段应该包含什么。我尝试将其设置为空值或某些日期,但这不是 API 所期望的。我的要求
{
"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"
}
}
}
}
]
}
回应
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"
}
} ]
}
好吧,那太愚蠢了。
我只是将
startDate
和 endDate
设置为 null
。由于某种原因我直到现在才尝试。它按我的预期工作。