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.

App Store Server API

Posts under App Store Server API tag

84 Posts
Sort by:
Post not yet marked as solved
1 Replies
1.3k Views
Hi team, I would to extract the order information of customer's in-app purchase on app store to match against sales revenue. Looking through the Apple API documentation, I am taking the following steps Get status and history for in-app purchase transactions through the App Store Server API by calling the Get Transaction History endpoint. This returns me the purchase date, transactionID, and quantity information. There is also a field called productID which was created in Apple Store Connect. However i would also need to extract price information such as currency and item unit price. I looked through Apple Store Connect API which contains in app purchase information. How should i retrieve these fields from the response from Get Transaction History endpoint. Should I use the productID and what are the subsequent API endpoints to query?
Posted
by
Post not yet marked as solved
1 Replies
940 Views
I read the following documentation: https://developer.apple.com/documentation/appstoreserverapi/get_refund_history/ But the originalTransactionId parameter is required. As far as I know, it is associated with a certain consumer, so whether this API can only check the refund order associated with a certain consumer, not the entire app I want to regularly query the refund orders in the entire app without App Store Server Notifications. Is this possible?
Posted
by
Post marked as solved
7 Replies
2.0k Views
We have implemented an auto-renewing subscription as an in-app-purchase for our iOS application. We are consuming the App Store Server Notifications for subscription transactions in order to update the user's account (and thereby maintain their 'Pro' access to our application). Sometimes those notifications never come to our server, and there is no evidence that they were even attempted to be sent to us. We have had some users report to our Customer Support team that they have successfully made a purchase of the subscription, but that they were not granted 'Pro' access. For the large majority of users this is not happening and all is well, but for some users the notifications just never come from the App Store Server API. We keep a record of all notifications that we receive from the App Store, and for these users we never received the "SUBSCRIBED" event. We have checked the Notification History API and there are no reports of any failure to send notifications to our server. We have checked our server logs for any sign of failure to receive incoming web requests, and there is no sign of these missing notifications. We have verified that our server supports ATS. We are keeping the transaction.originalID for all our users who are subscribed to the auto-renewing subscription. We have used this value to do some lookups into the transaction history and subscription status of the users who are being affected. Here is an example of our findings from those lookups: From the transaction history endpoint, we received an error: “Invalid transaction identifier”. From the subscription status endpoint, we received a response with the information for that user's active, valid subscription. We never received any App Store Server Notifications about this user’s subscription, and the transaction history API tells us it is an invalid transaction ID. We believe that the fact that the subscription status API returned the information showing that this user’s subscription is active and valid, and that the notification history API shows no sign of a failure to send us notifications about that subscription, shows that the App Store Server API never attempted to send us any notification for this user’s subscription. The same is true for a significant number of other users of our service. Can anyone help us determine what is going on, and how to best support these customers? It seems as though there was never an attempt to send these notifications to our server, but our users provide proof that they do in fact have an active subscription, for which they have paid (receipt email from Apple with a valid order ID).
Posted
by
Post not yet marked as solved
3 Replies
573 Views
Good morning, we have a backend making calls to the subscriptions API to check the status of users subscriptions. Now, besides the check we need sometimes to extend subscriptions, using the api: https://api.storekit.itunes.apple.com/inApps/v1/subscriptions/extend/{originalTransactionId} To call this api we need a signed JWT Token and the originalTransactionId. Now, calling the api with the concrete parameters we receive always error response like this: StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers: { Date: Wed, 17 May 2023 14:48:36 GMT Server: Apache Strict-Transport-Security: max-age=31536000 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Content-Security-Policy: default-src 'self' *.apple.com; X-Content-Type-Options: nosniff Content-Length: 196 Content-Type: text/html; charset=iso-8859-1 }; content is 404 Not Found Not Found The requested URL was not found on this server. Consider that the originalTransactionId is taken from the response of a previous verifyReceipt API, and the error does not seem related to the authentication (so I tend to exclude issues with the signed token) What could be the problem? What is the right way to extend a subscription via API call? Thank you.
Posted
by
Post not yet marked as solved
1 Replies
492 Views
Hello all, we have in-app purchases in our application. Our server is used to verify all transactions. We get transaction_id from verifyReceipts API along with other data. In the report that we get from Apple, there is no transaction_id or any common field that can uniquely identify a payment. Can we add transaction_id into reports somehow?
Post not yet marked as solved
1 Replies
865 Views
Hi, I want to fetch the latest status of a subscription when we have the original transaction id. Using the suggested API: Get All Subscription Statuses can we assume the response is ordered? Is there a way to fetch the current status or fetching only the lastest transaction data?
Posted
by
Post not yet marked as solved
0 Replies
532 Views
Using the Login with Amazon SDK for iOS APIs for my new app but it always gives an error codes 18889275382 , 08889275382 , 8889275382 , The three error codes on further investigation shows that the files hosted on aws are not responding well to login with amazon sdk for IOS API
Post not yet marked as solved
1 Replies
936 Views
As verifyReceipt has been deprecated this time, I am trying to verify the receipt using Get Transaction History Endpoint. Apparently, Apple's official document says it will return the value for a single transaction if you request it to the endpoint, but it keeps returning the value by combining all the information about different Transaction IDs. If there are developers who know about this, please answer. Also, please let me know if anyone knows how to verify the receipt using this endpoint.
Posted
by
Post not yet marked as solved
1 Replies
955 Views
We followed same step as given documentation but when we request for sever notification we are getting 401 unautheticate error below is my request curl -v -H 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNCQzczUjlEV0MifQ.eyJpc3MiOiI2OWE2ZGU4ZS1iNGZhLTQ3ZTMtZTA1My01YjhjN2MxMWE0ZDEiLCJhdWQiOiJhcHBzdG9yZWNvbm5lY3QtdjEiLCJpYXQiOjE2ODc3NzQzNzI1MDEsImV4cCI6MTY4Nzc3Nzk3MjUwMSwiYmlkIjoiY29tLm9uZmVyZW5jZS5vbmZlcmVuY2VhcHAifQ.IA0eQHGgW4MTmXPm7qWQDsav-9e5KSR8N_64ge3DSo_E39wxFUcs3JnJUgtq-uOJ1nr49FiUrFPyZGTQpdQOBg' "https://api.storekit-sandbox.itunes.apple.com/inApps/v1/notifications/test" Trying 17.36.202.8... TCP_NODELAY set Connected to api.storekit-sandbox.itunes.apple.com (17.36.202.8) 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-sandbox.itunes.apple.com" matched cert's "api.storekit-sandbox.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 0x7fbcda00a000) GET /inApps/v1/notifications/test HTTP/2 Host: api.storekit-sandbox.itunes.apple.com User-Agent: curl/7.64.1 Accept: / Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNCQzczUjlEV0MifQ.eyJpc3MiOiI2OWE2ZGU4ZS1iNGZhLTQ3ZTMtZTA1My01YjhjN2MxMWE0ZDEiLCJhdWQiOiJhcHBzdG9yZWNvbm5lY3QtdjEiLCJpYXQiOjE2ODc3NzQzNzI1MDEsImV4cCI6MTY4Nzc3Nzk3MjUwMSwiYmlkIjoiY29tLm9uZmVyZW5jZS5vbmZlcmVuY2VhcHAifQ.IA0eQHGgW4MTmXPm7qWQDsav-9e5KSR8N_64ge3DSo_E39wxFUcs3JnJUgtq-uOJ1nr49FiUrFPyZGTQpdQOBg Connection state changed (MAX_CONCURRENT_STREAMS == 1024)! < HTTP/2 401 < server: daiquiri/3.0.0 < date: Mon, 26 Jun 2023 10:13:59 GMT < content-type: text/plain < strict-transport-security: max-age=31536000; includeSubDomains < x-apple-jingle-correlation-key: 4VK4BGGFURNOK3JZ4FPKMH6ZPA < x-daiquiri-instance: daiquiri:45824002:st44p00it-hyhk15104701:7987:23RELEASE91:daiquiri-amp-commerce-clients-ext-001-st < Unauthenticated Request ID: 4VK4BGGFURNOK3JZ4FPKMH6ZPA.0.0 Connection #0 to host api.storekit-sandbox.itunes.apple.com left intact Closing connection 0 Please help me on this
Posted
by
Post not yet marked as solved
1 Replies
968 Views
Hey i am trying to Link Zelle API with SWIFT Based Ecommerce Store , Getting error code 8889275440 , and 18889275440 , Am trying to track and put balance into users account as i receive the payment from user and post directly to his account when he tries to add funds , But getting the above two error codes
Posted
by
Post not yet marked as solved
1 Replies
943 Views
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
Posted
by
Post not yet marked as solved
1 Replies
454 Views
I am planning to use the Get Notification History API to receive refund notifications for consumable in-app purchases. In order to receive notification data from this API, do I need to set up an HTTPS URL in App Store Connect to receive App Store Server Notifications?
Posted
by
Post not yet marked as solved
1 Replies
527 Views
Hey, Let's say I have configured in-app purchase subscription product configured. I have a server where I'm listening for App Store Server Notifications v2 (https://developer.apple.com/documentation/appstoreservernotifications/responsebodyv2) I'm able to decode payload and transaction information. Now I want to get information about how much customer paid for this product. how long this subscription lasts for. How I can achieve that from server? I see that there is subscriptionGroupIdentifier & offerIdentifier & storefrontId in response that I could potentially use to search for it, but I could not find any API that could help me from server side. Is it possible only from mobile? App Store Server API doesn't really helps me https://developer.apple.com/documentation/appstoreserverapi Regards, DL
Posted
by
Post marked as solved
3 Replies
782 Views
Hi, I’m investigating switching from the /verifyReceipt endpoint to the App Store Server API. I’ve noticed that some transaction IDs we have in our system return 4040001 (AccountNotFound) from the “Get All Subscription Statuses” endpoint. These transaction IDs are associated with receipts that used to verify OK with the /verifyReceipt endpoint, but now return 21010 (receipt unauthorized). Under what circumstances do transactions which used to be valid start returning “account not found”?
Posted
by
Post not yet marked as solved
1 Replies
398 Views
Issue Currently I have multiple subscription offers available for yearly/monthly subscriptions. Each of the subscription offers have multiple different custom codes available. When the customer buys a subscription and the receipt is being handled in the backend, I need to know which of the custom codes was used. What I have tried When i call the https://buy.itunes.apple.com/verifyReceipt I get the values offer_code_ref_name and promotional_offer_id. The offer_code_ref_name is the subscription offer name AND NOT the custom code. I tried to get more info using the https://api.storekit.itunes.apple.com/inApps/v1/subscriptions/{transactionId} request, but it does not give me any info about the custom code used either. I do however see which custom code has been used if I go to Sales and Trends > Sales and Trends Reports and download Subscritpion Reports. There the offer code can be found ref. as "Promotional Offer ID" my question How can I get which custom code was used when purchasing a renewable subscription using transaction id or transaction Receipt?
Posted
by
Post marked as solved
1 Replies
1.2k Views
In the old verifyReceipt endpoint doc, there is an important desc As a best practice, always call the production URL https://buy.itunes.apple.com/verifyReceipt first and proceed to verify with the sandbox URL if you receive a 21007 status code. Following this approach ensures that you don’t have to switch between URLs while your app is in testing, in review by App Review, or live in the App Store. So I can know the transactionId is for sandbox if return back 21007. And I am about to access to new App Store Server API, so the same, I wonder how can I recognize the transactionId is from sandbox by status code? The most likely desc is this: If you don’t have environment information, follow these steps: Call the endpoint using the production URL. If the call succeeds, the original transaction identifier belongs to the production environment. If you receive an [errorCode 4040005] with errorMessage as OriginalTransactionIdNotFoundError, (or HTTP response code 404 from the Send Consumption Information endpoint), call the endpoint using the sandbox environment. If the call succeeds, the original transaction identifier belongs to the sandbox environment. If the call fails with the same error code, the original transaction identifier isn’t present in either environment. And I have a try for Get Transaction Info API, but actually get 4040010, Transaction id not found. as return. So I just wanna clear that is there any doc clarify this point that I miss? Looking forward to your response, sincerely!! :)
Posted
by
Post not yet marked as solved
1 Replies
759 Views
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
Posted
by