Purchase receipt for Paid Apps

Hi, I have a
paid app. I need to extract some unique transaction id or something for
the app and save it on the server. This will help me deliver the
contents based on every unique user. I need the data to be user
specific, no matter if he reinstalls the app or uses another device with
his own apple id. We do not have any in app purchases now. I
tried to use the receipt for this. So, when I get the user’s receipt
using SKReceiptRefreshRequest, I get the receipt and on decoding it,
here are the fields I get:

“status”: 0,
“environment”: “Sandbox”,
“receipt”: {
“receipt_type”: “ProductionSandbox”,
“adam_id”: 0,
“app_item_id”: 0,
“bundle_id”: "com.abc.testapp
“download_id”: 0,
“version_external_identifier”: 0,
“receipt_creation_date”: “2016-08-12 06:31:55 Etc/GMT”,
“receipt_creation_date_ms”: “1470983515000”,
“receipt_creation_date_pst”: “2016-08-11 23:31:55 America/Los_Angeles”,
“request_date”: “2016-08-12 07:34:03 Etc/GMT”,
“request_date_ms”: “1470987243219”,
“request_date_pst”: “2016-08-12 00:34:03 America/Los_Angeles”,
“original_purchase_date”: “2013-08-01 07:00:00 Etc/GMT”,
“original_purchase_date_ms”: “1375340400000”,
“original_purchase_date_pst”: “2013-08-01 00:00:00 America/Los_Angeles”,
“original_application_version”: “1.0”,
“in_app”: []
“error”: “Valid receipt”

So, we do not have any unique transaction id to identify every app uniquely. Does apple not send the transaction id? Is there some way to get that done?

I don’t have an answer for you but would love to know how you retrieved the receipt and decoded it. I am trying to convert my paid app to a free one with in-app purchase. I can see that the “original_purchase_date_pst” and “original_application_version” key-value pairs will allow me to detect if a user purchased my app before I turned it into a free version and thus be able to unlock it to give them the in-app purchase for nothing.
I have done a lot of research on this and I think I can retrieve the local receipt from the device, but I am not sure how to decode and validate it.
Any suggestions here would be much appreciated and particularly if code is in Swift 3

have you tried working with braintree to do in-app purchases and creating your own custom buttons to the items you want sold?