App Store Server API

RSS for tag

Call this REST API from your server to request and provide information about your customers' in-app purchases.

Posts under App Store Server API tag

90 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Delayed App Store Server Notification(V2) for Subscription Purchase
We experienced an issue with delayed App Store Server notifications for an Auto-Renewable Subscription purchase in our app. On September 27, 2024, at 22:28:28 GMT+0900, a user successfully purchased a Premium membership subscription (transaction ID: 190002223966278, webOrderLineItemId: 190001007274949). However, our server did not receive the corresponding App Store notification for this transaction after purchase. The App Store Server Notification was only received 66 minutes later, at 23:35:16 (transaction ID: 190002224000004, webOrderLineItemId: 190001007274949). The delayed notification contained a different transaction ID than the initial purchase. We would like to inquire about the cause of this delay and request assistance in understanding why the notification took 66 minutes to be delivered to our server, instead of arriving immediately after the transaction was completed. Additionally, we would appreciate your guidance on how to prevent or mitigate such delays in the future, ensuring a seamless experience for our users. Are there any best practices or recommended approaches we should implement to handle potential notification delays more effectively? We have provided detailed information about the received notification and the related transactions in the Feedback Assistant (FB15330451). Thank you for your assistance in resolving this matter. Key Details Purchase time: 2024-09-27T22:28:28 GMT+0900 (1727443708000) Notification received: 2024-09-27T23:35:16 GMT+0900 (1727447716463) Delay: 66 minutes and 48 seconds Initial Purchase Transaction ID: 190002223966278 Initial Purchase Web Order Line Item ID: 190001007274949 Transaction ID in Delayed Notification: 190002224000004 Web Order Line Item ID in Delayed Notification: 190001007274949 Additional info Bundle ID: com.reppley.ReppleyApp SKU: com.reppley.ReppleyApp Feedback Assistant Number: FB15330451
1
0
120
1d
OrderLookupResponse of Look Up Order ID API
In what cases does the transaction in the 'signedTransactions' property array respond with more than one transaction? Is it the case that the in-app purchase product type is 'Auto-Renewable Subscription'? https://developer.apple.com/documentation/appstoreserverapi/look_up_order_id https://developer.apple.com/documentation/appstoreserverapi/orderlookupresponse
1
0
195
3w
Use of the App Store Server API in a production environment.
When submitting an app, reviewers are aware that they are using the In App Purchase in Sandbox environment. Therefore, we recognize that when processing an app to run the App Store Server API from the app, the production App Store Server API must be run, and if it is a failure, the Snadbox API must be run. As follows. https://developer.apple.com/documentation/appstoreserverapi#3820693 This would result in two http communications, so is there any more efficient way to do this?
1
0
225
Aug ’24
Invalid product ID when attempting mass extend subscription API
Hi there, I'm having trouble using this API: https://developer.apple.com/documentation/appstoreserverapi/extend_subscription_renewal_dates_for_all_active_subscribers It is returning a 400 response for all product IDs for my app's subscriptions: (400, 4000023, 'Invalid request. The product id parameter is invalid.') I have verified these productIds in the App Store Server UI, and using the App Store Connect API to retrieve the product IDs for all subscriptions in the subscription group. Any tips would be greatly appreciated!
6
0
375
Aug ’24
Did Not Receive Callback for Subscription Item (In-App Purchase)
My team recently implemented In-App Purchases for Non-Renewing Subscriptions and is currently testing in production. We successfully made a purchase from our app but did not receive any callback from the App Store server. Additionally, the transaction is not visible on the App Store Connect dashboard. I understand it might take a day for transactions to appear there. When we checked the transaction status via API, the "inAppOwnershipType" is "PURCHASED" and the values for other fields are as expected, except for "price." The price should be 599000, and the charged payment on the credit card is also 599000, but it appears as 599000000 in the transaction data. Any idea what could be causing this discrepancy, and is it the reason for the unsent callback? How can we fix it? Thank you.
2
1
396
Aug ’24
Error 21002 - Validating Receipts Server-Side
Hi! I am creating a plugin that implements the In App Purchases and Subscriptions. I have done everything already and the only error I am debugging right now is with the validation of receipts. I always get status 21002 even the format is base64 already. I prefer to use the verifyReceipt as it is intended for my plugin. I have tried everything but still the response I get is status 21002 which is I know the data in receipt-data is malformed or missing. What can I do about this? Thank you so much in advance! This is my code too: (Objective-C) NSString *receiptString = [receiptData base64EncodedStringWithOptions:2]; if (!receiptString) { [self post_receipt_validation_result:@{@"status": @"error", @"message": @"Failed to encode receipt data"}]; return; } NSLog(@"Requesting to Sandbox: %@", receiptString); NSURL *storeURL = [NSURL URLWithString:@"https://api.storekit-sandbox.itunes.apple.com/verifyReceipt"]; NSMutableURLRequest *storeRequest = [NSMutableURLRequest requestWithURL:storeURL]; [storeRequest setHTTPMethod:@"POST"]; [storeRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; NSDictionary *requestContents = @{@"receipt-data": receiptString}; NSError *jsonError; NSData *requestData = [NSJSONSerialization dataWithJSONObject:requestContents options:0 error:&jsonError]; if (jsonError) { [self post_receipt_validation_result:@{@"status": @"error", @"message": jsonError.localizedDescription}]; return; } NSLog(@"Request Data: %@", requestData); [storeRequest setHTTPBody:requestData]; NSLog(@"Store Request: %@", storeRequest);
2
0
379
Aug ’24
Please explain the Get Transaction History API
There are several auto-renewable subscriptions with the same 'webOrderLineItemId' value. (The 'originalTransactionId' value is the same and 'transactionId' is different.) If you look up the History API based on 'originalTransactionId', you can see that only one auto-renewable subscription with the same 'webOrderLineItemId' value is viewed. What is the criteria for looking up? I searched History API based on 'originalTransactionId' value. However, auto-renewable subscriptions that do not match 'originalTransactionId' are also being viewed in response. What is the reason? https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history
0
0
253
Jul ’24
Please explain about ConsumptionRequest Properties
platform: Please let me know which platform 'Non-Apple platform' is referring to. For example, Google or Amazon? And is it correct to mean the platform that consumed the products received due to in-app purchases? playTime: Does 'playTime' mean the time when the customer purchased the app and actually accessed the app? Or do you mean the time you accessed after the in-app purchase? lifetimeDollarsPurchased/lifetimeDollarsRefunded: If the app has multiple accounts for that customer, is the purchased/refunded amount for all accounts?
0
0
270
Jul ’24
Questions about ConsumptionRequest properties
Hello. platform: Please let me know which platform 'Non-Apple platform' is referring to. For example, Google or Amazon? And is it correct to mean the platform that consumed the products received due to in-app purchases? playTime: Does 'playTime' mean the time when the customer purchased the app and actually accessed the app? Or do you mean the time you accessed after the in-app purchase?
1
0
331
Jul ’24
How the app behaves when an AccountNotFoundError is returned by the App Store Server API.
We are currently implementing in-app purchases with auto-renewing subscriptions. If an AccountNotFoundError is returned from the App Store Server API, is it correct for the app to stop the service offered with that subscription? The documentation does not go into detail, so I am just checking to be sure. https://developer.apple.com/documentation/appstoreserverapi/accountnotfounderror
0
0
266
Jul ’24
Transactions with the same webOrderLineItemId value but different transactionId
Hello I called the 'Get Transaction Info' API with Auto-Renewable Subscription product type transactionId. I received a success response and called the 'Get Transaction History' API with the value 'originalTransactionId'. The response 'transaction' of the 'Get Transaction History' API that matches the 'webOrderLineItemId' value received through the 'Get Transaction Info' API was found, but the 'transactionId' value was different. Why is this happening? Which of the two transactions is normal? https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history
0
0
273
Jul ’24
Can I change the availability of the auto-renewal subscription item using the API?
In my application, I have to create and remove many auto-renewal subscription items programmatically using an API. Like the YouTube app, when a user creates a channel, I will create a subscription item with their name, and when they shut down the channel, I will cancel the whole subscription and remove the item. I found that I can create subscription items using the following API: https://developer.apple.com/documentation/appstoreconnectapi/create_an_auto-renewable_subscription In the following document, I found that I can stop selling and cancel subscriptions at https://appstoreconnect.apple.com by changing the availability of item from "Cleared for Sale" to "Remove from Sale": https://developer.apple.com/help/app-store-connect/manage-subscriptions/set-availability-for-an-auto-renewable-subscription My question is can I stop selling and cancel subscriptions using an API? The App Store Connect API offers modifying subscription availability, but it only offers changing sales countries: https://developer.apple.com/documentation/appstoreconnectapi/modify_an_auto-renewable_subscription They also offer a subscription deletion API, but I'm not sure if it'll work as I need: https://developer.apple.com/documentation/appstoreconnectapi/delete_a_subscription How do you manage auto-renewal subscription items when you stop selling them? Is there any API or do you do it manually? Thank you.
0
0
309
Jul ’24