Use server notifications from the App Store to monitor and respond to users' subscription status changes.
Server-to-server notifications are a service for auto-renewable subscriptions. The App Store sends notifications to your server of real-time changes in a subscription's status. For information on all the fields contained in these server notifications, see App Store Server Notifications.
Using the server-to-server notification service is optional but recommended, especially if you offer subscription services across multiple platforms and you need to keep the subscription records updated. After you set up your server, you can start receiving notifications at any time by adding a server URL in App Store Connect.
Use notifications along with receipt validation to validate a user's current subscription status and provide them with services or promotional offers based on that status.
Configure Your Server to Receive Notifications
To receive server notifications from the App Store:
Support App Transport Security (ATS) on your server. The App Store must establish a secure network connection with your server by using ATS protocols before sending notifications. For more information, see Preventing Insecure Network Connections.
Determine a URL on your server to use for subscription status updates.
Configure the subscription status URL for your app in App Store Connect. For guidance, see Enable status notifications for auto-renewable subscriptions.
Once you have taken these steps, your server is ready to receive server-to-server notifications.
Receive Server-to-Server Notifications
The App Store delivers JSON objects via an HTTP POST to your server for notable subscription events. Your server is responsible for parsing, interpreting, and responding to all server-to-server notification posts.
The server-to-server notification is an HTTP POST. The body of the POST contains the data elements described in responseBody. The App Store posts notifications for subscription events represented by the values of the
Respond to Server-to-Server Notifications
Your server should send an HTTP status code to indicate whether the server-to-server notification post succeeded:
200if the post was successful. Your server is not required to return a data value.
40xto have the App Store retry the notification if the post was not successful. The App Store makes several attempts to retry the notification over a period of time but eventually stops after continued failed attempts.
Process Events with Up-to-Date Information
Once you enable server-to-server notifications, you have up-to-date information on subscription status. Use the notification along with the latest receipt when you process events:
In your app, verify the latest receipt with the App Store. See Validating Receipts with the App Store for more information.
Validate the user's current subscription status by cross-referencing the latest receipt with the latest server-to-server notification using the