#RG-invoicing
1 messages · Page 1 of 1 (latest)
ola! I'm currently working on the invoicing Api: https://stripe.com/docs/api/invoices/create
I'd like to create an invoice after the payment is done, but then I get the message "Nothing to invoice for customer"
That's normal, you cannot create an empty invoice directly.
You first need to create at least one Invoice Item
https://stripe.com/docs/api/invoiceitems/create
Then you create the invoice and it will automatically include all Invoice Items you created previously.
Ohh, I see. That's great. Would it create another charge to the customer with that? Since the charge has already been done previously this shouldn't happen
A charge will be created when your invoice is finalized. Creating individual Invoice Item won't create a charge.
Perfect, then I get the picture. Thank you kindly for the support!
Hey, quick question, I just Created the code for it shows up like this:
Is there a way to finalize it without charging the customer?
Hi there, I'm stepping in for soma. No, there isn't. Our invoices are also part of our collection flow, so they automatically charge. What is it you're trying to accomplish by creating an invoice?
We're already making the charge before, and after we'd like to save an invoice separately
So then it'd be a double charge if we'd create an invoice later on?
Yes it would be
You could leave them in a draft state to avoid them charging, but that could get confusing
Ah yes. Could the invoice number be added instead of the "Draft" in that case?
Or could it be a solution if we'd remove the charge in the Php code above and use the invoicing instead?
Would the sepa debit charge be exactly the same because of the SourceObject that contains the Iban?
It would be the same. When you create the invoice for the customer, you can specify exactly which source it should use with the default_source parameter:
https://stripe.com/docs/api/invoices/create#create_invoice-default_source
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If the default_source isn't set on the invoice object, then we have fallback logic to pull it from the associated subscription (if there is one) or the customer's default source.
Got it! I'll do it that way then, thanks!