#oss-checkout
1 messages · Page 1 of 1 (latest)
Hello
Use this parameter https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-trial_end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
like this?
checkout_session = stripe.checkout.Session.create(
line_items=[
{
'price': PRICE_ID,
'quantity': 1,
},
],
mode='subscription',
subscription_data.trial_period_days = 14,
customer_email=email,
success_url=url_for('thankyou', _external=True),
cancel_url=url_for('initial', _external=True),
you many need to un-flatten the line subscription_data.trial_period_days
I think you would need smth like subscription_data= {trial_period_day=14}
Not familiar with syntax, sorry
This is what the website says:
subscription_data.trial_period_days
optional
Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.
Where does it go?
Yes, so it's 2 level parameters, I believe
subscription_data is inside Session, then trial_period_days is inside subscription_data
When i do this:::
trial_period_days=14,
customer_email=email,
success_url=url_for('thankyou', _external=True),
cancel_url=url_for('initial', _external=True),
I get an error on the webpage
Request req_4BUxDlj5IGadpX: Received unknown parameter: trial_period_days