#.abishek

1 messages · Page 1 of 1 (latest)

devout tartanBOT
vivid linden
#

When you say "set the price", do you mean passing an amount, currency, etc, instead of a price ID?

gilded lichen
#

yes

vivid linden
gilded lichen
#

is it always priceId or custom amount? can I not pass both?

vivid linden
#

Right, you'll either use line_items.price or line_items.price_data, not both

#

well, per line item.

gilded lichen
#

ok that helps. I am going to use price_data, but is there no way to add line item specific discounts there on price_data?

#

because we have our own coupon functionality and we want to pass the discount amount to the checkout page

vivid linden
#

Ah, I see. Not exactly. The only way to do this is to configure coupons on Stripe that apply to a given product(s), and use that product ID when passing line_items.price_data

#

It sounds like you'll likely want to calculate the discount prior to creating the Checkout Session

gilded lichen
#

yes, the reason we do that is because we offer multiple payment options, so they can select any and we want the discount to be calculated before they come to the checkout page on stripe.