#tyson
1 messages ยท Page 1 of 1 (latest)
HI ๐ you do not need to create the Subscription before the Checkout Session, the Checkout Session will create the Subscription for you while the customer is checking out.
You can create the Price object ahead of time, or you can use the price_data parameter to provide enough information for the Checkout Session creation request to create a Price on the fly:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So really there are two questions, 1 is there a good way of making a subscription that can be referenced in a checkout session with one call? can I do it all with
is it the same with subcription
Sorry, that doesn't really make sense, you don't reference Subscriptions when creating Checkout Sessions.
What is it that you're trying to accomplish?
ooo ok
i am creating a checkout session for a subcprtion
My users create a account and make subscriptions for there customers
What do I need to allow my connect users to create is it only price id when they create a membership for purchase and then say the recurring interval in the checkout call ?
No, the recurring interval is defined on the Price object (unless you're using price_data, then yes you provide that information ad-hoc).
Have you stepped through our guide for creating a Subscription with a Checkout Session? I think it'll help lay the foundations of the flow you're working on.
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout
ok thanks