#eyupensar
1 messages · Page 1 of 1 (latest)
Hello eyupensar, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• eyupensar, 1 days ago, 4 messages
Hi there!
You want end users to be able to type a promotion code in the Checkout Session page?
yes
Then you should use this parameter: https://stripe.com/docs/api/checkout/sessions/create?lang=node#create_checkout_session-allow_promotion_codes
thank you sir. It works now. When I apply a discount coupon, I want 1 of the products to be free. It makes all 3 products for free.
When you create the coupon, make sure to use this parameter: https://stripe.com/docs/api/coupons/create?lang=node#create_coupon-applies_to
So that the coupon only applies to some specific product (and not all)
yeah it is only applied to cap but. I don't want the discount to be applied to each of the 3 caps, but only to 1 of them.
If it's the same product 3 times, then yes the coupon will apply to all 3 of them.
Maybe you could create a 30% discount instead of a 100% discount in this case?
I'm giving someone a discount coupon as a raffle prize. The person who has this coupon can buy a product from the site for free. But if he added different products to the cart, he must pay for the others.
Then you can't really use Stripe coupons for this. Instead you should use your own coupon system. For example:
- On your own page, ask the user to enter their coupon
- Then check the coupon with your own logic, and then create the Checkout Session with the correct discount https://stripe.com/docs/api/checkout/sessions/create?lang=node#create_checkout_session-discounts