Will the original_transaction_id change when the user repurchases their subscription?

If you purchase products that belong to the same subscription group, originaltransactionid remains the same.

However, I don't understand if the originaltransactionid does not change in the following cases.

cases
  1. Purchase a subscription

  2. Renew the subscription

  3. Cancel the subscription(on App Store App)

  4. Repurchase the same subscription

Is originaltransactionid still unchanged in this case?
Post not yet marked as solved Up vote post of masashi580 Down vote post of masashi580
2.1k views

Replies

The Apple Developer documentation makes no mention that this value remains constant. In general, the originaltransactionid often remains unchanged as a subscription is renewed, is upgraded, is downgraded or is cancelled or refunded. However, do not assume that the value will remain unchanged for the lifetime of a subscription. The documentation does not indicate what may cause the originaltransactionid to change. <https://developer.apple.com/documentation/appstorereceipts/original_transaction_id>

rich kubota - rkubota@apple.com
developer technical support CoreOS/Hardware/MFI
Post not yet marked as solved Up vote reply of rich Down vote reply of rich
Thank you for your reply!

I was surprised because I thought there was one originaltransactionid per subscription.

In this document, it is written as follows.

This value is the same for all receipts that have been generated for a specific subscription

https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1

Is it correct to refer to the above information?


However, do not assume that the value will remain unchanged for the lifetime of a subscription.The documentation does not indicate what may cause the originaltransactionid to change

Are there other IDs that can be used to identify if a user has already purchased a same subscription?
The original_transaction_id remains the same for the subscription, as long as upgrades and downgrades occur within the same subscription group. If the customer cancels their subscription, and resubscribes to a subscription in a different subscription group, the original_transaction_id will also change. So there are cases in which the original_transaction_id will change for a customer. By looking at the original_transaction_id and the subscription_group_identifier in the latest_receipt_info section of the /verifyReceipt response, or in the unified_receipt.latest_receipt_info section of the App Store Server Notification payload, you should be able to identify the subscription.
Thanks to your answer I understand that the originaltransactionid does not change between upgrades and downgrades of the same subscription group.

I have one more question.For example, suppose you have the following subscription groups and subscriptions:

ex)

subscription-group-a
  • subscription-a-1

  • subscription-a-2

subscription-group-b
  • subscription-b-1

  • subscription-b-2

I would like to know when the user takes the following actions.
  1. Purchase subscription-a-1 -> (A)

  2. Cancel subscription-a-1

  3. Purchase subscription-b-1

  4. Repurchase subscription-a-1 -> (A`)

At this time, do A and A` have the same originaltransactionid?