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

89 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to Update App Store Metadata via App Store Connect API Using Postman
I need help updating the description, keywords, what's new, and promotional text for my app on the App Store using the App Store Connect API through Postman. I already have my access token. I need to update the data for each language, I changed to PATCH, but what is the url to patch? And what json should I send?
0
0
56
1d
Server Side validation for In-App Purchase
Hi, Our application offers 3 non-renewing subscriptions. I have integrated the necessary code, and our App Store Account Paid Agreement status is Active. Transactions are successfully completed in the sandbox environment. However, I am facing difficulties with server-side validation. The /verifyReceipt API is deprecated, and I need an alternative method for server-side validation. The Apple documentation is quite confusing, and I couldn't find any articles related to the new approach for server-side validation. I would greatly appreciate it if you could provide a detailed guide on how to perform server-side validation with the new method. Thank you in advance.
1
0
45
1d
disable ATS
My App needs to send and receive messages to the server, but my server does not have SSL, so I can only disable ATS in the development stage. But if I want to put the app on the shelf, then I still disable ATS when I put it on the shelf, and the server still does not have SSL. Will it be packaged? Is pp warned and terminated by Xcode? Will it be rejected by the Apple audit department? Can it be put on the App Store normally and provided to all users? Note: My server is completely safe without any security risks. I didn't apply for SSL just because I didn't have enough funds.
1
0
72
2d
App Store Server API: > 4 second latency
We're currrently migrating from the deprecated /verifyReceipt endpoint to the new App Store Server API. Context: We use Storekit 2 on the client. Even though it validates transactions client-side, our app also persists subscription data (Original Transaction ID + Product ID) to our DB, so it's necessary to validate the purchases server-side as well. When calling the new endpoints (for example, Get All Subscription Statuses or Get Transaction History ), I'm currently seeing 4+ second latency. This is the case when passing in only a Transaction ID and hitting the Production endpoint, even for Transaction IDs that don't exist in Production (eg, Sandbox transactions). Are there any plans to improve the performance of this API? As it currently stands, we're holding off on the migration -- 4 seconds is far too impactful on both our user experience and our backend system versus the existing 300-400ms latency of /verifyReceipt.
3
0
75
5d
Are there cases where a response to an error returned from the AppStore Server API is considered a subscription cancellation by the user?
According to the following document, when the AppStore Server API is executed and the account does not exist, the response "errorCode: 4040001" is returned. If this response is returned, is it safe to assume that the account has been deleted and treat the subscription as cancelled? Also, please let us know if there are any other error codes other than this error code that can be used to determine that the subscription has been cancelled. https://developer.apple.com/documentation/appstoreserverapi/accountnotfounderror
1
0
143
1w
App store connect API returns 401 Sandbox and 404 Production
I also still getting the same error from sandbox "x": "Invalid response: Client error: GET https://api.storekit-sandbox.itunes.apple.com/inApps/v1/transactions/2000000632845273 resulted in a 401 Unauthorized response", while for production url "x": "Invalid response: Client error: GET https://api.storekit.itunes.apple.com/inApps/v1/transactions/2000000632845273 resulted in a 404 Not Found response:\n{"errorCode":4040010,"errorMessage":"Transaction id not found."}\n",
1
0
138
1w
Notification Received on Consumable Purchase
Hello, I am encountering an issue where I receive an App Store Server Notification V2 upon the purchase of a consumable item. I have configured the App Store Server Notification V2 endpoint to handle notifications related to subscription products. However, I did not expect to receive notifications for consumable purchases. The notification includes the following signedPayload decoded into the ResponseBodyV2DecodedPayload object with the following values: notificationUUID: 3cd6410b-0c89-4247-aba5-20710e79895e notificationType: null subtype: null The transaction information decoded from the ResponseBodyV2DecodedPayload object is as follows: transactionId: 2000000633622618 webOrderLineItemId: null productId: heart_2 To debug, I called the Get Notification History API of the App Store Server API, and the mentioned notification for the consumable product purchase is not included in the history. Only notifications related to subscription product purchases are retrieved. According to the notification type documentation, there is no explanation for cases where both notificationType and subtype are null, nor is there any mention of receiving notifications for consumable purchases. Therefore, I am uncertain how to interpret and handle this notification. Could you please provide an explanation or guidance on this issue? Thank you. References: https://developer.apple.com/forums/thread/737592 https://developer.apple.com/documentation/appstoreservernotifications/notificationtype
2
0
152
1w
Finance Report
Hi, I'm just using the APPLE api to get the sales, installs and profit data for the month but I don't know why I think I'm not getting all the data because if I look at the financial cut for the month (APRIL FOR EXAMPLE) I see that APPLE it pays me XYZ amount, but in the API, if I get the profit or the sales, neither gives me the correct amount from the financial report. I am doing something wrong? how can i get the correct amount using the APIs
0
0
109
2w
server-side iap authentication error code 401
I created a project to validate in-app purchase receipts using c# but I always get error 401, you don't have permission, I followed the instructions exactly but still failed, I created a private key in Certificates, IDs & Profiles and download the .p8 file but it still doesn't work, I also created and tried another key in Users and Access > Integrations > App Store Connect API and also In-App Purchase but it still doesn't work. When I try to put the created token on jwt.io, I always get an Invalid Signature error using Jose; using System; using System.Collections.Generic; using System.Net.Http.Headers; using System.Net.Http; using System.Security.Cryptography; using System.Threading.Tasks; using System.IO; using System.Net; namespace CheckIAP { internal class Program { static async Task Main(string[] args) { string jwtToken = GenerateAppStoreJwtToken(); string transactionId = "110002159078***"; Console.WriteLine(jwtToken); string url = $"https://api.storekit.itunes.apple.com/inApps/v2/history/{transactionId}"; using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", jwtToken); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response = await client.GetAsync(url); if (response.IsSuccessStatusCode) { string responseData = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseData); } else { Console.WriteLine($"Error: {response.StatusCode}, {response.ReasonPhrase}"); string responseData = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseData); } } Console.ReadLine(); } public static string GenerateAppStoreJwtToken() { string teamId = "PZG479xxxx"; string keyId = "JCXH26xxxx"; string issuerId = "7aa0c9c2-***-***-***-xxxx"; string bundleId = "com.***.***"; const string API_KEY = "MIGTAgEAMBMGByqGSM...."; var header = new Dictionary<string, object>() { { "alg", "ES256" }, { "kid", keyId }, { "typ", "JWT" } }; var payload = new Dictionary<string, object> { { "iss", issuerId }, { "iat", DateTimeOffset.UtcNow.ToUnixTimeSeconds() }, { "exp", DateTimeOffset.UtcNow.AddMinutes(15).ToUnixTimeSeconds() }, { "aud", "appstoreconnect-v1" }, { "sub", bundleId } }; var key = CngKey.Import(Convert.FromBase64String(API_KEY), CngKeyBlobFormat.Pkcs8PrivateBlob); return Jose.JWT.Encode(payload, key, JwsAlgorithm.ES256, header); } } }
2
0
166
2w
Cancel Subscriptions on Behalf of Customer like Netflix (App Store Server API)
I recently had a request from a Product Owner to implement capability like Netflix has to enable users to switch their payment method from App Store Subscription to Credit Card on our website, as per capability that Netflix has in their account management portal. We tested it today with a colleague who was paying for Netflix through iOS in-app subscription: In the Netflix account management pages it showed that he was currently paying via In App Subscription He updated his payment method to Credit Card in their website's account management portal. Almost immediately after adding his Credit Card in his iOS Subscription Management settings (we could see the the subscription had been set to no longer renew, with an expiry date) How is this done - I can't see any API in App Store Server API documentation that gives us a way of cancelling / preventing renewal of subscriptions on behalf of a user... But Netflix can clearly do it somehow...
0
0
206
3w
401 error when validating IAP receipt using App Store Server API before App first release
Hi, I'm using the App Store Server API for in-app purchase receipt validation. However I received 401 error status code. My app is ready for submit in App Store Connect, but not yet published the first version. The receipt is generated using StoreKit test configuration and follow the Sandbox testing instruction. It is generated on a real device using Sandbox Apple account registered in the App Sandbox tester section. If I go back to use the deprecated verifyReceipt API sandbox endpoint, I get {'status': 21002} error instead. Is it expected for an App that has not yet published in App Store? If not, is there any way to test the in-app purchase server-side validation before the App is release?
1
0
262
May ’24
App Store Server API Transaction Purchases Not Reflecting in iTunesConnect Dashboard
We've switched over to using the new App Store Server API on our server instead of the deprecated Apple verify receipt method. But we've noticed some differences between our purchase records approved by the App Store Server API and what's shown on the Apple iTunes dashboard for purchases made on May 7th, 2024. Just to clarify, the purchase dates are in UTC time and are taken from the Apple Store API transaction requests. Below are the purchase dates and the subscription names for the 7th. 2024-05-07 22:46:16 - monthly subscription 2024-05-07 22:31:53 - monthly subscription 2024-05-07 22:26:53 - six months subscription 2024-05-07 22:19:16 - monthly subscription 2024-05-07 22:01:04 - monthly subscription 2024-05-07 21:28:56 - six months subscription 2024-05-07 20:09:04 - six months subscription 2024-05-07 20:01:31 - six months subscription 2024-05-07 19:43:24 - monthly subscription 2024-05-07 19:12:30 - annual subscription 2024-05-07 18:30:36 - six months subscription 2024-05-07 00:43:33 - monthly subscription While our records indicate these transactions, the Apple iTunes dashboard only displays 3 monthly subscriptions for May 7th. May 6th and 5th is worse; almost 1 or 2 monthly subscriptions are showing. We think there's a problem that Apple engineers or developers need to look into. Before, when we used the verify receipt method in our API, purchases would show up on the iTunes dashboard the next day. But now that we've switched to the new transaction method, there's a delay in seeing these purchases on the dashboard. Have you migrated to the new App Store Server API and encountered a similar issue? What could be causing this delay?
0
0
227
May ’24
Creating in-app subscription products via the API
Hi, I am implementing in-app subscriptions in my application and would like to set up a module in my admin portal by which I can create subscription products via my custom module. For this purpose I need API's that allow me to create subscription products. Please let me know if such a solution is possible, if it is, then please share the API's and payload by which I could implement it. Thank you in advance.
1
0
239
May ’24
401 Unautheticate error for production environment App Store Server API
Hello, I call transaction information for several apps. And I don't have environment information. That's why I'm calling the sandbox environment as an official guide. Call the endpoint using the production URL. If the call succeeds, the transaction identifier belongs to the production environment. If you receive an error code 4040010 TransactionIdNotFoundError, call the endpoint using the sandbox environment. If the call succeeds, the transaction identifier belongs to the sandbox environment. If the call fails with the same error code, the transaction identifier isn’t present in either environment. However, unlike the official guide, certain apps sometimes use production URLs to call endpoints to receive 401 status codes and successfully call endpoints using the sandbox environment. Why does this difference occur unlike the official guide? I receive a 401 status code in response from a production environment endpoint, I want to know if this status code is a real error or if I have to call it into a sandbox environment. Can I check with the key 'x-apple-request-uuid' in the response header? Please let me know the solution.
1
0
318
May ’24
How to call App Store Server API sandbox environment
I call transaction information for several apps. And I don't have environment information. So I'm calling the sandbox environment as an official guide. However, unlike the official guide, certain apps sometimes succeed by calling an endpoint using a production URL to receive an error code 401 and calling an endpoint using a sandbox environment. Why does this difference occur unlike the official guide? Because of this difference, sometimes it's a production environment and JWT hasn't expired, but I get a 401 error and call the sandbox environment. 2. Please let me know the solution.
0
0
255
Apr ’24
Is it possible to use App Store Server API for getting transaction info in PHP
I am trying to call Get Transaction Info inApps/v1/transactions/{transactionId} from PHP server but it always send me back 404 transactions not found, I receive the transactionId from the app/client when the frontend developer extract the transactionId from the Recipe. I have generated a good JWT it work with the other endoints such as making some product reads. I didn't configured server url as I will not use the notification.
2
0
283
Apr ’24
family sharing REVOKE server-to-server notifications
Hi, I am processing both REFUNDED and REVOKED transactions on the client-side and on the server using Apple's App Store Server Notifications (V2). For transactions with an inAppOwnershipType of FAMILY_SHARED, I receive REVOKE notifications that (sometimes) do not include a revocationDate. What does this imply, and what actions should I take? Additionally, when I query their transaction IDs using the App Store API, they also lack a revocationDate and do not appear in the results when I filter for revoked transactions. Is it appropriate to block these users? Why are server-to-server REVOKE notifications sent in the first place if the transaction does not appear as revoked in the API? Thanks
2
0
370
Apr ’24
How to retrieve prorated refunded amount on original subscription after upgrade?
Apple automatically refunds the prorated amount on the original subscription after it is upgraded. Since upgrades happen immediately and start a new billing cycle beginning from the day of upgrade, the previous original subscription is refunded for the prorated amount. Is there any way to retrieve the amount that was refunded by Apple? The transaction that was upgraded is marked with isUpgraded flag to true but the price field on it still shows the full amount and there is no App Store Server Notification that tells us how much was the refund. How do I get the refunded amount?
1
0
557
Apr ’24
How to verify receipt with AppStoreServerAPI
Hello everyone. I'm try to get out of verifyReceipt endpoint by following this link https://developer.apple.com/videos/play/wwdc2023/10143/ at the end of video so after using ReceiptUtility extract receipt data to get transationId then using getTransactionHistory to do what? it doesn't clear in the video. Where I can get document on how to verify receipt with AppStoreServerAPI.
2
0
431
Apr ’24