#some1ataplace_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1257747280199422044
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Hello! Are you using Stripe Checkout or something else?
checkout
I would rather have my users enter into a form on my website the promo code before getting redirected to checkout
That's not really how Checkout works. Checkout supports entering Promotion Codes inside Checkout: https://docs.stripe.com/payments/checkout/discounts#promotion-codes
You can do what you want, but it's more work.
Yes I understand it is more work, but I am using other payment APIs besides stripe. So I need to use a form on my website.
You would need to create a Checkout Session with the discount already applied: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-discounts
I see. So I need a price ID. No product ID ?
This is what I did for my recurring payments:
Now I am wondering how to do it for one time cart payments.
You can specify ad-hoc Price and Product data using price_data if you don't want to create a Product or Price ahead of time.
where do you see price_data? Which API object?
It's on Checkout Session line items: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Ah okay. So even though each of my cart items are different prices, I would still create a product on the stripe dashboard? Imagine the cart is like Amazon. I would have 1 product ID for all shirts, another product ID for all shoes, etc? Or can I have only 1 product ID for all cart items?
You can create a Product on the Stripe Dashboard, or you can specify product_data under price_data: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data-product_data
You can do whichever works best for your use case.
Okay cool. So the validation code I sent in the dpaste would be the same, except it would be for the other type of product id (the cart one, not the subscription one).
Would this be a product where Customer chooses price or package pricing?
That's up to you. I recommend experiementing in test mode until you get the experience and behavior you want.