Sending Invoices to Customers

    Send automatic subscription invoices or manual or one-time invoices. Include a customizable payment page for easy payment.

    There are two ways to collect payment for subscriptions and one-time invoices.

    The first way is to charge invoices automatically through Stripe, using the customer’s default payment source. Stripe attempts multiple payments on the invoice according to your payment retry settings before failing the invoice. If the invoice is associated with a subscription, successful completion of the invoice payment also updates the status of the subscription. Learn more about automatic subscription invoicing.

    The second way to collect payment is by sending an invoice to a customer via email. These email invoices can be used for both subscriptions and one-time invoices, and can optionally include a payment page.

    Before sending an invoice

    Before sending an invoice, you can customize the branding of the invoice email and payment page. You can also set defaults for the information presented on the invoice. Under Public Information, double check that you have all the right contact information visible for your users. Under the Customer Emails section, ensure that you have the icon and brand color you would like to appear on your invoice.

    On the Billing settings section of the Dashboard, you can set payment terms, email resending settings, and set default message for each of your invoices.

    You can select the default payment methods you’d like to offer on your invoices. You can offer card payments and push payments in the U.S. (ACH credit transfer and wire). These payment pages are generated on a per-customer basis, incorporate your logo and color choice, and are at the URL pay.stripe.com.

    You can also customize these settings on a per-subscription or per-invoice basis, overriding these defaults.

    Optionally, you can customize the invoice number prefix for a customer. By default, Stripe autogenerates these prefixes, populating them with a random alphanumeric string. To customize it, use the invoice_prefix attribute on the Customer object in the API.

    Sending invoices with subscriptions

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

    If you would like to send out invoices that bill on a regular interval, start by creating a subscription, with billing on the Subscription object set to send_invoice. You can then enable a Stripe-hosted payment page for these invoices via the Billing settings section on the Dashboard. You can also customize this on a per-Subscription basis.

    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<StripeSubscriptionItemOption> {
        new StripeSubscriptionItemOption {PlanId = "plan_CBb6IXqvTLXp3f"}
    };
    var options = new StripeSubscriptionCreateOptions {
        Items = items,
        Billing = StripeBilling.SendInvoice,
        DaysUntilDue = 30,
    };
    var service = new StripeSubscriptionService();
    StripeSubscription subscription = service.Create("cus_4fdAW5ftNQow1a", options);
    

    For each billing cycle, Stripe generates an invoice associated with that subscription. Stripe automatically sends an email to your customer’s email address an hour after delivering the relevant webhook events. When the email is sent, Stripe emits the invoice.sent webhook. The webhook payload include 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 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.

    Sending one-time invoices

    You can also create a one-time invoice not associated with a subscription. 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 StripeInvoiceItemCreateOptions {
        Amount = 1000,
        Currency = "usd",
        CustomerId = "cus_4fdAW5ftNQow1a",
        Description = "One-time setup fee",
    };
    var service = new StripeInvoiceItemService();
    StripeInvoiceLineItem 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"
    
    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"
    
    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");
    
    \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");
    
    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"
    
    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 StripeInvoiceCreateOptions {
        Billing = StripeBilling.SendInvoice,
        DaysUntilDue = 30,
    };
    var service = new StripeInvoiceService();
    StripeInvoice invoice = service.Create("cus_4fdAW5ftNQow1a", options);
    

    Similarly, one-time invoices are sent to the customer with the corresponding information.

    Paying the invoice

    After an invoice is sent to the customer, we wait until they initiate payment. If they make their payment via Stripe-supported payment methods, Stripe automatically uses those funds to fulfill the customer’s invoice, marking it as paid and linking the invoice to the relevant charge.

    You can inspect the status of your Stripe-supported payments by viewing the sources list under customers:

    curl https://api.stripe.com/v1/customers/cus_4fdAW5ftNQow1a/sources \
       -u sk_test_4eC39HqLyjWDarjtT1zdp7dc:
    

    You should see:

    {
      "object": "list",
      "data": [
        {
          "id": "src_19Q3AILlRB0eXbMt81RVDnM9",
          "object": "source",
          "amount": null,
          "client_secret": "src_client_secret_Z0zPIgnR0BVafiMLaJcxI3HS",
          "created": 1481585102,
          "currency": "usd",
          "customer": "cus_4fdAW5ftNQow1a",
          "flow": "receiver",
          "livemode": false,
          "metadata": {},
          "owner": {
            "address": null,
            "email": "amount_0@stripe.com",
            "name": null,
            "phone": null,
            "verified_address": null,
            "verified_email": null,
            "verified_name": null,
            "verified_phone": null
          },
          "receiver": {
            "address": "110000000-test_12e2b7d44ea6",
            "amount_charged": 0,
            "amount_received": 0,
            "amount_returned": 0,
            "refund_attributes_method": "email",
            "refund_attributes_status": "missing"
          },
          "status": "chargeable",
          "type": "ach_credit_transfer",
          "usage": "reusable",
          "ach_credit_transfer": {
            "account_number": "test_12e2b7d44ea6",
            "fingerprint": "3eoX8Ufbxh0oVDim",
            "routing_number": 110000000
          }
        }
      ],
      "has_more": false,
      "url": "/v1/customers/cus_4fdAW5ftNQow1a/sources"
    }
    

    In this particular case, we see that the ACH credit receiver is awaiting payment from the customer. When payment is made, Stripe matches the payment to an invoice by fulfilling the oldest outstanding invoice of the same amount. When this happens, you get a invoice.payment_succeeded webhook. Payments that do not match an invoice amount remain in the receiver.

    Paying by default card or bank account

    If your customer has a credit card or bank account on file, you can also pull payment from their default source by calling the pay invoice endpoint.

    External Payment

    Sometimes, customers may want to pay with payment methods outside of Stripe. In these situations, Stripe cannot automatically reconcile your invoice payments, but can still allow you to keep track of the payment status of your invoices. Once you receive an invoice payment from a customer outside of Stripe, you can manually mark their invoices as paid.

    curl https://api.stripe.com/v1/invoices/in_18jwqyLlRB0eXbMtrUQ97YBw \
       -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
       -d paid=true
    
    # 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::Invoice.update('in_18jwqyLlRB0eXbMtrUQ97YBw', {
      paid: true,
    })
    
    # 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.Invoice.modify('in_18jwqyLlRB0eXbMtrUQ97YBw',
      paid=True,
    )
    
    // 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\Invoice::update('in_18jwqyLlRB0eXbMtrUQ97YBw', [
        'paid' => true,
    ]);
    
    // 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");
    Map<String, Object> params = new HashMap<>();
    params.put("paid", true);
    invoice.update(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.update('in_18jwqyLlRB0eXbMtrUQ97YBw', {
      paid: true,
    });
    
    // 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.InvoiceParams{
      Paid: stripe.Bool(true),
    }
    inv, _ := invoice.Update("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 options = new StripeInvoiceUpdateOptions {
        Paid = true,
    };
    var service = new StripeInvoiceService();
    StripeInvoice invoice = service.Update("in_18jwqyLlRB0eXbMtrUQ97YBw", options);
    

    This updates the invoice and subscription status to successfully paid so that you can keep record of your payments.

    Dunning

    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.

    If you’d like to initiate an email yourself, click on “Send” in the Dashboard.

    Overdue payments

    After an invoice is past its due date–if the invoice is the latest outstanding invoice for the subscription—its subscription status changes to past due to indicate that payment has not been made by the due date. Depending on your settings, Stripe continues to remind your customer to pay. If payment is still not made after a number of days specified in your settings, the invoice closes and the subscription automatically transitions to unpaid or canceled.

    To browse a list of your invoices, you may use the Dashboard, which gives you a range of filtering options. You can also use the List Invoices API endpoint to access them programmatically.

    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.