#lukas-checkout-product
1 messages · Page 1 of 1 (latest)
Hi there, you can use checkout with ad-hoc product or existing prouduct
Use line_items.price for existing product/price, or line_items.price_data for adhoc product/price
see 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.
In the Checkout session I can use an ad-hoc Product, but then on UpdateSubscription, I cannot refer to that Product and I can't create a new ad-hoc Product?
You can. Basically Stripe created a new product under the hook.
There are many ways to get subscription
- Listening to the customer.subscription.created event https://stripe.com/docs/api/events/types#event_types-customer.subscription.created
- Pass the customer ID to list the subscription https://stripe.com/docs/api/subscriptions/list
You can get the price object from subscription object from items.data.price https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-price
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.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah, but as per yesterday's thread (message link #dev-help message) I understood that that Product that is created is automatically Archived without a possibility of referral from UpdateSubscription endpoint. It also is not possible to 'Unarchive' it. And UpdateSubscription does not have 'Product_data parameter to create a new Product.
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
If that's the case, i'll say it's safer to create the produce/price up front, and pass the ID to the checkout session creation API call.
Thanks. We don't want to create products beforehand in the Dashboard, but we can use CreateProduct API when creating session to make a Product.
If I have other questions (could be only loosely related to this one), should I post it back in dev-help or here?
sure we can continue the discussion here
Is the test_clocks API working? I tried to create one, but I am getting 'Unrecognized request URL error'
that would mean your account is not in the beta for that feature
Thanks. I've applied for the feature from https://stripe.com/docs/billing/testing/test_clocks, is it possible that I will get it, or I shouldn't wait for that?
definitely possible! I'm not sure what the timeframes are, but that is how you apply yep so the team would be in touch.
Got it, thanks. I will relay this info back to my team and will be waiting for any news.