How to change the amount_total on the Stripe Checkout page?

513 views
Skip to first unread message

Akash Kanaujiya

unread,
Apr 24, 2021, 7:23:24 PM4/24/21
to Stripe API Discussion
I am using stripe checkout to make the payment, I want to add the shipping cost without displaying the Shipping Address form. 

I didn't find any guide on this anywhere, if anyone can help will be great for me,

Thanks 

Remi J.

unread,
Apr 24, 2021, 7:27:38 PM4/24/21
to Stripe API Discussion
Hello!

The way you control the total amount is based on the line items you pass at the Session creation. The easiest solution is to rely on our ability to calculate shipping costs for you: https://stripe.com/docs/payments/checkout/shipping

If you don't want to use this feature, then the best solution is to pass a specific line item that represents your shipping cost. You'd create a Product and a Price for this cost and then when you create your session and pass the line item(s) for the items being bought you'd also pass an extra line item for the shipping cost. Doing this ensures that your customers see the expected total on the page without having to enter their shipping details.

Hope this helps!
Remi

--
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages