#chibidragoon
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- chibidragoon, 4 hours ago, 15 messages
No, Checkout Sessions in payment mode will not automatically pull in invoice items that you create through the API.
is it possible to just create amounts then instead of prices? because when I tried it didn't work.
Which API version are you using for your requests?
v1/checkout/sessions
No, I mean the API version - if you share a request ID I can quickly check what it is for you
i have no idea, i am using the php request from the api so i am unsure where to get that information
Even just a CHeckout Session ID is enough
oh ok 2 seconds
cs_test_c1ajGIFN5jDIbBs7rCAyvDjbF7QzzNwsCnBApQQNmZLc5l5fLTO521Wnck
i'm sorry this one was one that worked when i tried a new method
req_NsGQ30r8sY6h2X, it mentions that i have an issue of tax behavior
Let's back up - is your issue actually with tax behavior? Or are you still asking how to just pass in specific amounts?
i didnt see the issue was with tax_behavior, i passed values like i did with my invoice and saw an error
and when i took a look at the documentation, it felt like i had to use a price so I was wondering if the data I sent was just completly wrong
Yeah I think you're a bit mixed up with all the parameters - Checkout Sessions and Invoices are not a 1:1 match, so you can't just do the exact same thing
You should start by taking a look at line_items.price_data (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data). This will allow you to specify a unit_amount, currency, etc - similar to what you were doing with Invoices
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok so i would have to generate dynamic prices for each line item basically?
also will that create a price or will it be destroyed afterwards?
It'll create a price for you (it won't destroy it)
so it my list of prices, i would have alot of them then correct?
Yes, you'd have a lot of them (but there's no limit to the number you can create)
so if i need like 4-5 for one transaction, i would have 4-5 new ones each time then 🤨
Yes, but that's the tradeoff you'd have to make if you don't want to create those prices up front
the price is dynamic so i cannot make it
unless it is possible to change the price of an existing product?
No, that's not possible - so really this is your best option to create these one-off prices
and this is why i was using invoices 🤣
Yeah that's fair - I will say that using price_data is what we recommend for your exact use case (of needing a dynamic price for each session) https://stripe.com/docs/products-prices/how-products-and-prices-work#create-or-import-products-and-prices
but you're welcome to continue using Invoices if that works better for you
basically, I am trying to add a card to a user and make a payment at the same time. Using invoice would be impossible because I cannot create the card using the API directly anymore so I am trying to resolve this issue using checkout now for this case
With Invoices you can use the Hosted Invoice Page to collect payment https://stripe.com/docs/invoicing/hosted-invoice-page
You'd create the Invoice first, and then send the link to your user to finish paying
so i could send that page by email let's say to a client so he could finish his payment correct?
yup!
@indigo nest let me know if there's more questions
yes thnak you, I am looking at the options available 🙂