Sending Invoices to Customers

    Send one-off invoices or automatic subscription invoices. Optionally, include a customizable payment page for easy payment.

    There are two ways to collect payment for one-off invoices and subscriptions:

    • Charge invoices automatically through Stripe, using the customer’s default payment source.
    • Send an invoice to a customer via email. These email invoices can be used for both subscriptions and one-off invoices, and can optionally include a Stripe-generated payment page.

    Before sending an invoice

    Before sending an invoice, you should ensure that you’ve customized the invoice in the Dashboard with your logo, information, and brand color.

    • Under Public information, double-check that you have all the correct contact information visible for your users. (The information that you enter here is rendered on the invoice.)
    • Under Customer emails, ensure that you have the icon and brand color you would like to appear on your invoice.

    Next, ensure that the invoices’ payment settings are correct for your business. In the Dashboard’s Billing Settings:

    • You can set default payment terms, email reminder schedules, and message text (Default memo) for new invoices.
    • Select whether you’d like to send Stripe hosted payment pages with each invoice. You can select the default payment methods you’d like to offer on your invoices. These payment pages are generated on a per-customer basis, and incorporate your logo and color choice.

    Optionally, you can customize the invoice-number prefix for a customer. By default, Stripe automatically generates these prefixes, populating them with a random alphanumeric string. To customize the prefix, update the customer’s details and set their invoice prefix. You can also update the prefix through the API’s invoice_prefix field.

    A sample invoice

    A corresponding email

    Sending one-off invoices

    You can email one-time invoices to your customers. First, create invoice items for the customer you would like to invoice:

    curl https://api.stripe.com/v1/invoiceitems \
       -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
       -d amount=1000 \
       -d currency=usd \
       -d customer=cus_4fdAW5ftNQow1a \
       -d description="One-time setup fee"
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    Stripe::InvoiceItem.create({
        amount: 1000,
        currency: 'usd',
        customer: 'cus_4fdAW5ftNQow1a',
        description: 'One-time setup fee',
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    stripe.InvoiceItem.create(
      amount=1000,
      currency='usd',
      customer='cus_4fdAW5ftNQow1a',
      description='One-time setup fee',
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    \Stripe\InvoiceItem::create([
        'amount' => 1000,
        'currency' => 'usd',
        'customer' => 'cus_4fdAW5ftNQow1a',
        'description' => 'One-time setup fee',
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    Map<String, Object> params = new HashMap<>();
    params.put("amount", 1000);
    params.put("currency", "usd");
    params.put("customer", "cus_4fdAW5ftNQow1a");
    params.put("description", "One-time setup fee");
    InvoiceItem invoiceItem = InvoiceItem.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    stripe.invoiceItems.create({
      amount: 1000,
      currency: 'usd',
      customer: 'cus_4fdAW5ftNQow1a',
      description: 'One-time setup fee',
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    params := &stripe.InvoiceItemParams{
      Amount: stripe.Int64(1000),
      Currency: stripe.String(string(stripe.CurrencyUSD)),
      Customer: stripe.String("cus_4fdAW5ftNQow1a"),
      Description: stripe.String("One-time setup fee"),
    }
    ii, _ := invoiceitem.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    var options = new InvoiceItemCreateOptions {
        Amount = 1000,
        Currency = "usd",
        CustomerId = "cus_4fdAW5ftNQow1a",
        Description = "One-time setup fee",
    };
    var service = new InvoiceItemService();
    InvoiceLineItem invoiceItem = service.Create(options);
    

    Next, create an invoice for that customer:

    curl https://api.stripe.com/v1/invoices \
       -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
       -d customer=cus_4fdAW5ftNQow1a \
       -d billing=send_invoice \
       -d days_until_due=30
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    invoice = Stripe::Invoice.create({
        customer: 'cus_4fdAW5ftNQow1a',
        billing: 'send_invoice',
        days_until_due: 30,
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    invoice = stripe.Invoice.create(
      customer='cus_4fdAW5ftNQow1a',
      billing='send_invoice',
      days_until_due=30,
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    $invoice = \Stripe\Invoice::create([
        'customer' => 'cus_4fdAW5ftNQow1a',
        'billing' => 'send_invoice',
        'days_until_due' => 30,
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    Map<String, Object> params = new HashMap<>();
    params.put("customer", "cus_4fdAW5ftNQow1a");
    params.put("billing", "send_invoice");
    params.put("days_until_due", 30);
    Invoice invoice = Invoice.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    const invoice = stripe.invoices.create({
      customer: 'cus_4fdAW5ftNQow1a',
      billing: 'send_invoice',
      days_until_due: 30,
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    invoice = params := &stripe.InvoiceParams{
      Customer: stripe.String("cus_4fdAW5ftNQow1a"),
      Billing: stripe.String(string(stripe.InvoiceBillingSendInvoice)),
      DaysUntilDue: stripe.Int64(30),
    }
    inv, _ := invoice.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    var options = new InvoiceCreateOptions {
        CustomerId = "cus_4fdAW5ftNQow1a",
        Billing = Billing.SendInvoice,
        DaysUntilDue = 30,
    };
    var service = new InvoiceService();
    Invoice invoice = service.Create(options);
    

    Calling the above command will create a draft invoice that you can continue to update. Once you are satisfied, you can finalize the invoice and send it to the customer:

    curl https://api.stripe.com/v1/invoices/in_18jwqyLlRB0eXbMtrUQ97YBw/send \
       -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
       -X POST
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    invoice.send_invoice
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    invoice.send_invoice()
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    $invoice->sendInvoice();
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    invoice.sendInvoice();
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    stripe.invoices.sendInvoice(invoice.id, function(err, invoice) {
      // asynchronously called
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    params := &stripe.InvoiceFinalizeParams{}
    i, err := invoice.SendInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw", params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    var sendOptions = new InvoiceSendOptions{};
    var service = new InvoiceService();
    Invoice invoice = service.SendInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw", sendOptions);
    

    As with subscription invoices, one-off invoices are sent to the email address associated with the customer.

    Sending invoices with subscriptions

    If you sell to other businesses, self-serve credit card payments aren’t always the norm. Instead, customers might ask that you send them an invoice, which they’ll pay on their own schedule. Stripe can help you take care of status tracking and retry settings on these invoices.

    If you would like to send out invoices that bill on a regular interval, start by creating a subscription with the Subscription object’s billing attribute set to send_invoice.

    curl https://api.stripe.com/v1/subscriptions \
       -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
       -d customer=cus_4fdAW5ftNQow1a \
       -d items[0][plan]=plan_CBb6IXqvTLXp3f \
       -d billing=send_invoice \
       -d days_until_due=30
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    subscription = Stripe::Subscription.create({
        customer: 'cus_4fdAW5ftNQow1a',
        items: [{plan: 'plan_CBb6IXqvTLXp3f'}],
        billing: 'send_invoice',
        days_until_due: 30,
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    subscription = stripe.Subscription.create(
      customer='cus_4fdAW5ftNQow1a',
      items=[{'plan': 'plan_CBb6IXqvTLXp3f'}],
      billing='send_invoice',
      days_until_due=30,
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    $subscription = \Stripe\Subscription::create([
        'customer' => 'cus_4fdAW5ftNQow1a',
        'items' => [['plan' => 'plan_CBb6IXqvTLXp3f']],
        'billing' => 'send_invoice',
        'days_until_due' => 30,
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    Map<String, Object> item = new HashMap<>();
    item.put("plan", "plan_CBb6IXqvTLXp3f");
    Map<String, Object> items = new HashMap<>();
    items.put("0", item);
    Map<String, Object> params = new HashMap<>();
    params.put("customer", "cus_4fdAW5ftNQow1a");
    params.put("items", items);
    params.put("billing", "send_invoice");
    params.put("days_until_due", 30);
    Subscription subscription = Subscription.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    const subscription = stripe.subscriptions.create({
      customer: 'cus_4fdAW5ftNQow1a',
      items: [{plan: 'plan_CBb6IXqvTLXp3f'}],
      billing: 'send_invoice',
      days_until_due: 30,
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    items := []*stripe.SubscriptionItemsParams{
      {Plan: stripe.String("plan_CBb6IXqvTLXp3f"),},
    }
    params := &stripe.SubscriptionParams{
      Customer: stripe.String("cus_4fdAW5ftNQow1a"),
      Items: items,
      Billing: stripe.String(string(stripe.InvoiceBillingSendInvoice)),
      DaysUntilDue: stripe.Int64(30),
    }
    subscription, _ := sub.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    var items = new List<SubscriptionItemOption> {
        new SubscriptionItemOption {PlanId = "plan_CBb6IXqvTLXp3f"}
    };
    var options = new SubscriptionCreateOptions {
        CustomerId = "cus_4fdAW5ftNQow1a",
        Items = items,
        Billing = Billing.SendInvoice,
        DaysUntilDue = 30,
    };
    var service = new SubscriptionService();
    Subscription subscription = service.Create(options);
    

    For each billing cycle, Stripe generates an invoice associated with that subscription. Stripe automatically sends an email to your customer’s email address approximately one hour after delivering the invoice.created webhook event. When the email is sent, Stripe emits the invoice.sent webhook.

    The webhook payload includes all the details about the invoice, such as merchant and customer address, line items, final payment amount, due date, and payment method.

    Line items and payment amount are determined by the properties of the subscription, as well as by any one-off items added to the invoice. The due date is the invoice creation date plus the value of the subscription’s days_until_due attribute.

    Retry settings

    When sending invoices to your customers, Stripe sends your customers payment reminders on a pre-defined schedule. Reminders include payment instructions and a copy of the original invoice.

    You can also initiate an email yourself from the Stripe Dashboard. Display the invoice and click its Send invoice button.

    Overdue payments

    An invoice is considered overdue when its due date has passed and the invoice hasn’t been paid. Stripe will normally continue to remind your customer to pay the invoice even after the due date. However, by modifying your Billing Settings, you can disable automatic collection on the invoice when it becomes past due.

    When the latest invoice for a subscription becomes past due, the subscription’s own status changes to past due. Depending on your Billing Settings, overdue invoices can cause the subscription to automatically be marked unpaid or canceled.

    Sending invoices by email

    You can customize invoice emails via the Stripe API.

    Manually sending emails

    Depending on your Billing Settings, finalizing the invoice might not automatically email the invoice to the customer. If your account is configured to not email the invoice to the customer, you can still manually request email delivery of the invoice email by calling the /send endpoint.

    curl https://api.stripe.com/v1/invoices/:id/send \
       -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
       -X POST
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    invoice = Stripe::Invoice.retrieve("in_18jwqyLlRB0eXbMtrUQ97YBw")
    invoice = invoice.send_invoice
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    invoice = stripe.Invoice.retrieve("in_18jwqyLlRB0eXbMtrUQ97YBw")
    invoice.send_invoice()
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    $invoice = \Stripe\Invoice::retrieve("in_18jwqyLlRB0eXbMtrUQ97YBw");
    $invoice->sendInvoice();
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    Invoice invoice = Invoice.retrieve("in_18jwqyLlRB0eXbMtrUQ97YBw");
    invoice.sendInvoice();
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    var stripe = require("stripe")("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    stripe.invoices.sendInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw", function(err, invoice) {
      // asynchronously called
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    params := &stripe.InvoiceFinalizeParams{}
    i, err := invoice.SendInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw", params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.SetApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc");
    
    var sendOptions = new InvoiceSendOptions{};
    var service = new InvoiceService();
    Invoice invoice = service.SendInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw", sendOptions);
    

    Building your own email templates

    You can implement your own custom-designed email templates to replace Stripe’s built-in Billing emails. Doing so is straightforward with our comprehensive set of webhook events.

    Stripe can send webhooks to your application to notify you of changes within Stripe, such as invoices’ being finalized, paid, and marked uncollectible. For each event that you receive, you can construct and deliver your own emails.

    Stripe sends the following events during the invoice lifecycle: invoice.created, invoice.finalized, invoice.sent, invoice.payment_succeeded.

    In the Dashboard’s Billing Settings, you can disable all of Stripe’s automatic invoice emails by making appropriate selections in the Invoice schedule section. When emails are disabled, the emails will not be sent, but you will continue to receive webhooks as normal. This way, you can use Stripe’s invoice reminders to power your own email solution.

    Questions?

    We're always happy to help with code or other questions you might have! Search our documentation, contact support, or connect with our sales team. You can also chat live with other developers in #stripe on freenode.

    Was this page helpful? Yes No

    Send

    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.