#rob-checkout-cart
1 messages · Page 1 of 1 (latest)
Can you clarify what you mean by Cart here?
What exactly are you trying to add where?
i thought stripe coiuld do this but correct me if im wrong...
I have a site with products, i want to add the product to a stripe cart, then once complete, purchase the items in the cart in a stripe checkout page
or do i add the items to a local cart, and then transfer the local cart to a stripe checkout?
add the product to a stripe cart
I'm not sure what you mean by this
You can send a list of products/prices to create a checkout session, but the "cart" abstraction is soemthing you would implement
Then send those details to the Stripe API
right i see, i think thats where my confusion is, i had it in my head that stripe had a cart feature
We do not -- you'd track that part then map your "cart" items to the line_items API structure
so the flow is:
- Add item to site cart
- Transfer cart items to stripe checkout session
- Complete checkout in stripe
Yep!
do the products themselves need to exist in stripe? as in, as well as adding them to my site, i also need to add them to stripe, and its the price_12345 id that connects the product in my site to the product in stripe?
Up to you, but you can optionally use price_data and product_data to define price and product details ad-hoc
Though if you expect to pay for the same price/product repeatedly I'd suggest creating fixed price/product objects.
rob-checkout-cart
in that same create session api call?
yes
what are the positives and negatives to creating them adhoc over having them as products in stripe?
Analytics/reconciliation is a big one. If you always create everything ad-hoc then you have no way to simply analyze what Product was sold the most, what Price is more popular, etc.
If it were me I would import my product catalog in Stripe and then use the relevant Price ids price_123