JA
header image

枝折 - bookmark

Summary of notificationType in AppStoreServerNotification V2

AppStore

CREATED: 2024 / 01 / 29 Mon

UPDATED: 2024 / 01 / 29 Mon

Summary of notificationType in AppStoreServerNotification V2

Switching from AppStoreServerNotification V1 to V2

Our app supports in-app points (consumable purchases) and subscriptions (auto-renewable), so we handle refunds for consumables and renewal, cancellation, and refund events for subscriptions via AppStore server notifications.

V1 is deprecated, and V2 provides richer fields that simplify server-side processing, so I recently researched the migration.

Here’s a summary of the notificationTypes I compiled. The official documentation is in English:

In V2, the combination of notificationType and subtype gives you the full picture of an event.

For example, the DID_CHANGE_RENEWAL_PREF notificationType includes either an UPGRADE or DOWNGRADE subtype, indicating that an auto-renewable subscription plan was changed — upgraded or downgraded.

CONSUMPTION_REQUEST

CONSUMPTION_REQUEST is sent when Apple requests information to expedite a refund for a consumable purchase. If you call the AppStoreServerAPI within 12 hours of this notification to provide information about the purchase being refunded, the refund is processed faster than usual.

If refund speed isn’t a concern, this notification can generally be ignored.

DID_CHANGE_RENEWAL_PREF

This was an important notification type for our app. It is sent when a plan change such as an upgrade or downgrade occurs.

When notificationType is DID_CHANGE_RENEWAL_PREF, the subtype contains either UPGRADE or DOWNGRADE. As the names suggest, UPGRADE means the subscription was upgraded, and DOWNGRADE means it was downgraded.

There is also a pattern where no subtype exists. This is sent when a user downgraded but then reversed the downgrade before the current period expires.

In iOS in-app purchases, upgrades take effect immediately, but downgrades are held until the current period expires. So a downgrade can be cancelled before it takes effect.

DID_CHANGE_RENEWAL_STATUS

DID_CHANGE_RENEWAL_STATUS notifies changes in the subscription’s auto-renewal state. It can be used to determine whether the subscription will renew at the next expiration date.

This event has either AUTO_RENEW_ENABLED or AUTO_RENEW_DISABLED as its subtype. AUTO_RENEW_ENABLED indicates that auto-renewal has been enabled — sent when it was previously disabled and then re-enabled. AUTO_RENEW_DISABLED is the opposite.

AUTO_RENEW_DISABLED is also sent when AppStore disables auto-renewal after a user requests a refund on their subscription.

DID_FAIL_TO_RENEW

DID_FAIL_TO_RENEW is sent when a subscription fails to renew due to a billing issue.

The subscription then enters a 60-day billing retry period. If billing succeeds during this period, the subscription resumes from that date. That said, whether to continue providing app features during the retry period is up to the service provider. Our app continues to provide the service during the retry period, and stops only when retries have completely failed and the subscription is cancelled.

The subtype for this notification is either GRACE_PERIOD or absent. GRACE_PERIOD indicates that a grace period has been configured for the subscription. Grace periods can be set from the subscription section of your app in AppStore Connect.

Grace period setting

This is useful for specs where you provide service during GRACE_PERIOD but stop after it expires. The following documentation covers billing retry periods and grace periods:

If no grace period is configured, the subtype will be absent.

DID_RENEW

DID_RENEW notifies that a subscription has successfully renewed. When the subtype is BILLING_RECOVERY, it indicates that a previously expired subscription that failed to renew has now successfully renewed. If no subtype is present, the renewal was uneventful.

EXPIRED

EXPIRED is also an important notification type for service integration. As the name suggests, it notifies that a subscription has expired.

The subtype can be VOLUNTARY, BILLING_RETRY, PRICE_INCREASE, or PRODUCT_NOT_FOR_SALE. VOLUNTARY means the subscription expired due to voluntary cancellation. Upon receiving this notification, you typically need to deactivate features for the user on the service side. BILLING_RETRY means the subscription expired because the 60-day billing retry period was exceeded.

PRICE_INCREASE is sent when the subscription expires because the user did not consent to a price increase. A price increase for iOS in-app purchases requires user consent, so this notification is sent when that consent is not obtained. Note that price decreases do not require consent and automatically take effect at the next renewal.

GRACE_PERIOD_EXPIRED

GRACE_PERIOD_EXPIRED notifies that the grace period has ended. Since grace periods are configurable in AppStore Connect, this notification tells you when the configured period has passed. For apps that restrict service after the billing retry period, you can use this notification to limit membership privileges.

OFFER_REDEEMED

OFFER_REDEEMED wasn’t very relevant for our app, but it relates to promotional offers. It is sent when a configured offer in the app is redeemed.

When the subtype is INITIAL_BUY, the user redeemed an offer during their first purchase. RESUBSCRIBE means they resubscribed to a disabled subscription using an offer. UPGRADE and DOWNGRADE subtypes also exist, indicating those respective actions were taken while redeeming an offer. If an offer is used during a normal renewal (not initial purchase, resubscription, upgrade, or downgrade), the subtype is OFFER_REDEEMED.

PRICE_INCREASE

PRICE_INCREASE is sent when a price increase for an auto-renewable subscription takes effect. Price increases require user consent. If the subtype is PENDING, the user has not yet consented. When the user accepts the new price, the subtype becomes ACCEPTED. If user consent is not required (e.g., a price decrease), it automatically becomes ACCEPTED.

REFUND

REFUND notifies that a refund has been processed for a user. The notification payload includes revocationDate with the refund date and revocationReason with the reason.

REFUND_DECLINED

REFUND_DECLINED is sent when a refund request made through the following app methods is rejected:

beginRefundRequest(for:in:)
beginRefundRequest(in:)
beginRefundRequest(for:in:)
beginRefundRequest(in:)
refundRequestSheet(for:isPresented:onDismiss:)

In our case, refund requests are handled individually, so this notification wasn’t very relevant.

REFUND_REVERSED

REFUND_REVERSED is sent when AppStore reverses a previously approved refund due to a user dispute. If you already received a REFUND notification and deactivated the service, you may need to restore it. This will probably be rare, and handling such cases individually as they arise should be fine.

RENEWAL_EXTENDED

RENEWAL_EXTENDED notifies that the renewal date for a specific subscription has been extended. This can happen when a service experiences an outage (e.g., due to a data center power failure), as compensation.

Extension requests can be made via the following AppStore Server APIs:

RENEWAL_EXTENSION

This notification indicates that AppStore is processing subscription renewal date extensions (presumably processing active subscribers one by one). The result is in the subtype. SUMMARY means all target subscribers have been processed. FAILURE means the extension failed for a specific subscription.

This wasn’t relevant for us so I haven’t tested it, but I wonder if FAILURE provides a list of failed subscriptions.

REVOKE

This also wasn’t very relevant for us, but this notification indicates that in-app purchase content previously accessible through Family Sharing is no longer available. It’s sent when the purchaser disables Family Sharing, leaves the family group, or receives a refund.

SUBSCRIBED

SUBSCRIBED is sent when a user subscribes to content. When the subtype is INITIAL_BUY, it indicates the user’s first purchase. When the subtype is RESUBSCRIBE, it means the user repurchased the same or a different subscription within the same subscription group.

This is an important notification for apps with auto-renewable subscriptions. You could use it to grant a first-time bonus on initial signup or a welcome-back gift on resubscription.

TEST

This notification is sent from AppStore when you call the following AppStore Server API endpoint:

Calling this endpoint lets you verify that notifications from AppStore are being delivered correctly to your hosted server.

Appendix