Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS in-app purchase's receipt string explained

I try to understand the receipt information obtained from iTunes server, but could not find relevant documentation.

Particularly, what's the difference among unique_identifier, unique_vendor_identifier, original_transaction_id (which is claimed, in a WWDC'12 session, to be a de facto customer id) and [[[UIDevice currentDevice] identifierForVendor] UUIDString]?

{"receipt":
    {"original_purchase_date_pst":"...",        
     "purchase_date_ms":"...", 
     "unique_identifier":"...", 
     "original_transaction_id":"...", 
     "bvrs":"...", 
     "transaction_id":"...", 
     "quantity":"...", 
     "unique_vendor_identifier":"...", 
     "item_id":"...", 
     "product_id":"...", 
     "purchase_date":"...", 
     "original_purchase_date":"...", 
     "purchase_date_pst":"...", 
     "bid":"...", 
     "original_purchase_date_ms":"..."},  
"status":0}`

I wish to store this receipt information on my server to track subscription validity. So it is better to know which id I should use as a surrogate for user identity.

like image 435
Nimit Pattanasri Avatar asked Feb 18 '23 07:02

Nimit Pattanasri


1 Answers

Your software should only rely on the fields that Apple describes in their documentation. They could remove unique_identifier or unique_vendor_identifier, change their meaning, or change their values at any time without telling you about it.

You should follow Apple's documentation in regard to verifying subscription receipts using Apple's servers before your server transmits the sbuscription content to the device.

like image 132
Fls'Zen Avatar answered Feb 27 '23 22:02

Fls'Zen