#M.Mixalis-checkout

1 messages · Page 1 of 1 (latest)

hushed dew
#

Hi! What do you mean by dd a discount amount directly to the session? You want to add the code using the API, or on the Checkout Session page direclty?

glossy leaf
#

checkout session page directly. without using the api for promo codes etc

hushed dew
glossy leaf
#

i have a lot of clients with custom pricings..

#

soma, i dont want to use promo codes in stripe's checkout session. I already have a checkout form on my website. i want to just redirect the user to stripe's checkout to pay. The customer may already used promo codes OR (important) have already discounts applied in his cart using custom pricing rules from my website.

hushed dew
#

Sorry I'm not sure I understand. For Checkout Session, you have two options to use coupons:

  • Use allow_promotion_codes to let your customer enter a promo code on the Checkout page
  • Use discount to dynamically pass a promo code with the API that will change the price customer will have to pay
#

What exactly are you trying to achieve?

glossy leaf
#

i do not want to use promo_code. i want the line_item base_price on the checkout to be shown as strike-through and the actual payable amount next to it.

hushed dew
#

So you would like to add a discount of specific line items.

glossy leaf
#

flat price discount on line_item is what i'm trying to achieve.
unit_amount field holds the final price right? i would like a base_unit_amount that would hold the base price for that line item.

ex. customer A has custom pricing -10% to a product category. (no other customer has that pricing). This pricing is not applied via promo_code. It is applied automatically when the customer logged in.

hushed dew
#

I think what you could do here is:

#

Would that work?

glossy leaf
#

but this seems to be the return of the session. not while creating it.

#

line_items.data.discounts.amount

hushed dew
#

Another option would be to not use discounts at all, and directly change the line_items.price_data with the correct price. And maybe use line_items.price_data.product_data.name or line_items.price_data.product_data.description to explicitely mention that there is a discount applied on the price.

glossy leaf
#

btw, this is exceptional support. thank you.