#brian_subscription-bca

1 messages · Page 1 of 1 (latest)

livid wedgeBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1466860915876958258

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

slim oak
#

For more clarification, i mean a subscription where the user has X (say, 14 days) on the free trial for the subscription, before rolling over into a normal paid subscription where the billing cycle anchor is on the 1st of the month

#

Stripe seems to keep giving me errors regardless of what features / settings I use

elder forge
#

brian_subscription-bca

#

I think we just don't support ⁨billing_cycle_anchor_config⁩ that way and you need to calculate ⁨billing_cycle_anchor⁩ yourself in that case

slim oak
#

Right, so I tried using trial_period_days + billing_cycle_anchor⁩ but this also gives the error Stripe Error: You may only specify one of these parameters: billing_cycle_anchor, trial_period_days.

elder forge
#

does it work if you also pass ⁨trial_end⁩ instead?

slim oak
#

Stripe Error: You may only specify one of these parameters: billing_cycle_anchor, trial_end.

elder forge
#

well my bad, I was convinced we supported this. Can you share your request id so I can dig deeper in the code

slim oak
#

Yup! req_Fe0TQOIPop6Hny

elder forge
#

ahhhhh I get it it's because you use Checkout, you aren't creating that Subscription yourself

#

So yeah unfortunately Checkout just doesn't support this feature today at all so it's not possible to approach it this way unless you move away from Checkout

slim oak
#

I see - would the solution be to create the subscription manually by first creating a Payment embed on my dashboard then programmatically creating the subscription?

elder forge
#

no that's not really how our API works. You would need to create the Subscription first and then collect the payment method details from the end customer to charge them at the end of the trial. But not by using Checkout

slim oak
#

Sorry I'm a little confused - so would something like this work?

  1. I ask customers to enter credit card details using @stripe/react components, then save them to the Stripe customer
  2. I create a subscription using stripe.subscriptions.create() for the customer, with both a trial_end and billing_cycle_anchor
  3. Stripe automatically handles the rest
elder forge
#

Sorry there are so many ways to integrate it's really hard to know where to start

The right guide is https://docs.stripe.com/billing/subscriptions/build-subscriptions?payment-ui=elements&api-integration=paymentintents

  1. Create the Subscription.
  2. Use the Subscription SetupIntent in ⁨pending_setup_intent⁩ to collect card details properly

I recommend trying this end to end in Test mode to get a feel for how it works, including using TestClocks https://docs.stripe.com/api/test_clocks to see what happens when you advance times and see future Invoices