#chip-subscription-trial

1 messages ยท Page 1 of 1 (latest)

orchid tartanBOT
topaz shoal
#

Hi ๐Ÿ‘‹

How do your customers "apply for a trial period"?

austere tiger
#

and we use the stripe node sdk

topaz shoal
#

Okay, so it's your code that creates /updates the Subscription.

austere tiger
#

I would hope I could something when we create the checkout session

#
  const checkoutSession = await stripe.checkout.sessions.create({
    customer: customer.id,
    mode: 'subscription',
    line_items: [
      {
        price: priceId,
        quantity: 1,
      },
    ],
    success_url: 'http://localhost:3000/profile/billing',
    cancel_url: 'http://localhost:3000/profile/billing',
    subscription_data: {
      trial_period_days: 14,
    },
  });
#

this is all that happens now

topaz shoal
#

Okay so you would need to determine if they have previously had a free trial and dynamically adjust the trial_period_days parameter

austere tiger
#

Right, so I can just list the subscriptions from a customer then, and check if there are any, cancelled or not?

#

using the status=canceled

#

good to know

#

thanks

topaz shoal
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚

orchid tartanBOT