0

Does Apple/Itunes/Itunes Connect provides detailed information of receipt generated at any instance(apart from at the time of in-app purchase callback) ?

Apparently, we can send curl requests to Apple Server if you have record of the receipt ID. However, for some reasons, if receipt ID is not recorded at the time of callback from in-app purchase then it seems we can never track back detailed payment information details especially if you want to store it as a log.

Unlike Paypal and Authorize, Apple does not seem to provide a report that has details (transaction_id,subscription_id,etc) of each transaction(perhaps for privacy reasons).

Hence, is there any way to track back missed receipt ID of each payment made to Apple via in-app purchase?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
jseru
  • 31
  • 4
  • 1
    What sort of IAP are you using? For non-consumable and auto-renewing purchases you can obtain past purchase details by examining the receipt on the device (and resubmitting it to your server if required) or by providing "restore" functionality in your UI. For consumable or non-renewing subscription you must ensure that your code does not complete the transaction until you have completed any processing required on your side. E.g. If your server is down or cannot be contacted, *do not* complete the transaction. The transaction will be kept in a pending state for you to retry. – Paulw11 Mar 08 '17 at 05:26
  • thank you for your comment @Paulw11 E.g. If your server is down or cannot be contacted, do not complete the transaction. The transaction will be kept in a pending state for you to retry ... For your information I am a Backend guy and was wondering how does it work from an IOS end, as soon as Buy button is clicked and purchase is confirmed will users be charged right way or wait until the transaction state is complete.... also are receipts are generated for only recurring subscriptions? – jseru Mar 08 '17 at 05:40
  • 1
    You can have a look through [this document](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/DeliverProduct.html#//apple_ref/doc/uid/TP40008267-CH5-SW4) Particularly the section on "finishing the transaction" and "Test an Interrupted Transaction". It is important that your iOS app doesn't call `finishTransaction` until you have done everything you need to do to ensure that the user gets what they have paid for. – Paulw11 Mar 08 '17 at 05:51
  • 1
    A receipt is generated for all transactions, *but* for consumable purchases and non-renewing subscriptions the item is removed from the receipt *after* you call `finishTransaction`. For non-consumable and recurring subscriptions the entry will be in the application receipt permanently. – Paulw11 Mar 08 '17 at 05:51

1 Answers1

1

Yes, Apple does provide you the complete details of the transaction of your in-App purchase. There is a complete process where you receive the receipt details in your app which you can validate from the Apple's server by sending back the receipt data. This whole process is explained on the given below articles as well.

I've myself implemented this process by validating the receipt from server side with my backend APIs developed on NodeJS.

https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Introduction.html

https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Introduction.html

Let me know any further assistance required.

Gurdev Singh
  • 1,996
  • 13
  • 11
  • thank you @Gurdev for prompt comment. Yes, it can provide payment details information if you pass a receipt ID. However, lets say for instance your backend API could not log receipt ID(missed to track callback from in-app purchase or your backend server could not respond to callback in time) and paid users come complaining that payment was actually made,if you want to check receipt(s) of the payment(s) made which you don't have where do you look for those missed receipt(s)? – jseru Mar 08 '17 at 05:11
  • Yes, that's a valid and very practical use case which I also addressed. We keep the receipt data received from the server on the local device as well and maintain the state to ensure that server side database is updated. In my I case check if the database record is updated by validating the receipt and is in sync with local state and that check to validate the receipt is implemented at every app launch. That was the approach I followed because I think there is no other inbuilt support available for this. – Gurdev Singh Mar 08 '17 at 05:15
  • But what if you have no previous record of the receipt meaning the user is completely new and server side failed to record the payment receipt on the first instance itself? Can you track back that lost/missed receipt for the new user? – jseru Mar 08 '17 at 05:21