#TheNils-invoice items
1 messages Β· Page 1 of 1 (latest)
Hi tarzan
could you please elaborate more?
ok , to create an invoice,
I must first create invoice_items for each invoiced product.
After that I create my invoice and I have to set the pending_invoice_items_behavior to 'include' because otherwise I get an error saying that it is impossible to create an empty invoice.
in case the customer triggers two invoice creation processes at the same time, all pending invoice_items will be assigned to the first invoice and the second invoice will not be created
Hello π
Stepping in as tarzan needs to step away soon
what error are you getting when you set pending_invoice_items_behavior to exclude?
As that should allow you to create empty invoice
https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior
Can you confirm your API version?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
need a moment to reproduce and get the exact error
NP! π
StripeInvalidRequestError: Nothing to invoice for customer
ok i get it
the doc stated : Defaults to exclude if the parameter is omitted.
in fact if i ommit pending_invoice_items_behavior i get the error
but if i explicitly set it to exclude the error is gone
yup
maybe the doc need a little update so ? is there anywhere i can repport that ?
I haven't had a chance to reproduce this yet as discord is busy but I can test and flag it internally to get it fixed π
ok , thanks keep up the good workπ
yeah we are the in the middle of rewriting https://stripe.com/docs/invoicing/integration#create-invoice-code to use the correct new approach.