#cd
1 messages · Page 1 of 1 (latest)
hello! maybe try Checkout Sessions? https://stripe.com/docs/payments/checkout
Is there a way to later retrieve all the Checkout Sessions a user has completed? I.e. their purchases?
you can use this API : https://stripe.com/docs/api/checkout/sessions/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Is there any way to filter by paid?
Basically, it doesn't seem like the CheckoutSessions object was designed for displaying an "Orders" page, where a customer can see all their previous orders. This seems like a common use-case. Am I missing something?
It depends on how your UI / UX is designed
The UX is like a pretty typical ecomm site: A user builds a Cart -> they checkout with that Cart -> later, they want to see their past purchases.
if you just want to display a high level detail of the orders first, you can do a search for PaymentIntents -> filter by customer id and status as succeeded
once the user clicks into the specific order, you can pull the specific Checkout Session : https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-payment_intent
The PaymentIntent list would also include PaymentIntents associated with Subscriptions too though, right?
ah yes
if that doesn't work for you, then you would have to list all Checkout Sessions and do your own filtering
It works, but just seemed like weird UX, given how common the use-case is.
Will there be a successor to the Orders API? That might make this use-case simpler?
I don't know of the future plans for that off the top of my head right now, but if you email Stripe Support https://support.stripe.com/contact/email, they should be able to tell you more (if there's any plans)
Last thing -> do you know if you can pass an ID to the line_items.price_data.product_data field when creating a Checkout Session? Like you could with the Orders API?
I'd like to find-or-create a Product when creating a user "Cart"
You can pass an ID?
oh, sorry, i misread, you would pass a Product ID here : https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-product
hrm, unfortunately not, there's no such parameter when creating the Checkout Session
Hmm, too bad. Do you know why they're getting rid of the Orders API? It seems like it fit my use-case well. Which is very typical ecomm...
Hi @fallen aurora I'm taking over.
Thanks! Any ideas on the above?
Is it about orders API?
Yea, do you have access to the previous messages?
Yes I can see them.
Any idea on how to model a basic "Cart" and then list a customer's previous purchases? Without the Orders API?
I believe Alex has already answered this question. Is there something that you wish to clarify?
Ahhh, I thought when you said you were "taking over", it was because you had some extra domain expertise.
All good. Looks like I'm out of luck here.