#Sudarshanan G

1 messages · Page 1 of 1 (latest)

buoyant nimbusBOT
topaz river
#

Are you creating the invoice item before or after creating the invoice?

subtle dock
#

before creating invoice

topaz river
subtle dock
#

thanks this works. but I just wanna know is there any drawback using 'pending_invoice_items_behavior' => 'include'

#

also I wanna to know how to clear pending_invoice_items if some error occurs while invoice creation

topaz river
#

thanks this works. but I just wanna know is there any drawback using 'pending_invoice_items_behavior' => 'include'
It will pull in any pending invoice items that have been created. You can't pick and choose which ones to include and so on.

The other option is to create the invoice first and then create the invoice item referencing that invoice
https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-invoice

also I wanna to know how to clear pending_invoice_items if some error occurs while invoice creation
You can just delete the invoice item
https://stripe.com/docs/api/invoiceitems/delete

subtle dock
#

ok thanks