#mariotux
1 messages ยท Page 1 of 1 (latest)
Hi there
You are likely on an older API version so pending_invoice_items_behavior is not set by default: https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior
With this behavior you need to create the invoice item first before the invoice
Or, you can specify pending_invoice_items_behavior and it will work
I am using old version, yes
how?
pending_invoice_items_behavior: include
?
it seems should be exclude, Am I right?
In this case it won't really matter since you are creating the invoice first
perfect this works
should I have to open another thread to talk about another thing?
by the way, thank you for your help @thin field
I will open another thread to not generate noise in this topic, thank you.
Nope
You can use this same thread for any questions!
I'm happy to help with any dev questions you have
Moving into the thread @signal niche !
Hello again! I am trying to create an invoice with a negative amount. It is a manual invoice using the API, do I need to create a price object to use it in the InvoiceItem ?
thanks
You can't create price items with negative amounts. However, you can create invoice items with negative amounts
So you would do exactly what you are doing above but just use a negative amount there
I am trying to create an invoice item with a negative amount
but the price parameter is expecting a price object
Am I wrong?
can I use amount an that's it
For invoice items you can use amount and that's it
perfect
next step
Stripe::Invoice.send_invoice(stripe_invoice.id)
You can only manually send an invoice if its collection method is 'send_invoice'. (Stripe::InvalidRequestError)
do I have to create the invoice with the send_invoice as collection method?
I had problems when I tried it
If invoice collection method is 'send_invoice', you must specify 'due_date' or 'days_until_due'. (Stripe::InvalidRequestError)
I would like to create it now for now ๐
do I have to define the days_until_due to go forward?
I am asking that because using the UI I didn't see this option
adding the days_until_due it worked
I am going to verify it in the ui if it did that expected
thanks