#rob-checkout-cart

1 messages · Page 1 of 1 (latest)

pseudo solarBOT
clever dagger
#

Can you clarify what you mean by Cart here?

#

What exactly are you trying to add where?

smoky hawk
#

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?

clever dagger
#

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

smoky hawk
#

right i see, i think thats where my confusion is, i had it in my head that stripe had a cart feature

clever dagger
#

We do not -- you'd track that part then map your "cart" items to the line_items API structure

smoky hawk
#

so the flow is:

  1. Add item to site cart
  2. Transfer cart items to stripe checkout session
  3. Complete checkout in stripe
clever dagger
#

Yep!

smoky hawk
#

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?

pseudo solarBOT
clever dagger
#

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.

zenith dune
#

rob-checkout-cart

smoky hawk
#

in that same create session api call?

zenith dune
#

yes

smoky hawk
#

what are the positives and negatives to creating them adhoc over having them as products in stripe?

zenith dune
#

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

smoky hawk
#

aaah, yeah good point! glad i asked!

#

thanks for your help, much appreciated!!