Ios change from paid app to inn app purchase

Im wondering if it’s possible to change an ios app from paid app to in app purchase?

I have an ionic app which is now paid in app store but to increase download want to change it to free with ads, then pay to remove ads.

I’m also wondering on how to do this in ionic.

As in if there would be any code involved in making the switch.

I’ve implemented the ads and purchase.