App Store Server Notifications Pass-Through Custom Variables

I have implemented in-App purchases and "App Store Server Notifications" on my app and received the following response on my endpoint.


However, is there a custom pass-through parameter that I can receive with my notifications/successful purchases.

For instance, I want to pass the userId when the user makes a payment so I know which user is associated with each payment.

In short, is there a parameter that I can customize to pass information for iOS payments?
No, I don't think its possible. ( I understand that you want to automatically detect which user did INITIAL_BUY)

Any one found solution for this? We are also facing same problem, how we can detect which user made the payment

@KPsingh, you can read my answers in thread

https://developer.apple.com/forums/thread/681607

A summary:

In our case, when the user makes a purchase in the app, we send the userID, and the original_transaction_id, the purchased product to a URL in our backend server, and register that information in the database (using the original transaction_id as the database primary key).

When we receive notifications, using the auto_renew_product_id and the unified_receipt.pending_renewal_info we get the original_transaction_id afected in the notification. That original_transaction_id will be used to query the database, and get the userID related to that purchase.

Im trying to implement the back-end server part to receive in-app purchase notifications from the Apple App Store, but I'm not sure how to do it. My server is written with ASP.NET and my method signature looks like this (as a test):

[Route("api/AppStore/Apple")] public IHttpActionResult Apple(string data) { System.IO.File.WriteAllText("c:\\test\\apple.txt", data); // var appleRealTimeDeveloperNotification = JsonConvert.DeserializeObject<AppleRealTimeDeveloperNotification>(data); return Ok(); }

And I wired up my endpoint in the Apple App store for my app to point to this, but nothing seems to come through. My server is running TLS 1.2 and https...

Any help would be appreciated!

You can pass appAccountToken in the purchase options (1). That should be included when the server receives the transaction (2).

  1. https://developer.apple.com/documentation/storekit/product/3791971-purchase
  2. https://developer.apple.com/documentation/appstoreservernotifications/appaccounttoken

Any update on it?

I wrote quite similar endpoint using C#

` [HttpPost] [Route("apple-notification")] public async Task ProcessAppleNotification() { using var streamReader = new StreamReader(Request.Body); var content = await streamReader.ReadToEndAsync(); _logger.LogDebug($"Got request from Apple: {content}");

return Json(new { requestBody = content }); }`

And telemetry is showing me that there is no requests from AppStore has been even received

App Store Server Notifications Pass-Through Custom Variables
 
 
Q