Unable to Add a 7-Day Free Trial to Shopify App Subscription

Unable to Add a 7-Day Free Trial to Shopify App Subscription

1563704123
Shopify Partner
10 0 1

Hi everyone,

I'm trying to set up a 7-day free trial for my Shopify app subscription using the Billing API, but the trial is not being applied. The subscription works, but the free trial is not included. This issue occurs only in production—locally, everything works fine.

Here’s the code I’m using:

const return_url = `${ENV_HOST}/confirmation/plan-confirmation/${shop_name}/${planType}`; const confirmation_url = await axiosService.subscribeToPlan({ name: `plan`, price: selectedPlan.rate, return_url, trial_days: 7,  }); async subscribeToPlan({ name, price, return_url, trial_days, test }) { const queryString = { query: subscribeToPlanMutation, variables: { name, test, trialDays: trial_days, returnUrl: return_url, lineItems: [ { plan: { appRecurringPricingDetails: { price: { amount: price, currencyCode: "USD", }, interval: "EVERY_30_DAYS", }, }, }, ], }, }; const resp = await this.post("/graphql.json", JSON.stringify(queryString)); const { confirmationUrl, userErrors } = resp.data.data.appSubscriptionCreate; if (confirmationUrl) { return confirmationUrl; } else if (userErrors) { for (const item of userErrors) { console.error("Error:", item.message); throw new Error(item.message); } } }


  • The subscription is created successfully.
  • The trial period is not being applied.
  • Works fine locally but not in production.

Has anyone faced this issue before? Any ideas on what I might be missing?

Thanks in advance! 🚀

Replies 0 (0)