When subscribing to the change notification in the App Store, it was found that the type of notification received by the server did not match the expected problem.

Description of the Issue

We are encountering issues with App Store Server Notifications, where the notification type received does not align with our expectations for subscription changes. Specifically, we receive DID_RENEW notifications in scenarios involving downgrades or intra-tier upgrades, which disrupts our backend subscription management logic and may lead to incorrect user subscription states and billing errors. Below are two reproducible scenarios with associated transaction data.

Scenario 1: Downgrade from Premium Yearly (with 7-Day Trial) to Standard Yearly

Steps to Reproduce:

  1. A user purchases the Premium Yearly subscription with a 7-day free trial (initial transaction ID: 700002116066502).
  2. On the day before the trial ends, the user downgrades to the Standard Yearly subscription via the App Store’s subscription management interface.

Expected Behavior:

  • We expect to receive a DID_CHANGE_RENEWAL_STATUS or a similar downgrade notification (e.g., DID_CHANGE_RENEWAL_PREF) to indicate the subscription plan has been downgraded, enabling immediate updates to the user’s subscription status.

Actual Behavior:

  • Upon downgrade, our server receives a DID_RENEW notification instead of a downgrade-specific notification. This causes our system to incorrectly interpret the action as a renewal of the Premium subscription rather than a downgrade to Standard, with no subsequent downgrade confirmation received.

Relevant Transaction Data:

  • New Transaction ID: 700002122810952
  • Notification Type: DID_RENEW
  • Notification UUID: 26de9b0e-5d61-4893-b679-0bd18ae3d208
  • Original Transaction ID (Trial): 700002116066502

Scenario 2: Intra-Tier Upgrade from Standard Monthly to Standard Yearly

Steps to Reproduce:

  1. A user purchases the Standard Monthly subscription.
  2. On the day before the monthly subscription expires, the user switches to the Standard Yearly subscription via the App Store’s subscription management interface.

Expected Behavior:

  • The original Monthly subscription expires normally, with a DID_EXPIRE notification received.
  • Upon expiration, we expect a DID_RENEW or SUBSCRIBED notification for the new Yearly subscription to confirm its activation, allowing seamless transition of the user’s subscription plan.

Actual Behavior:

  • Immediately after the upgrade, our server receives a DID_RENEW notification for the new Yearly plan.
  • No further notifications are received, including no DID_EXPIRE for the original Monthly subscription. This leaves our system unable to confirm the expiration of the Monthly plan, potentially resulting in duplicate active subscriptions in our records.

Relevant Transaction Data:

  • Transaction ID: 70002902074491
  • Notification Type: DID_RENEW
  • Notification UUID: 3d35bc2f-e769-4549-bf50-d84d41b10342

Impact

These notification discrepancies disrupt our subscription lifecycle management, potentially causing incorrect user entitlements, over-billing, and a degraded user experience.

Requested Assistance

  • Please confirm the correct notification types for these scenarios as per Apple’s documentation (e.g., App Store Server Notifications V2).
  • Provide guidance on handling these edge cases, including any recent changes to notification logic.
  • If this is a backend issue, please investigate the provided transaction IDs and Notification UUIDs.

Thank you for your prompt assistance. We look forward to your response to help resolve this issue for our users.

问题描述:

我们在处理 App Store 订阅变更通知时发现,服务器接收到的通知类型与预期不符,具体表现为降级或同级升级场景下错误接收到 DID_RENEW 通知。这影响了我们后端订阅管理的逻辑,可能导致用户订阅状态和计费出现偏差。以下是两个可重现的场景及相关交易数据。

场景 1:高级年费(含 7 天试用)降级至标准年费

重现步骤:

  1. 用户购买高级年费订阅并开启 7 天免费试用(初始交易 ID:700002116066502)。
  2. 在试用期结束前一天,用户通过 App Store 的订阅管理界面降级至标准年费订阅。

预期行为:

  • 我们预期会收到 DID_CHANGE_RENEWAL_STATUS 或类似的降级通知(如 DID_CHANGE_RENEWAL_PREF),以表明订阅计划已降级,从而允许我们立即更新用户订阅状态。

实际行为:

  • 降级后,服务器立即收到 DID_RENEW 通知,而非降级相关通知。这导致系统误认为高级订阅仍在续订,而非降级为标准订阅,且后续未收到任何降级确认通知。

相关交易数据:

  • 新交易 ID:700002122810952
  • 通知类型:DID_RENEW
  • 通知 UUID:26de9b0e-5d61-4893-b679-0bd18ae3d208
  • 原始交易 ID(试用):700002116066502

场景 2:标准月费订阅升级为标准年费订阅

重现步骤:

  1. 用户购买标准月费订阅。
  2. 在月费订阅到期前一天,用户通过 App Store 的订阅管理界面切换至标准年费订阅。

预期行为:

  • 原月费订阅正常到期,预期收到 DID_EXPIRE 通知。
  • 月费到期后,预期收到新年费订阅的 DID_RENEWSUBSCRIBED 通知,以确认年费订阅开始,方便我们无缝切换用户订阅计划。

实际行为:

  • 升级后,服务器立即收到新年费订阅的 DID_RENEW 通知。
  • 后续未收到任何通知,包括原月费订阅的 DID_EXPIRE 通知。这导致我们无法确认月费订阅的到期状态,可能在记录中出现重复的活跃订阅。

相关交易数据:

  • 交易 ID:70002902074491
  • 通知类型:DID_RENEW
  • 通知 UUID:3d35bc2f-e769-4549-bf50-d84d41b10342

影响:
这些通知异常干扰了我们的订阅生命周期管理,可能导致用户权益错误、潜在的重复计费以及用户体验下降。

请求协助:

  • 请确认根据 Apple 文档(例如 App Store Server Notifications V2)在上述场景中应返回的正确通知类型。
  • 请提供处理此类边缘场景的指导,包括通知逻辑的任何最新变更。
  • 如果这是后端问题,请调查提供的交易 ID 和通知 UUID。

感谢您的及时协助,期待您的回复以帮助我们为用户解决问题。

I created a work order on http://feedbackassistant.apple.com. His ID is: FB20382115

When subscribing to the change notification in the App Store, it was found that the type of notification received by the server did not match the expected problem.
 
 
Q