Free trial loophole while creating recurring charge

Shopify Partner
399 25 68

Hi, I am facing a doubt in implementing billing. I am trying to create a monthly recurring charge for my app with 3 trial days.


This is how I am handling the code -

1. Checking if an active subscription exists in the auth callback. ( billing.check() method in shopify-api )

2. If not, creating a charge using the billing api. ( billing.request() method in shopify-api )


The problem is - if a user uninstalls the app before the trial ends, and then reinstalls the app, billing.check() returns false because once an app is uninstalled shopify marks the subscriptions as "cancelled".


And because now I am creating a new charge, the user will get the free trial again for 3 days.


This is a loophole which can be exploited by merchants to keep using the app for free. How do I handle this? I was able to get the AppSubscription Id for the first charge using the APP_SUBSCRIPTION_UPDATE webhook, but there is no way to update the subscription using api (for obvious reasons). How do I handle this scenario?

Automate & bulk assign products to shipping profile: Auto Shipping Profiles: Shipr
Calculate accurate shipping rates: Shipping Calculator: ShipMagic
Hide, rename, reorder payment methods at checkout: Payment Customization: PayMix
Replies 0 (0)