# Can I change an Android IAP's type from Consumable to Non-Consumable?

I was inspecting a bug with one of our old Android games, where a "level pack" in-app purchase was being lost after the player re-installed the game etc.

The issue became obvious when I realized that it was being declared as Consumable.

configurationBuilder.AddProduct(ID_LEVEL_PACK,  ProductType.Consumable);


Now, I am contemplating what the correct fix is.

1. Will it suffice to simply change the ProductType? I am skeptical, because it feels odd to me that Google would let a developer to simply change the type of an in-app product from one version to another.

2. Create a new product with a new ID and correct ProductType, then replace the old product. This doesn't sound bad, but is there any way we can properly deal with the people who unfortunately purchased the Consumable version? From my understanding using Unity's Purchasing package doesn't expose any API to query purchased products.

The first option would be ideal if it were possible and also if Unity could retroactively "restore" purchases made when the IAP was still Consumable. From my understanding, Unity performs said restoration upon re-installation (on Android) but only for Non-Consumables or Subscriptions.

While I am in the process of testing that, this seems like a fairly delicate issue so I'd like to see if anyone has insight on this matter: can I change a product's type from Consumable to Non-Consumable, and will Unity retroactively restore the old purchases?

## 1 Answer

I have done minimal testing, and here are the results:

• Store: Google Play
• Unity Purchasing Package version: 3.2.1
• Unity Version: 2020.3.7f1

1. There doesn't seem to be any errors if you upload a build that changes a product's definition from Consumable to Non-Consumable.

2. If you purchased the Consumable version before the conversion, Unity will not be able to retrieve its receipt and therefore the product won't be restored. This is what will happen to the players who already purchased it before the update.

3. If you purchase the Non-Consumable version (after the conversion, of course), and then re-declare the product back to a Consumable type, it seems like the product will still be treated as a Non-Consumable because the receipt is still available (even after re-installation), and if you try to purchase it, you will get an error saying that you already own it.

4. If you purchased the Consumable version before the conversion, then update to the build that has the Non-Consumable declaration, you'll have to purchase it again. If you do so, it will work as expected and it will treat the product as a Non-Consumable from now on.

So it seems like you could just change the product type, and then provide customer support to the people that bought it before the change. However, since it's not clear whether this behaviour will be the same in all stores, I think it is safer to replace the product ID with a new one, and then check for receipts in either of the two IDs when attempting to restore the product.