0
votes

I charge Customers using this guide https://stripe.com/docs/connect/destination-charges adding amount, application fee and Service provider accound_id, after that I listen for "charge.succeeded" event with webhooks. If the payment was successful I generate invoice using this this guide - https://stripe.com/docs/billing/invoices/connect, but I get this error "Nothing to invoice for customer"

  1. Is it possible Stripe automatically to create Invoice for me?
  2. Do I have to manually create this invoice and then make it paid.
  3. Should I generate the Invoice before Payment or after Payment?
1

1 Answers

0
votes

When you process a payment, Stripe will send your customers a receipt automatically per your email settings [1]. In some respects, this receipt serves as an invoice of services rendered, and might be sufficient for your needs. You can see an example of what a receipt will look like for a given payment by looking at a given payment in the dashboard (under the 'Receipt history' heading).

Now, if the receipt automatically generated by Stripe doesn't meet your needs (e.g., you want to be able to list more customer info on there), then you'll want to use the Invoices API [2] instead of the Payment Intents API to process the payment. Using the Invoices API also allows you send the invoice to the customer so they can initiate payment on their own [3].

So, with that out of the way, if you intend to create Invoices for your customers you need to first create Invoice Items on the Customer and then create an invoice off that Customer. Once you finalize the Invoice, Stripe will either process a payment automatically under the hood, or send the Invoice to your Customers via email so they can initiate the payment (through a Stripe hosted page). At that point you can send your customers a copy of the Invoice PDF. With this integration there is no need to process the payment on your own or deal with any other APIs. The Invoices API takes care of everything for you. These steps are documented in detail here:

https://stripe.com/docs/billing/invoices/create

To answer your questions more directly:

  1. No. Stripe will only automatically create invoices when you make subscriptions. But, Stripe does automatically create receipts as described above.
  2. Yes, you manually would need to add Invoice Items to the Customer, then create an Invoice off that Customer. Note that this step will also charge the customer, so you don't need to do that separately.
  3. Invoices process the payment under the hood once they are finalized.

[1] https://stripe.com/docs/receipts [2] https://stripe.com/docs/billing/invoices/create [3] https://stripe.com/docs/api/invoices/create#create_invoice-collection_method