FROM CACHE - en_header

Billing API trialDays

Shopify Partner
1 0 0


I have implemented Billing API(GraphQl) in my react node app and it's working fine but when I test the trial days option and found it's not working because when I installed the app I added 5 trial days in API but after 1 day when I uninstalled the app and reinstall then again shows 5 trialDays so can you help me to fix this.

Reply 1 (1)
Shopify Partner
21 4 5

You have to manage it yourself from the GQL mutation, I save in the shop table the install date and uninstall date, and then when reinstalling I calculate remaining_trial_days = trial_days - (uninstall_date - install_date). Then I update install_date, nil uninstall_date, and save the trial days "used". Hope it helps 🙂