Hi,
In an auto-renewable subscription scenario, I receive a transaction from Product.Purchase and then send the transaction ID (e.g., 500000000738201) to my API server. After receiving the response, I called transaction.finish().
The account has purchased the subscription before and expired. So it's re-subscribe.
And then, I received a RESUBSCRIBE notification from Apple’s server to my API server. I noticed a discrepancy where the transaction ID in the notification is decreased by one (e.g., 500000000738200 instead of 500000000738201).
I’m wondering why this discrepancy occurs and how it happens.
Best regards,
RoyHuang
StoreKit
RSS for tagSupport in-app purchases and interactions with the App Store using StoreKit.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello!
We are implementing consumable IAP for iOS using StoreKit 2 together with our own server backend.
Our happy path looks like this:
1. Call /prepare on our server
• We only allow one purchase at a time, so this fails if a pending transaction already exists.
2. Call /purchase via StoreKit
3. If successful, call /complete on our server
4. Call .finish() on the Transaction
⸻
The Problem
Some users report being charged by Apple but not receiving coins.
I suspect this happens in rare cases where the purchase flow throws an exception:
• Every time we throw, we immediately cancel the transaction on our server.
• However, some errors may actually be temporary. StoreKit seems to recover by later sending an update through Transactions.updates.
• When that happens, since the transaction was already canceled on our server, we cannot match it. As a result, we just call .finish() without granting consumables.
⸻
Additional Observations
From user logs, the issue tends to appear when the following errors are reported:
• リクエストを完了できません。
• Triggered by: StoreKit.notEntitled
• Triggered by: StoreKit.unknown
• ヘルパーアプリケーションと通信できませんでした。
I was not able to reproduce the last one, even when testing all possible StoreKit configuration errors. Some sources suggest this may be a rare case where the app cannot communicate with the App Store itself.
Additionally, affected users often seem to be using non-standard payment methods (PayPay, gift cards, carrier billing, etc.) rather than credit cards.
⸻
My Question
What is the best practice for handling StoreKitError and PurchaseError?
Specifically:
• Should some of these errors be treated as temporary instead of final?
• How should we ensure users always receive their consumables in such cases?
⸻
Code
do {
let result = try await wrapper.product.purchase()
switch result {
case .success(let result):
let transaction = try StoreKitVerifier.checkVerified(result)
let iOSPurchase = IOSPurchase(transaction: transaction, jws: result.jwsRepresentation)
return .Success(purchase: iOSPurchase)
case .userCancelled:
return .Canceled()
case .pending:
return .Pending()
@unknown default:
return .Error(
message: "Purchase result doesn't match with anything. This must not be executed")
}
} catch {
return .Error(message: error.localizedDescription)
}
When simulating a Storekit error like an invalid device verification or others of that type, should we finish a failed transaction? When I test with a Storekit configuration file, all failed transactions persist after every restart. The Apple-provided sample code for Storekit 2 has transactions finished only when they are successful.
Hi All
i have developed an app but when I go to download the paywall appears as it’s subscription only but it shows no prices for the subscription I get an endless swirl.
I checked the product id etc and it’s correct but the subcription on my App Store Connect shows as approved. is there another status it needs to reach before it becomes like like ready for sale?
https://apps.apple.com/gb/app/gameaware-pro/id6751592563
I am using the public url https://api.storekit-sandbox.itunes.apple.com/inApps/v1/notifications/jwsPublicKeys to get the jwks keys to verify the signed payload for store kit payments. I am checking Apple server notifications.
const APPLE_JWKS_URL = "https://api.storekit-sandbox.itunes.apple.com/inApps/v1/notifications/jwsPublicKeys"
// Apple JWK set (cached by jose)
const appleJWKS = createRemoteJWKSet(new URL(APPLE_JWKS_URL));
const jwks = await appleJWKS();
logger.debug("Apple JWKS Keys: %O", jwks); // Log the keys
if (!signedPayload) {
// return res.status(400).json({ error: "Missing signedPayload" });
}
// Step 1: Verify JWS (signature + payload) using Apple's JWKS
const { payload, protectedHeader } = await jwtVerify(
signedPayload,
appleJWKS,
{
algorithms: ["ES256"], // Apple uses ES256 for signing
}
);
アプリに課金を実装しようと思うのですが、もし不正利用された場合、アプリ側は基本的にApp Storeを通じて対応するよう案内するのが一般的と思いますが、Apple ID不正利用時とクレジットカード不正利用時で、アプリ側が行う標準的な対応プロセスは変わるのか教えていただきたいです。
また下記内容は標準的な対応プロセスとして問題ないでしょうか?
■Apple ID不正利用時
→ ユーザー自身がAppleサポートに連絡し、パスワード変更・二段階認証の設定・不正購入の返金申請などを行うよう案内する。
■クレジットカード不正利用時
→ まずカード会社への連絡を促すが、アプリ内決済に関してはAppleのカスタマーサポート経由で返金や調査手続きを案内する
不正利用されたユーザーへの対応に備えて、アプリ側が考慮すべきことがあれば教えてください。
hI, I’m looking for some clarity on the rules around in app purchasing, so I play a game with in app purchases that you have random odds of getting items out of loot boxes, they split the loot into sections, so featured, mega rare, rare and common. for each of these sections they give a % chance that they show of what chance you have to get an item out of that section, I.e featured is 1.24% and common is 74% ect.
my question is should they then have to display the odds of what each item has in those sections as well or is it good enough just to have the sections with % chance? So each section could have 10 items in, should those items have a % next to as well?
any advice you can give with this would be appreciated, if needs be I can send picture examples of what I’m explaining
We've been approved for the Advanced Commerce API. After receiving the approval, we completed the initial setup requirements (submitted a generic product ID and shared our subscriptions page deep link).
When testing the Migrate Subscription to Advanced Commerce endpoint in the sandbox, we receive a 5000000 error.
What could be the reason/s for it? There is no information, and the API call we make includes all required parameters. Could it be related to the fact that our new generic product ID status is "Missing Metadata"? Is there a way to understand what the issue is on Apple's side?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
In-App Purchase
App Store Server API
Advanced Commerce API
No matter what I do whether I delete the app or reset my phone it still prompts me to log in to the previous sandbox test account. I'm not even signed into that account on my phone or in the App Store.
Topic:
App & System Services
SubTopic:
StoreKit
My app has in app purchase for subscriptions, available in many countries. When using Sandbox App Store accounts on TestFlight with a locale different from my own in the iOS 26 RC, I'm getting incorrect currency coming back from Product.products(for: identifiers), and so my app displays the wrong price for the locale. However, the actual Apple Pay buy sheet shows the proper currency symbol and currency amount. This did not happen on prior versions of iOS.
Is anyone else experiencing this?
In all the illustrations of win-back offers, I see an example of "Get 3 months off, then $X/month", as seen below.
First, I'm not exactly clear how each configuration translates into an actual offer in practice:
If I want to offer 3 months off on an annual subscription, ie. only if the user pays for the annual offer (basically a 25% discount), is that possible?
If I set a "Free" type, of 3 months, I guess that would allow the user to cancel before paying for the annual, correct?
If I set a "Pay up front" type, with a 25% discount, how would that show up to the user on the App Store?
Secondly, is eligibility to an offer determined by the user elapsing on the same subscription or any subscription in the same subscription group?
Thank you
Our app cannot retrieve in-app purchase products from the App Store. We're getting a "storekit_no_response" error when attempting to fetch product information, despite having all products properly configured in App Store Connect.
Error: IAPError(code: storekit_no_response, source: app_store, message: StoreKit: Failed to get response from platform., details: null)
Verified product IDs match exactly what's in App Store Connect
Confirmed we're using a Sandbox Test Account
Checked that In-App Purchase capability is enabled
Waited over 24 hours for product availability
Tried multiple product ID formats
This issue is preventing us from implementing subscription functionality in our app. We need assistance determining why StoreKit isn't responding to our product queries.
Thank you for your help.
Topic:
App & System Services
SubTopic:
StoreKit
I have an app that works by being able to map IAP transactions to a predefined user ID. This means when I consume events from Apple's App Store Server Notifications endpoints I have to do a reverse lookup in order to assign permissions within my app.
Workflow:
User purchases subscription within the app via IAP. The app persists the subscriptionID from the Apple IAP library in my cloud database (Firestore).
Cloud function receives the event from App Store Server Notifications endpoint and looks up the user ID containing the persisted transactionID (with retries to avoid race condition).
Question:
This workflow works but it seems an improvement would be to allow dev's to append metadata, like the user ID, to the transaction submitted to IAP that we can access within the signedTransactionInfo of the event from the App Store Server Notifications endpoint in order to facilitate a direct lookup of the user document needing it's permissions updated. This would greatly simplify workflows that use non-Apple systems as a source of truth for app permissions. Does this actually exist already? If not, is there a feature request platform?
Topic:
App & System Services
SubTopic:
StoreKit
Network
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
App Store Connect
In-App Purchase
Graphical Debugger
We are experiencing an Unknown Error (error code 0) when testing purchases in the Apple Sandbox environment.
The error does not occur every time, but it fails with an Unknown Error in approximately 8 out of 20 attempts.
Due to this issue, our app is failing to pass Apple’s review.
Issue Details
This issue only occurs in the Apple Sandbox environment.
After attempting a purchase, the Apple payment API returns SKPaymentTransaction Unknown Error.
Returned error code: SKErrorUnknown (error.code 0).
This problem is preventing us from conducting proper payment tests and getting approval from Apple.
Would it be possible to receive support or any solutions for this issue?
I would like to know if it is allowed to offer the user to either unlock the app immediately or partake in a 3-day trial period before making a purchase.
I created 2 IAP non-consumable products; 1 for the immediate [which is at a discount] and for the after trial period ends [this is at a higher cost].
Is this something that Apple allows or is frowned upon?
When I test subscibe in sandbox,IOS says this transaction need to request parent’s approval。But this is a sandbox account,it don't have any family members
Hi all,
I’m testing Subscription in my Flutter app on a real iOS device (iPhone 16 Pro with iOS 18) via TestFlight. I’ve set everything up as required, but I still get this error:
flutter: Found products: []
If everything works perfectly when StoreKit configuration is used in Xcode, but not via TestFlight.
All my Subscriptions are approved with the same ID.
Hi there,
We have an app targeted for children and we want to use the SkAdNetwork to track installs for campaigns.
We don't want to track further in-app events (purchase etc.), just the install event.
We added the SDK to our Unity app, listed the network identifiers in the plist file, configured the external campaign according to their instructions, but struggle to see any events for several weeks now.
We see the following logs in the app:
Registering install attribution pingback.
Failed to migrate Install Attribution database schema from 17001 => 17400.
SkAdNetwork: No pingbacks found while attempting to register/update.
Error setting install attribution pingback registered for app: 1509727806, error: Error Domain=ASDErrorDomain code=1208
How can we debug this further? What does the error mean?
Thank you very much!
(I hope I posted in the correct forum topic. Apologies if not)
Topic:
App & System Services
SubTopic:
StoreKit
I enter the payment wall, there it takes more or less 3 to 4 minutes to show the plans, when I select the monthly plan the loader is shown and from there the pop up to make the purchase in sandbox does not appear, I have waited until a maximum of 50 minutes and it is not shown, I go back and close the app I do the same steps and I am still there, without showing the pop up.
Doing this same process in xcode, everything happens immediately without any interruption.