notification_type
The type that describes the in-app purchase event for which the App Store sends the version 1 notification.
Declaration
string notification_typePossible Values
CANCELIndicates that Apple Support canceled the auto-renewable subscription and the customer received a refund as of the timestamp in
cancellation_date_ms.CONSUMPTION_REQUESTIndicates that the customer initiated a refund request for a consumable in-app purchase, and the App Store is requesting that you provide consumption data. For more information, see Send Consumption Information.
DID_CHANGE_RENEWAL_PREFIndicates that the customer made a change in their subscription plan that takes effect at the next renewal. The currently active plan isn’t affected. Check the
auto_renew_product_id fieldin unified_receipt.Pending_renewal_info to retrieve the product identifier for the product the customer’s subscription renews.DID_CHANGE_RENEWAL_STATUSIndicates a change in the subscription renewal status. In the JSON response, check
auto_renew_status_change_date_msto retrieve the date and time of the last status update. Checkauto_renew_statusto get the current renewal status.DID_FAIL_TO_RENEWIndicates a subscription that failed to renew due to a billing issue. Check
is_in_billing_retry_periodto retrieve the current retry status of the subscription. Checkgrace_period_expires_dateto get the new service expiration date if the subscription is in a billing grace period.DID_RECOVERIndicates a successful automatic renewal of an expired subscription that failed to renew in the past. Check
expires_dateto determine the next renewal date and time.DID_RENEWIndicates that a customer’s subscription has successfully auto-renewed for a new transaction period. Provide the customer with access to the subscription’s content or service.
INITIAL_BUYOccurs at the user’s initial purchase of the subscription. Store
latest_receipton your server as a token to verify the user’s subscription status at any time by validating it with the App Store.INTERACTIVE_RENEWALIndicates the customer renewed a subscription interactively, either by using your app’s interface, or on the App Store in the account’s Subscriptions settings. Make service available immediately.
PRICE_INCREASE_CONSENTIndicates that the App Store has started asking the customer to consent to your app’s auto-renewable subscription price increase that requires consent. In the unified_receipt.Pending_renewal_info object, the
price_consent_statusvalue is0to indicate that the user hasn’t yet responded to the price increase. The App Store server sets theprice_consent_statusto1when the customer consents to the price increase. Check the latest price consent status by calling the Get All Subscription Statuses endpoint in the App Store Server API. Check thepriceIncreaseStatusfield in the JWSRenewalInfoDecodedPayload. You can also call verifyReceipt to view the updated price consent status. For more information about how StoreKit calls your app before it displays the price consent sheet for subscription price increases that require customer consent, see paymentQueueShouldShowPriceConsent(_:). For more information about managing subscription prices, see Managing Prices.REFUNDIndicates that the App Store successfully refunded a transaction for a consumable in-app purchase, a non-consumable in-app purchase, or a non-renewing subscription. The
cancellation_date_mscontains the timestamp of the refunded transaction. Theoriginal_transaction_idandproduct_ididentify the original transaction and product. Thecancellation_reasoncontains the reason.REVOKEIndicates that an in-app purchase the user was entitled to through Family Sharing is no longer available through sharing. StoreKit sends this notification when a purchaser disabled Family Sharing for a product, the purchaser (or family member) left the family group, or the purchaser asked for and received a refund. Your app will also receive a paymentQueue(_:didRevokeEntitlementsForProductIdentifiers:) call. For more information about Family Sharing, see Supporting Supporting Family Sharing in your app.
RENEWAL (DEPRECATED)As of March 10, 2021 this notification is no longer sent in production and sandbox environments. Update your existing code to rely on the DID_RECOVER notification type instead.
Mentioned in
Discussion
You receive and can react to server notifications in real time for the subscription and refund events that these notification type values describe. The notification_type appears in the responseBodyV1.
Handle use cases for notification events
When events occur that affect the customer’s product and subscription life-cycle, your server receives notifications from the App Store. Here are some examples of product events and the server notifications you can expect to receive:
Subscription or in-app purchase event | Notification types |
|---|---|
Customer completed an initial purchase of a subscription |
|
Subscription is active; customer upgraded to another SKU |
|
Subscription is active; customer downgraded to another SKU |
|
Subscription has expired; customer resubscribed to the same SKU |
|
Subscription has expired; customer resubscribed to another SKU (upgrade or downgrade) |
|
Customer canceled the subscription from the App Store Subscriptions settings page. Their subscription will not auto-renew and will expire on the |
|
Customer previously canceled the subscription, but now resubscribed to same product before the subscription expired. The subscription will auto-renew on the |
|
AppleCare refunded a subscription |
|
Subscription failed to renew because of a billing issue |
|
Expired subscription recovered by App Store through a billing retry |
|
Subscription churned after failed billing retry attempts |
|
AppleCare successfully refunded the transaction for a consumable, non-consumable, or a non-renewing subscription |
|
You’ve increased the price of an auto-renewable subscription and the price increase requires customer consent before the subscription auto-renews |
|
Subscription successfully auto-renewed |
|
A purchaser disabled Family Sharing for a product, the purchaser (or family member) left the family group, or the purchaser asked for and received a refund |
|
The customer initiated a refund request for a consumable in-app purchase |
|
Receive notifications for the purchaser and family members
The following table identifies the notifications you receive for the purchaser and for their family members who share products through Family Sharing. To determine if a notification is for the purchaser or a family member, check the value of the in_app_ownership_type field, which appears in the unified_receipt.Latest_receipt_info of the responseBody object. For more information about Family Sharing, see Supporting Family Sharing in your app.
Notification type | Received for Purchaser | Received for Family Members |
|---|---|---|
| YES | NO |
| YES | N/A |
| YES | YES |
| YES | YES |
| YES | YES |
| YES | YES |
| YES | YES |
| YES | NO |
| YES | YES |
| YES | NO |
| YES | NO |
| NO | YES |
| N/A | N/A |
The CONSUMPTION_REQUEST notification applies to consumable in-app purchases, which aren’t eligible for Family Sharing.
Test notification events with sandbox
Your development-signed apps use the sandbox environment when you sign in to App Store using a Sandbox Apple Account. To create a Sandbox Apple Account or test account in App Store Connect, see Create a sandbox tester account.
If you enabled App Store Server Notifications, test your logic for transactions in the sandbox environment. To determine if a notification for a subscription event occurred in the test environment, check whether the value of the environment field in the JSON responseBodyV1 object equals Sandbox.
The following notification types are available in sandbox: INITIAL_BUY, DID_CHANGE_RENEWAL_PREF, DID_CHANGE_RENEWAL_STATUS, DID_RENEW, INTERACTIVE_RENEWAL, CANCEL, and REFUND. Notifications in the sandbox environment are for the purchaser only, and have in_app_ownership_type equal to PURCHASED. For more information about testing in-app purchases, see Testing In-App Purchases with sandbox.