To create an invoice, pass the customer ID and a price:
To simplify the example,
auto_advance is set to
true. This means Stripe automatically finalizes the invoice after a few hours, making the invoice ready for payment. Emails aren’t sent in test mode but you can verify that the invoice was created by checking the Invoices section of the Dashboard. The invoice has a Scheduled status until it’s automatically finalized.
If you set
false, you can continue to modify the invoice until you finalize it. You can finalize a draft invoice using the Dashboard by sending it to the customer or paying it. You can also use the finalize API: