#ayush_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1415428694133964941
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- ayush_docs, 1 hour ago, 25 messages
- ayush_code, 3 hours ago, 34 messages
- ayush_custom-connected-account, 21 hours ago, 45 messages
Hello there
Hi! How are you doing?
When you create your Checkout Session you can add a line item dynamically by using line_items.price_data: https://docs.stripe.com/api/checkout/sessions/create?api-version=2025-08-27.basil#create_checkout_session-line_items-price_data
good thanks
Great! When I use price data can I use a pre generated Price object?
As I have already created my products on my dashboard
pre generated Price or Product?
Product
You can set a pre-created Product: https://docs.stripe.com/api/checkout/sessions/create?api-version=2025-08-27.basil#create_checkout_session-line_items-price_data-product
But if you are using a pre-created Price then you aren't creating dynamically here and you would just pass that Price ID to line_items.price: https://docs.stripe.com/api/checkout/sessions/create?api-version=2025-08-27.basil#create_checkout_session-line_items-price
Ok after adding line_items.price_data.product, if I want to add another item to cart for example called fee and make it 5% of the total amount
can I do that?
Yes you can add up to 100 line items in payment mode. You would have to calculate the 5% yourself though as you have to set a fixed amount, not a percent.