#erikvm-checkout-trial-period
1 messages ยท Page 1 of 1 (latest)
Thanks
can you send me the exact code snippet?
checkout_session = stripe.checkout.Session.create(
trial_period_days=7,
allow_promotion_codes=True,
customer_email=customer.email,
success_url=domain_url + "?session_id={CHECKOUT_SESSION_ID}",
cancel_url=domain_url,
payment_method_types=["card"],
mode="subscription",
line_items=[
{
"price": basic_plan
"quantity": 1,
},
],
)
Ops, forgot the. trial part, one sec
looks like trial_period_days needs to be nested under subscription_data
Is subscription_data an array?
Like line_items
Judging from https://stripe.com/docs/billing/subscriptions/trials - not sure
Maybe its not even possible in the checkout session?
it should be a hash/dictionary
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you! That did the trick
Great! glad that worked ๐