#icetexx - checkout line items
1 messages ยท Page 1 of 1 (latest)
Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐
What exactly are you trying to do? Can you share example code or a failing request?
Have you reviewed the docs here explaining how to create checkout sessions with line https://stripe.com/docs/payments/accept-a-payment?platform=web#redirect-customers
Well... Sorry for wasting your time ^^
I just misread the documentation...
No problem! All set now?
But I have another question ^^
Can we create a PriceData with a negative value ?
For example when we want to add a trade discount.
No, it needs to be nonnegative, as documented:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-unit_amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So, how can we add discount ?
For the overall session, you can use coupons / promo codes, for example, or adjust the price of the line item to be less
https://stripe.com/docs/payments/checkout/discounts
Hmm ok !
So the last question is : Can we create a discount on the fly ? Or are we forced to create it before ?
For example a pro create an offer for the client and define a custom discount. How should I handle the discount ?
You need to define that coupon/promo code then, and attach it to the session:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Just as in the docs above