Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios in-app subscriptions - when does original_transaction_id change?

When there is an auto-renewing subscription, consider the following model situation:

  • user buys 1 month subscription, lets say in January
  • cancels renewal
  • then waits until March (>1 month) and buys same subscription again

Does the AppStore return (on receipt verification) a new original_transaction_id for the new purchase? Or rephrased, can original_transaction_id be used for grouping receipts to determine intervals when user had active subscription?

Because in sandbox, when there is a simulated situation like this, it returns always original_transaction_id from the FIRST purchase of given subscription, regardless if there were some intervals where user had not active subscription. When there was multiple purchases of subscription with intervals between, when it was expired, Sandbox receipt verification returns original_purchase_date of first purchase, and expires_date of last purchase.

My problem is, to test it in live enviroment, I would have to wait more than a month to let subscriptions expire to test the exact behaviour.

like image 436
Hox Avatar asked Sep 25 '13 09:09

Hox


People also ask

Do Apple subscriptions renew automatically?

They automatically renew at the end of their duration until the user chooses to cancel. Subscriptions are available on iOS, iPadOS, macOS, watchOS, and tvOS.

What is original transaction id?

A unique identifier for a transaction such as a purchase, restore, or renewal.


1 Answers

I have maintained an production app with subscription for several years.

As far as I see, original_transaction_id does not change in that case you mentioned.

Moreover, original_transaction_id belongs to subscription group, not each product_id.

So it remains same in below cases.

  • User start subscription, stop auto-renew and expire, then start subscription again.
  • User start subscription and cancel it, but start again.
  • User start subscription and upgrade or downgrade to subscription in same group.

But this is not a guaranteed result, so you would better prepare in case original_transaction_id changes.

like image 188
taka Avatar answered Sep 20 '22 02:09

taka