#jaypark
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Are you trying to create an empty invoice? If so, you'd likely want to set pending_invoice_item_behavior parameter
https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior
The API is returning an error because its looking for items to invoice for but there are none that can be included on the invoice.
if you set pending_invoice_item_behavior to exclude , it should create an empty invoice
Before sending invoice, I created two invoice items.
req_epASHVqwz6CJn7
req_4kt7Zij86CZsj3
I didn't want to create an empty invoice.
Two invoice items were created successfully, but Invoice.create had an error invoice_no_customer_line_items
huh interesting.. that's weird. Taking a look..
There are many pending invoice items due to that error. Should I delete this?
Can you try setting pending_invoice_item_behavior: include and see if that changes anything?
It is production. It is hard to try something unless it is solid solution.
hold on, checking with a colleague to be certain
Okay looks like the create invoice endpoint is looking for usd invoice items by default as that's the default on the customer ID provided.
You'd want to pass currency: cad while creating the invoice
https://stripe.com/docs/api/invoices/create#create_invoice-currency
That makes sense. Thanks. I will add it.
๐