Extracting Transaction IDs from App Receipts

Hello everyone,

I'm currently in the process of updating my code to remove the deprecated verifyReceipt method in line with the latest documentation and guidelines.

I have a question regarding the Receipt Usage example provided in the documentation here: https://github.com/apple/app-store-server-library-java?tab=readme-ov-file#receipt-usage

ReceiptUtility receiptUtil = new ReceiptUtility();
String transactionId = receiptUtil.extractTransactionIdFromAppReceipt(appReceipt);

My question is: Why does this method only return one transactionId? I had assumed that it might return a list of different transaction IDs present in the encoded receipt.

Thank you in advance for any assistance!

Best regards,

Maria

Actually what I meant was originalTransactionId. Single originalTransactionId is returned but in the receipt there could be multiple ones.

The method returns a single transactionId because that's all you need to transition off of verifyReceipt - a single valid transactionId for each of your users. Once you have this transactionId, you can then switch to calling the modern App Store Server API endpoints that accept a transactionId as an argument. See these core endpoints (which can be called via the App Store Server Library):

https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history

https://developer.apple.com/documentation/appstoreserverapi/get_all_subscription_statuses

For more information, see these WWDC sessions:

https://developer.apple.com/videos/play/wwdc2023/10141/?time=878

https://developer.apple.com/videos/play/wwdc2023/10143/

Is it expected behavior for a user with more than 1000 transactions to experience over 2 minutes of processing time with this approach? Given this implementation, it seems likely that the Rate Limit of 50 RPS could easily be reached.

https://github.com/apple/app-store-server-library-python?tab=readme-ov-file#receipt-usage

try:    
    transaction_id = receipt_util.extract_transaction_id_from_app_receipt(app_receipt)
    if transaction_id != None:
        transactions = []
        response: HistoryResponse = None
        request: TransactionHistoryRequest = TransactionHistoryRequest(
            sort=Order.ASCENDING,
            revoked=False,
            productTypes=[ProductType.AUTO_RENEWABLE]
        )
        while response == None or response.hasMore:
            revision = response.revision if response != None else None
            response = client.get_transaction_history(transaction_id, revision, request, GetTransactionHistoryVersion.V2)
            for transaction in response.signedTransactions:
                transactions.append(transaction)
        print(transactions)
except APIException as e:
    print(e)
Extracting Transaction IDs from App Receipts
 
 
Q