#maxim-k_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/1333537360947707924
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
When you say not create it but just preview, are you referring to the upcoming_in_xxx that's created via preview invoice endpoint? https://docs.stripe.com/api/invoices/create_preview
Hi!
So, we have a payment form where we render products from shppping cart
with coupons etc etc
create preview failed, it says "code"
:
"invoice_upcoming_none"
,
so we need to render on the form item lines, total price exaclty as it will be on the future invoice
Is it for a one-time payment or subscriptions?
maybe it is an option to create regular invoice and keep it draft?
One time payment
No subscription
Are you adding invoice_items parameter when calling the API?
https://docs.stripe.com/api/invoices/create_preview#create_create_preview-invoice_items
That's where you'd add your products
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
no, just an example stripe invoices create_preview --customer=cus_RfIgYlUobiwzKZ
stripe invoices create_preview --customer=cus_RfIgYlUobiwzKZ
That code is only trying to get a preview of customer's upcoming invoice (assuming they're subscribed to a subscription or if they have a pending invoice item)
Since the customer you're working with doesn't have either, you'd need to pass the invoice_items separately