Hello,
I am investigating a case where two different transaction IDs appear to refer to the same purchase, and I would like clarification on whether this behavior is expected.
Additional context
- StoreKit version: StoreKit 1 (
SKPaymentTransaction) - Environment: Production
- Product type: Auto-renewable subscription
Transaction sources
The values are obtained from the following APIs:
transaction_idfrom SKPaymentTransaction
https://developer.apple.com/documentation/storekit/skpaymentqueue
receipt_datafrom the App Store receipt
https://developer.apple.com/documentation/foundation/bundle/appstorereceipturl
Observed behavior
- After an In-App Purchase completes, the app receives:
- a
transaction_idfromSKPaymentTransaction - the corresponding
receipt_datafor the purchase
- a
- When inspecting the receipt, the
transaction_idinsidelatest_receipt_infodiffers from thetransaction_idreceived directly from the purchase transaction.
For clarity:
- A =
transaction_idreceived from the purchase flow (SKPaymentTransaction) - A' =
transaction_idfound inreceipt_data.latest_receipt_info
The two values are different, but they differ only by 1.
Additional observation
- The
original_transaction_idfor A and A' is identical, which suggests that both transaction IDs belong to the same subscription purchase chain.
Pattern observation on the ID difference
We have observed that the difference between A and A' is consistently exactly 1 (i.e., A' = A + 1) across multiple transactions, not just a single case.
This appears to be a reproducible pattern rather than a coincidence.
This observation raises an additional question (Question 6 below).
API verification
When calling:
GET /inApps/v1/transactions/{transactionId}
Both A and A' return what appears to be the same purchase record.
The response data is effectively identical except for the transactionId field.
However, when calling:
GET /inApps/v2/history/{transactionId}
Adoes not appear in the transaction history- only
A'appears in the history response
Questions
- If
Adoes not appear in transaction history, where does this transaction ID originate from? - Why does Get Transaction Info (
/inApps/v1/transactions/{transactionId}) return a valid response forAeven though it is not present in the transaction history? - Why do A and A' both resolve to what appears to be the same purchase?
- In this situation, which transaction ID should be treated as the canonical transaction ID for server-side validation?
- Is this difference related to how StoreKit 1 (
SKPaymentTransaction) and the App Store Server API represent transactions? - Is the consistent off-by-one difference between the
transaction_idfromSKPaymentTransactionand the one recorded inlatest_receipt_infoan intentional behavior of StoreKit 1's internal transaction ID assignment?
Specifically, we are wondering whether StoreKit 1 applies some form of internal offset when delivering the transaction ID to the client, while the App Store server records a different (adjacent) ID in the receipt. If so, is this documented anywhere?
Note
We are currently in the process of migrating to StoreKit 2, but this behavior was observed while investigating our existing StoreKit 1 implementation. Any clarification would help us better understand the correct transaction model during the migration.