App Store Server Notifications

RSS for tag

Monitor subscription events in real time with server notifications from the App Store using App Store Server Notifications.

Posts under App Store Server Notifications tag

96 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

App Store Server Notifications on TestFlight
We are implementing IAP in our React-Native app, currently only on IOS, specifically subscriptions. We have configured the Sandbox Server URL to an endpoint on our Dev server, and the Production Server URL to an endpoint on our Production server. In addition, we are using the Apple App Store Server Node.js Library on our Backend to verify receipts, getting transactions history, etc. We are using the Sandbox environment on our Dev backend, and the Production environment on our Production backend. We are not sure if that is the correct setup, although that is what we understood from multiple sources. While testing with TestFlight, with production apple accounts, we were expecting to receive the server notifications on our Production server, but they were all were received on our Development server (Sandbox endpoint). Is that the correct behavior or are we missing something? We figured the Sandbox endpoint was for testing purposes and because of that should be on our Development backend while we develop.
1
0
610
Aug ’23
Not receiving DID_RENEW/EXPIRED webhooks on sandbox
I'm trying to implement an IAP subscripton and I am not receiving DID_RENEW/EXPIRED webhook calls. Looking through previous forum posts this may just be breaking randomly, is there something currently broken or is there likely some setup I'm missing? Note: I'm using ngrok to test this locally, and I successfully get the initial subscription and DID_CHANGE_RENEWAL_STATUS events.
3
1
575
Aug ’23
Upgrades and refunds
I have found such information on documentation: Upgrade. Someone purchases a subscription that offers a higher level of service than their current subscription. They’re immediately upgraded and receive a refund of the prorated amount of their original subscription. If you’d like people to immediately access more content or features, rank the subscription higher to make it an upgrade. Also, To identify whether a subscription has been refunded, look for the cancellation_date field in the receipt. However, when looking at users that has upgraded subscriptions, where we get "is_upgraded": "true" There is no cancellation_date field, so the question is, has these users been refunded? If so, how do we calculate partial refunds without the date?
1
2
822
Aug ’23
Not Receiving Server Notifications for Auto-Renewable Notifications when in free trial phase
Hi, we have an auto-renewable subscription with an introductory offer configured. The introductory offer is a 7 days free trial. We're observing a possibly wrong behavior and we wanted to make sure we're not missing anything. We suspect that our server is not receiving notifications from the App Store when the free trial period starts, we only receive notifications when the user starts paying. To double-check, we've tested the same subscription in sandbox with a brand new test account with a 3 minutes renewal frequency: the behavior is exactly the same, we only get 1 notification every 3 minutes for the renewals, we get no notification when the free trial starts. So we have 2 main questions: does "free trial" work in sandbox too? If so, what's the duration of free trial in sandbox if it's set to 7 days in production? do we get a notification when the free trial period starts or we only get one when and if the user starts paying after 7 days? Thanks
1
0
835
Aug ’23
AppAccountToken is missing
Hello I've problem with transaction payload. If I receive POST App Store notification v2 to my server. In the decoded transaction body is missing appAccountToken field. In the iOS app I've just set token like this: let result = try await product.purchase(options: [ .appAccountToken(UUID.encodeIntAsUUID(Auth.shared.user.idUser)), .simulatesAskToBuyInSandbox(true) ]) Where is the problem?
0
0
540
Aug ’23
Question about Notification after subscription started with offer code?
Hello I want to know about App Store server notification type after subscription started with offer code, question is when someone starts a subscription with an offer code, only type OFFER_REDEEMED[subtype INITIAL_BUY] is send to server? or both type OFFER_REDEEMED[subtype INITIAL_BUY] and type SUBSCRIBED[subtype INITIAL_BUY] are send to server?
3
1
389
Aug ’23
Does CANCEL would turn off renewal?
Cause in sandbox env I notice a receipt like this { "environment": "Sandbox", "unified_receipt": { "status": 0, "environment": "Sandbox", "latest_receipt_info": [ { "quantity": "1", "product_id": "3monthplan", "expires_date": "2023-07-25 04:50:29 Etc/GMT", "purchase_date": "2023-07-25 04:41:29 Etc/GMT", "transaction_id": "2000000375156349", "expires_date_ms": "1690260629000", "is_trial_period": "false", "expires_date_pst": "2023-07-24 21:50:29 America/Los_Angeles", "purchase_date_ms": "1690260089000", "purchase_date_pst": "2023-07-24 21:41:29 America/Los_Angeles", "in_app_ownership_type": "PURCHASED", "original_purchase_date": "2023-07-25 03:20:41 Etc/GMT", "web_order_line_item_id": "2000000032603282", "original_transaction_id": "2000000375122102", "is_in_intro_offer_period": "false", "original_purchase_date_ms": "1690255241000", "original_purchase_date_pst": "2023-07-24 20:20:41 America/Los_Angeles", "subscription_group_identifier": "20572434" }, .... { "quantity": "1", "product_id": "3monthplan", "expires_date": "2023-07-25 04:03:49 Etc/GMT", "purchase_date": "2023-07-25 03:54:49 Etc/GMT", "transaction_id": "2000000375136003", "expires_date_ms": "1690257829000", "is_trial_period": "false", "expires_date_pst": "2023-07-24 21:03:49 America/Los_Angeles", "purchase_date_ms": "1690257289000", "purchase_date_pst": "2023-07-24 20:54:49 America/Los_Angeles", "in_app_ownership_type": "PURCHASED", "original_purchase_date": "2023-07-25 03:20:41 Etc/GMT", "web_order_line_item_id": "2000000032600544", "original_transaction_id": "2000000375122102", "is_in_intro_offer_period": "false", "original_purchase_date_ms": "1690255241000", "original_purchase_date_pst": "2023-07-24 20:20:41 America/Los_Angeles", "subscription_group_identifier": "20572434" }, { "quantity": "1", "product_id": "monthlyplan", "expires_date": "2023-07-25 03:38:37 Etc/GMT", "purchase_date": "2023-07-25 03:35:37 Etc/GMT", "transaction_id": "2000000375127458", "expires_date_ms": "1690256317000", "is_trial_period": "false", "expires_date_pst": "2023-07-24 20:38:37 America/Los_Angeles", "purchase_date_ms": "1690256137000", "cancellation_date": "2023-07-25 04:38:50 Etc/GMT", "purchase_date_pst": "2023-07-24 20:35:37 America/Los_Angeles", "cancellation_reason": "0", "cancellation_date_ms": "1690259930000", "cancellation_date_pst": "2023-07-24 21:38:50 America/Los_Angeles", "in_app_ownership_type": "PURCHASED", "original_purchase_date": "2023-07-25 03:20:41 Etc/GMT", "web_order_line_item_id": "2000000032600434", "original_transaction_id": "2000000375122102", "is_in_intro_offer_period": "false", "original_purchase_date_ms": "1690255241000", "original_purchase_date_pst": "2023-07-24 20:20:41 America/Los_Angeles", "subscription_group_identifier": "20572434" }, ... ] }, "auto_renew_status": "false", "cancellation_date": "2023-07-25 04:38:50 Etc/GMT", "notification_type": "CANCEL", "cancellation_date_ms": "1690259930000", "auto_renew_product_id": "3monthplan", "cancellation_date_pst": "2023-07-24 21:38:50 America/Los_Angeles", "web_order_line_item_id": "2000000032600434", "original_transaction_id": 2000000375122102 } plan is keeping renew. What if I refund in prod env, and after refund agree, is that my subscription would auto turn off?
0
0
365
Jul ’23
app store server notifications: receiving GET instead of POST
We are attempting to monitor subscription events via App Store Server Notifications. The URL we have configured (with v1 or v2) continually gets invoked with GET requests instead of POST requests, we do not get any POST with request data at all and cannot process subscription changes. Why might this be happening? What could we have misconfigured? configuration: requests:
1
0
370
Jul ’23
Subscription user renew success but backend server received event renew fail
I have been experiencing with my app's subscription renewal process. When a user successfully renews their subscription, the App Store sends an event to my backend server. However, in some cases, the backend server is receiving an event that says the renewal failed, even though the user's subscription was successfully renewed. I have been working on this bug for several days and I have not been able to find a solution. I would appreciate any help that you can provide.
3
0
602
Jul ’23
Billing Subscription Lifecycle & Payment
Based on this site https://support.apple.com/en-us/HT202039 the subscription can be cancelled & re-subscribe by user on iPhone devices. I'm asking for the payment lifecycle included with subscription status when subscription is canceled, re-subscribe, or subscription is EXPIRED. Please explain billing lifecycle to our bank account based on subscription status. Thankyou.
0
0
637
Jul ’23
Why my non-consumeable in app purchase not receive callback on my server?
My app is develop using react native and i use react-native-iap package for ios IAP. I have 1 non-consumable IAP products, and i need to receive callback from Apple Server to Our Server, but it still didn't coming yet, how i supposed to check this? I have already setup the url on Sandbox Server URL, and have already successfully send the notification test using https://api.storekit-sandbox.itunes.apple.com/inApps/v1/notifications/test the response from notification test is below: { "testNotificationToken": "19d-8f54-41cd-84cf-e9265df_16***4897" } ASAP, Thankyou
4
0
949
Jul ’23
Not receiving any App Store Server Notification in my app
I have a non-renewable subscription set up in my app and I also have App Store Server Notifications enabled, with URLs for both the production server and the sandbox server to receive version 2 notifications. I can simulate payment subscription in my app with sandbox tester, however I am not getting any notification from the app store server. Is there anything else I need to configure?
1
0
415
Jul ’23
REFUND_REVERSED notification logic and handling
Hello everyone! I have some doubts on the use cases and triggers related to the REFUND_REVERSED notification type. I would like to better understand which real customer actions example would trigger this notification to be sent. Does the developer gets back the amount refunded to the user? Quoting the documentation: If your app revoked content or services as a result of the related refund, it needs to reinstate them. This applies only to a REFUND_REVERSED associated to a REFUND of the latest possible renewal right? Since we receive REFUND_REVERSED also several weeks after the REFUND and so for long expired subscriptions. We don't have to get access again to the user in the latter case, do we? Thank you very much to whoever will take time to answer!
1
0
544
Jul ’23
Auto-renewable subscription - new flow understanding
I am trying to understand the correct flow for a mobile app/server app - auto-renewable subscriptions. Since verifyReceipt has been marked as deprecated, I am struggling with how I should link an App Store Server Notification v2 message with a user in the database. Currently, the process is as follows: First, the mobile application calls our server with receipt-data. Second, the server calls verifyReceipt to validate the receipt. Then, I am able to match the user's subscription/transaction with their data (using an internal JWT with user data from the first step and originalTransactionId from decoded verifyReceipt response). If we omit the first step, how would I determine who should receive the App Store Server Notification v2 message?
0
1
403
Jul ’23
Unauthenticated 403 error while accessing any app store server api
We followed all step given in Docs but getting authenticate error for other apple account that I am using Below is details of error my command: curl -v -H 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNCQzczUjlEV0MifQ.eyJpc3MiOiI2OWE2ZGU4ZS1iNGZhLTQ3ZTMtZTA1My01YjhjN2MxMWE0ZDEiLCJhdWQiOiJhcHBzdG9yZWNvbm5lY3QtdjEiLCJpYXQiOjE2ODc4NDIwNjA4NDksImV4cCI6MTY4Nzg0NTY2MDg0OSwiYmlkIjoiY29tLm9uZmVyZW5jZS5vbmZlcmVuY2VhcHAifQ.W8_vaEPZoinC-80bBq-g3XLkohb_FSPzGN4a4YfqJ_V1UnmBmrtz2GtBPHhlQRB1VJ7NE3n3BNAWUMJrD5AuEA' "https://api.storekit.itunes.apple.com/inApps/v1/transactions/340001235870976" Error gettings Trying 17.56.138.9... TCP_NODELAY set Connected to api.storekit.itunes.apple.com (17.56.138.9) port 443 (#0) ALPN, offering h2 ALPN, offering http/1.1 successfully set certificate verify locations: CAfile: /etc/ssl/cert.pem CApath: none TLSv1.2 (OUT), TLS handshake, Client hello (1): TLSv1.2 (IN), TLS handshake, Server hello (2): TLSv1.2 (IN), TLS handshake, Certificate (11): TLSv1.2 (IN), TLS handshake, Server key exchange (12): TLSv1.2 (IN), TLS handshake, Server finished (14): TLSv1.2 (OUT), TLS handshake, Client key exchange (16): TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1): TLSv1.2 (OUT), TLS handshake, Finished (20): TLSv1.2 (IN), TLS change cipher, Change cipher spec (1): TLSv1.2 (IN), TLS handshake, Finished (20): SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305 ALPN, server accepted to use h2 Server certificate: subject: businessCategory=Private Organization; jurisdictionCountryName=US; jurisdictionStateOrProvinceName=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; CN=commercegateway.itunes.apple.com start date: May 16 16:44:52 2023 GMT expire date: Nov 12 16:54:52 2023 GMT subjectAltName: host "api.storekit.itunes.apple.com" matched cert's "api.storekit.itunes.apple.com" issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 2 - G1 SSL certificate verify ok. Using HTTP2, server supports multi-use Connection state changed (HTTP/2 confirmed) Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 Using Stream ID: 1 (easy handle 0x7f9bed010800) GET /inApps/v1/transactions/340001235870976 HTTP/2 Host: api.storekit.itunes.apple.com User-Agent: curl/7.64.1 Accept: / Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNCQzczUjlEV0MifQ.eyJpc3MiOiI2OWE2ZGU4ZS1iNGZhLTQ3ZTMtZTA1My01YjhjN2MxMWE0ZDEiLCJhdWQiOiJhcHBzdG9yZWNvbm5lY3QtdjEiLCJpYXQiOjE2ODc4NDIwNjA4NDksImV4cCI6MTY4Nzg0NTY2MDg0OSwiYmlkIjoiY29tLm9uZmVyZW5jZS5vbmZlcmVuY2VhcHAifQ.W8_vaEPZoinC-80bBq-g3XLkohb_FSPzGN4a4YfqJ_V1UnmBmrtz2GtBPHhlQRB1VJ7NE3n3BNAWUMJrD5AuEA Connection state changed (MAX_CONCURRENT_STREAMS == 1024)! < HTTP/2 401 < server: daiquiri/3.0.0 < date: Tue, 27 Jun 2023 05:34:00 GMT < content-type: text/plain < strict-transport-security: max-age=31536000; includeSubDomains < x-apple-jingle-correlation-key: Z4AC6TLUWQRJHHYNLGGL5L2EZA < x-daiquiri-instance: daiquiri:15824002:mr85p00it-hyhk03174701:7987:23RELEASE91:daiquiri-amp-commerce-clients-ext-001-mr < Unauthenticated Request ID: Z4AC6TLUWQRJHHYNLGGL5L2EZA.0.0 Connection #0 to host api.storekit.itunes.apple.com left intact Closing connection 0
1
0
997
Jun ’23