original_transaction_id
The transaction identifier of the original purchase.
Declaration
string original_transaction_idDiscussion
This field is returned in the JSON response, in the responseBody.Pending_renewal_info, responseBody.Latest_receipt_info, and responseBody.Receipt.In_app arrays.
This value is identical to the transaction_id except when the user restores a purchase or renews a subscription. This value has the same format as the transaction’s transactionIdentifier property; however, the values may not be the same. For auto-renewable subscription transactions, this value also appears in the pending_renewal_info key of the JSON response.
You can use this value to:
Match a transaction found in the receipt to a server-to-server notification event. For more information, see Enabling App Store Server Notifications.
Manage auto-renewable subscriptions. Store this value,
product_id,expires_date_ms, andpurchase_date_msfor each transaction for each customer, as a best practice.Identify a subscription with the
product_idin thepending_renewal_infosection. Do not rely on theoriginal_transaction_idvalue on its own. Treat this purchase as a new subscription when you see a neworiginal_transaction_idvalue for aproduct_id.Differentiate a purchase transaction from a restore or a renewal transaction. In a purchase transaction, the
transaction_idalways matches theoriginal_transaction_id. For subscriptions, it indicates the first subscription purchase. For a restore or renewal, thetransaction_iddoes not match theoriginal_transaction_id.Identify one or more renewals for the same subscription.