Class Invoice

All Implemented Interfaces:
HasId, MetadataStore<Invoice>, StripeActiveObject, StripeObjectInterface

public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice>
Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription.

They contain invoice items, and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary).

If your invoice is configured to be billed through automatic charges, Stripe automatically finalizes your invoice and attempts payment. Note that finalizing the invoice, when automatic, does not happen immediately as the invoice is created. Stripe waits until one hour after the last webhook was successfully sent (or the last webhook timed out after failing). If you (and the platforms you may have connected to) have no webhooks configured, Stripe waits one hour after creation to finalize the invoice.

If your invoice is configured to be billed by sending an email, then based on your email settings, Stripe will email the invoice to your customer and await payment. These emails can contain a link to a hosted page to pay the invoice.

Stripe applies any customer credit on the account before determining the amount due for the invoice (i.e., the amount that will be actually charged). If the amount due for the invoice is less than Stripe's minimum allowed charge per currency, the invoice is automatically marked paid, and we add the amount due to the customer's credit balance which is applied to the next invoice.

More details on the customer's credit balance are here.

Related guide: Send invoices to customers

  • Constructor Details

    • Invoice

      public Invoice()
  • Method Details

    • getApplication

      public String getApplication()
      Get ID of expandable application object.
    • setApplication

      public void setApplication(String id)
    • getApplicationObject

      public Application getApplicationObject()
      Get expanded application.
    • setApplicationObject

      public void setApplicationObject(Application expandableObject)
    • getCharge

      public String getCharge()
      Get ID of expandable charge object.
    • setCharge

      public void setCharge(String id)
    • getChargeObject

      public Charge getChargeObject()
      Get expanded charge.
    • setChargeObject

      public void setChargeObject(Charge expandableObject)
    • getCustomer

      public String getCustomer()
      Get ID of expandable customer object.
    • setCustomer

      public void setCustomer(String id)
    • getCustomerObject

      public Customer getCustomerObject()
      Get expanded customer.
    • setCustomerObject

      public void setCustomerObject(Customer expandableObject)
    • getDefaultPaymentMethod

      public String getDefaultPaymentMethod()
      Get ID of expandable defaultPaymentMethod object.
    • setDefaultPaymentMethod

      public void setDefaultPaymentMethod(String id)
    • getDefaultPaymentMethodObject

      public PaymentMethod getDefaultPaymentMethodObject()
      Get expanded defaultPaymentMethod.
    • setDefaultPaymentMethodObject

      public void setDefaultPaymentMethodObject(PaymentMethod expandableObject)
    • getDefaultSource

      public String getDefaultSource()
      Get ID of expandable defaultSource object.
    • setDefaultSource

      public void setDefaultSource(String id)
    • getDefaultSourceObject

      public PaymentSource getDefaultSourceObject()
      Get expanded defaultSource.
    • setDefaultSourceObject

      public void setDefaultSourceObject(PaymentSource expandableObject)
    • getLatestRevision

      public String getLatestRevision()
      Get ID of expandable latestRevision object.
    • setLatestRevision

      public void setLatestRevision(String id)
    • getLatestRevisionObject

      public Invoice getLatestRevisionObject()
      Get expanded latestRevision.
    • setLatestRevisionObject

      public void setLatestRevisionObject(Invoice expandableObject)
    • getOnBehalfOf

      public String getOnBehalfOf()
      Get ID of expandable onBehalfOf object.
    • setOnBehalfOf

      public void setOnBehalfOf(String id)
    • getOnBehalfOfObject

      public Account getOnBehalfOfObject()
      Get expanded onBehalfOf.
    • setOnBehalfOfObject

      public void setOnBehalfOfObject(Account expandableObject)
    • getPaymentIntent

      public String getPaymentIntent()
      Get ID of expandable paymentIntent object.
    • setPaymentIntent

      public void setPaymentIntent(String id)
    • getPaymentIntentObject

      public PaymentIntent getPaymentIntentObject()
      Get expanded paymentIntent.
    • setPaymentIntentObject

      public void setPaymentIntentObject(PaymentIntent expandableObject)
    • getQuote

      public String getQuote()
      Get ID of expandable quote object.
    • setQuote

      public void setQuote(String id)
    • getQuoteObject

      public Quote getQuoteObject()
      Get expanded quote.
    • setQuoteObject

      public void setQuoteObject(Quote expandableObject)
    • getSubscription

      public String getSubscription()
      Get ID of expandable subscription object.
    • setSubscription

      public void setSubscription(String id)
    • getSubscriptionObject

      public Subscription getSubscriptionObject()
      Get expanded subscription.
    • setSubscriptionObject

      public void setSubscriptionObject(Subscription expandableObject)
    • getTestClock

      public String getTestClock()
      Get ID of expandable testClock object.
    • setTestClock

      public void setTestClock(String id)
    • getTestClockObject

      public TestClock getTestClockObject()
      Get expanded testClock.
    • setTestClockObject

      public void setTestClockObject(TestClock expandableObject)
    • getAccountTaxIds

      public List<String> getAccountTaxIds()
      Get IDs of expandable accountTaxIds object list.
    • setAccountTaxIds

      public void setAccountTaxIds(List<String> ids)
    • getAccountTaxIdObjects

      public List<TaxId> getAccountTaxIdObjects()
      Get expanded accountTaxIds.
    • setAccountTaxIdObjects

      public void setAccountTaxIdObjects(List<TaxId> objs)
    • getDiscounts

      public List<String> getDiscounts()
      Get IDs of expandable discounts object list.
    • setDiscounts

      public void setDiscounts(List<String> ids)
    • getDiscountObjects

      public List<Discount> getDiscountObjects()
      Get expanded discounts.
    • setDiscountObjects

      public void setDiscountObjects(List<Discount> objs)
    • addLines

      public Invoice addLines(Map<String,Object> params) throws StripeException
      Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • addLines

      public Invoice addLines(Map<String,Object> params, RequestOptions options) throws StripeException
      Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • addLines

      public Invoice addLines(InvoiceAddLinesParams params) throws StripeException
      Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • addLines

      public Invoice addLines(InvoiceAddLinesParams params, RequestOptions options) throws StripeException
      Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • create

      public static Invoice create(Map<String,Object> params) throws StripeException
      This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.
      Throws:
      StripeException
    • create

      public static Invoice create(Map<String,Object> params, RequestOptions options) throws StripeException
      This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.
      Throws:
      StripeException
    • create

      public static Invoice create(InvoiceCreateParams params) throws StripeException
      This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.
      Throws:
      StripeException
    • create

      public static Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException
      This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.
      Throws:
      StripeException
    • createPreview

      public static Invoice createPreview() throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • createPreview

      public static Invoice createPreview(RequestOptions options) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • createPreview

      public static Invoice createPreview(Map<String,Object> params) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • createPreview

      public static Invoice createPreview(Map<String,Object> params, RequestOptions options) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • createPreview

      public static Invoice createPreview(InvoiceCreatePreviewParams params) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • createPreview

      public static Invoice createPreview(InvoiceCreatePreviewParams params, RequestOptions options) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • delete

      public Invoice delete() throws StripeException
      Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be voided.
      Throws:
      StripeException
    • delete

      public Invoice delete(RequestOptions options) throws StripeException
      Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be voided.
      Throws:
      StripeException
    • delete

      public Invoice delete(Map<String,Object> params) throws StripeException
      Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be voided.
      Throws:
      StripeException
    • delete

      public Invoice delete(Map<String,Object> params, RequestOptions options) throws StripeException
      Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be voided.
      Throws:
      StripeException
    • finalizeInvoice

      public Invoice finalizeInvoice() throws StripeException
      Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
      Throws:
      StripeException
    • finalizeInvoice

      public Invoice finalizeInvoice(RequestOptions options) throws StripeException
      Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
      Throws:
      StripeException
    • finalizeInvoice

      public Invoice finalizeInvoice(Map<String,Object> params) throws StripeException
      Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
      Throws:
      StripeException
    • finalizeInvoice

      public Invoice finalizeInvoice(Map<String,Object> params, RequestOptions options) throws StripeException
      Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
      Throws:
      StripeException
    • finalizeInvoice

      public Invoice finalizeInvoice(InvoiceFinalizeInvoiceParams params) throws StripeException
      Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
      Throws:
      StripeException
    • finalizeInvoice

      public Invoice finalizeInvoice(InvoiceFinalizeInvoiceParams params, RequestOptions options) throws StripeException
      Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
      Throws:
      StripeException
    • list

      public static InvoiceCollection list(Map<String,Object> params) throws StripeException
      You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
      Throws:
      StripeException
    • list

      public static InvoiceCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
      Throws:
      StripeException
    • list

      public static InvoiceCollection list(InvoiceListParams params) throws StripeException
      You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
      Throws:
      StripeException
    • list

      public static InvoiceCollection list(InvoiceListParams params, RequestOptions options) throws StripeException
      You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
      Throws:
      StripeException
    • markUncollectible

      public Invoice markUncollectible() throws StripeException
      Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
      Throws:
      StripeException
    • markUncollectible

      public Invoice markUncollectible(RequestOptions options) throws StripeException
      Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
      Throws:
      StripeException
    • markUncollectible

      public Invoice markUncollectible(Map<String,Object> params) throws StripeException
      Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
      Throws:
      StripeException
    • markUncollectible

      public Invoice markUncollectible(Map<String,Object> params, RequestOptions options) throws StripeException
      Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
      Throws:
      StripeException
    • markUncollectible

      public Invoice markUncollectible(InvoiceMarkUncollectibleParams params) throws StripeException
      Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
      Throws:
      StripeException
    • markUncollectible

      public Invoice markUncollectible(InvoiceMarkUncollectibleParams params, RequestOptions options) throws StripeException
      Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
      Throws:
      StripeException
    • pay

      public Invoice pay() throws StripeException
      Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
      Throws:
      StripeException
    • pay

      public Invoice pay(RequestOptions options) throws StripeException
      Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
      Throws:
      StripeException
    • pay

      public Invoice pay(Map<String,Object> params) throws StripeException
      Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
      Throws:
      StripeException
    • pay

      public Invoice pay(Map<String,Object> params, RequestOptions options) throws StripeException
      Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
      Throws:
      StripeException
    • pay

      public Invoice pay(InvoicePayParams params) throws StripeException
      Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
      Throws:
      StripeException
    • pay

      public Invoice pay(InvoicePayParams params, RequestOptions options) throws StripeException
      Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
      Throws:
      StripeException
    • removeLines

      public Invoice removeLines(Map<String,Object> params) throws StripeException
      Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • removeLines

      public Invoice removeLines(Map<String,Object> params, RequestOptions options) throws StripeException
      Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • removeLines

      public Invoice removeLines(InvoiceRemoveLinesParams params) throws StripeException
      Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • removeLines

      public Invoice removeLines(InvoiceRemoveLinesParams params, RequestOptions options) throws StripeException
      Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • retrieve

      public static Invoice retrieve(String invoice) throws StripeException
      Retrieves the invoice with the given ID.
      Throws:
      StripeException
    • retrieve

      public static Invoice retrieve(String invoice, RequestOptions options) throws StripeException
      Retrieves the invoice with the given ID.
      Throws:
      StripeException
    • retrieve

      public static Invoice retrieve(String invoice, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves the invoice with the given ID.
      Throws:
      StripeException
    • retrieve

      public static Invoice retrieve(String invoice, InvoiceRetrieveParams params, RequestOptions options) throws StripeException
      Retrieves the invoice with the given ID.
      Throws:
      StripeException
    • search

      public static InvoiceSearchResult search(Map<String,Object> params) throws StripeException
      Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.
      Throws:
      StripeException
    • search

      public static InvoiceSearchResult search(Map<String,Object> params, RequestOptions options) throws StripeException
      Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.
      Throws:
      StripeException
    • search

      public static InvoiceSearchResult search(InvoiceSearchParams params) throws StripeException
      Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.
      Throws:
      StripeException
    • search

      public static InvoiceSearchResult search(InvoiceSearchParams params, RequestOptions options) throws StripeException
      Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.
      Throws:
      StripeException
    • sendInvoice

      public Invoice sendInvoice() throws StripeException
      Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.

      Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.

      Throws:
      StripeException
    • sendInvoice

      public Invoice sendInvoice(RequestOptions options) throws StripeException
      Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.

      Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.

      Throws:
      StripeException
    • sendInvoice

      public Invoice sendInvoice(Map<String,Object> params) throws StripeException
      Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.

      Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.

      Throws:
      StripeException
    • sendInvoice

      public Invoice sendInvoice(Map<String,Object> params, RequestOptions options) throws StripeException
      Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.

      Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.

      Throws:
      StripeException
    • sendInvoice

      public Invoice sendInvoice(InvoiceSendInvoiceParams params) throws StripeException
      Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.

      Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.

      Throws:
      StripeException
    • sendInvoice

      public Invoice sendInvoice(InvoiceSendInvoiceParams params, RequestOptions options) throws StripeException
      Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.

      Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.

      Throws:
      StripeException
    • upcoming

      public static Invoice upcoming() throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • upcoming

      public static Invoice upcoming(Map<String,Object> params) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • upcoming

      public static Invoice upcoming(Map<String,Object> params, RequestOptions options) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • upcoming

      public static Invoice upcoming(InvoiceUpcomingParams params) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • upcoming

      public static Invoice upcoming(InvoiceUpcomingParams params, RequestOptions options) throws StripeException
      At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

      Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

      You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Throws:
      StripeException
    • upcomingLines

      public static InvoiceLineItemCollection upcomingLines() throws StripeException
      When retrieving an upcoming invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • upcomingLines

      public static InvoiceLineItemCollection upcomingLines(Map<String,Object> params) throws StripeException
      When retrieving an upcoming invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • upcomingLines

      public static InvoiceLineItemCollection upcomingLines(Map<String,Object> params, RequestOptions options) throws StripeException
      When retrieving an upcoming invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • upcomingLines

      public static InvoiceLineItemCollection upcomingLines(InvoiceUpcomingLinesParams params) throws StripeException
      When retrieving an upcoming invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • upcomingLines

      public static InvoiceLineItemCollection upcomingLines(InvoiceUpcomingLinesParams params, RequestOptions options) throws StripeException
      When retrieving an upcoming invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • update

      public Invoice update(Map<String,Object> params) throws StripeException
      Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well as collection_method, become uneditable.

      If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices, pass auto_advance=false.

      Specified by:
      update in interface MetadataStore<Invoice>
      Throws:
      StripeException
    • update

      public Invoice update(Map<String,Object> params, RequestOptions options) throws StripeException
      Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well as collection_method, become uneditable.

      If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices, pass auto_advance=false.

      Specified by:
      update in interface MetadataStore<Invoice>
      Throws:
      StripeException
    • update

      public Invoice update(InvoiceUpdateParams params) throws StripeException
      Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well as collection_method, become uneditable.

      If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices, pass auto_advance=false.

      Throws:
      StripeException
    • update

      public Invoice update(InvoiceUpdateParams params, RequestOptions options) throws StripeException
      Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well as collection_method, become uneditable.

      If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices, pass auto_advance=false.

      Throws:
      StripeException
    • updateLines

      public Invoice updateLines(Map<String,Object> params) throws StripeException
      Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • updateLines

      public Invoice updateLines(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • updateLines

      public Invoice updateLines(InvoiceUpdateLinesParams params) throws StripeException
      Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • updateLines

      public Invoice updateLines(InvoiceUpdateLinesParams params, RequestOptions options) throws StripeException
      Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
      Throws:
      StripeException
    • voidInvoice

      public Invoice voidInvoice() throws StripeException
      Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

      Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

      Throws:
      StripeException
    • voidInvoice

      public Invoice voidInvoice(RequestOptions options) throws StripeException
      Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

      Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

      Throws:
      StripeException
    • voidInvoice

      public Invoice voidInvoice(Map<String,Object> params) throws StripeException
      Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

      Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

      Throws:
      StripeException
    • voidInvoice

      public Invoice voidInvoice(Map<String,Object> params, RequestOptions options) throws StripeException
      Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

      Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

      Throws:
      StripeException
    • voidInvoice

      public Invoice voidInvoice(InvoiceVoidInvoiceParams params) throws StripeException
      Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

      Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

      Throws:
      StripeException
    • voidInvoice

      public Invoice voidInvoice(InvoiceVoidInvoiceParams params, RequestOptions options) throws StripeException
      Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

      Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you’re doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      Description copied from interface: StripeActiveObject
      Method is used by the containing object or StripeResponseGetter implementations to set the StripeResponseGetter instance used to make further requests.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getAccountCountry

      public String getAccountCountry()
      The country of the business associated with this invoice, most often the business creating the invoice.
    • getAccountName

      public String getAccountName()
      The public name of the business associated with this invoice, most often the business creating the invoice.
    • getAmountDue

      public Long getAmountDue()
      Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due.
    • getAmountPaid

      public Long getAmountPaid()
      The amount, in cents (or local equivalent), that was paid.
    • getAmountRemaining

      public Long getAmountRemaining()
      The difference between amount_due and amount_paid, in cents (or local equivalent).
    • getAmountShipping

      public Long getAmountShipping()
      This is the sum of all the shipping amounts.
    • getApplicationFeeAmount

      public Long getApplicationFeeAmount()
      The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
    • getAttemptCount

      public Long getAttemptCount()
      Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
    • getAttempted

      public Boolean getAttempted()
      Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users.
    • getAutoAdvance

      public Boolean getAutoAdvance()
      Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action.
    • getAutomaticTax

      public Invoice.AutomaticTax getAutomaticTax()
    • getBillingReason

      public String getBillingReason()
      Indicates the reason why the invoice was created.

      * manual: Unrelated to a subscription, for example, created via the invoice editor. * subscription: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * subscription_create: A new subscription was created. * subscription_cycle: A subscription advanced into a new period. * subscription_threshold: A subscription reached a billing threshold. * subscription_update: A subscription was updated. * upcoming: Reserved for simulated invoices, per the upcoming invoice endpoint.

      One of automatic_pending_invoice_item_invoice, manual, quote_accept, subscription, subscription_create, subscription_cycle, subscription_threshold, subscription_update, or upcoming.

    • getCollectionMethod

      public String getCollectionMethod()
      Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.

      One of charge_automatically, or send_invoice.

    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getCurrency

      public String getCurrency()
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • getCustomFields

      public List<Invoice.CustomField> getCustomFields()
      Custom fields displayed on the invoice.
    • getCustomerAddress

      public Address getCustomerAddress()
      The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated.
    • getCustomerEmail

      public String getCustomerEmail()
      The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated.
    • getCustomerName

      public String getCustomerName()
      The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated.
    • getCustomerPhone

      public String getCustomerPhone()
      The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated.
    • getCustomerShipping

      public ShippingDetails getCustomerShipping()
      The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated.
    • getCustomerTaxExempt

      public String getCustomerTaxExempt()
      The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated.

      One of exempt, none, or reverse.

    • getCustomerTaxIds

      public List<Invoice.CustomerTaxId> getCustomerTaxIds()
      The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated.
    • getDefaultTaxRates

      public List<TaxRate> getDefaultTaxRates()
      The tax rates applied to this invoice, if any.
    • getDeleted

      public Boolean getDeleted()
      Always true for a deleted object.
    • getDescription

      public String getDescription()
      An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
    • getDiscount

      public Discount getDiscount()
      Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
    • getDueDate

      public Long getDueDate()
      The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically.
    • getEffectiveAt

      public Long getEffectiveAt()
      The date when this invoice is in effect. Same as finalized_at unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
    • getEndingBalance

      public Long getEndingBalance()
      Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
    • getFooter

      public String getFooter()
      Footer displayed on the invoice.
    • getFromInvoice

      public Invoice.FromInvoice getFromInvoice()
      Details of the invoice that was cloned. See the revision documentation for more details.
    • getHostedInvoiceUrl

      public String getHostedInvoiceUrl()
      The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
    • getInvoicePdf

      public String getInvoicePdf()
      The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
    • getIssuer

      public Invoice.Issuer getIssuer()
    • getLastFinalizationError

      public StripeError getLastFinalizationError()
      The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
    • getLines

      public InvoiceLineItemCollection getLines()
      The individual line items that make up the invoice. lines is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getNextPaymentAttempt

      public Long getNextPaymentAttempt()
      The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice.
    • getNumber

      public String getNumber()
      A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to invoice.

    • getPaid

      public Boolean getPaid()
      Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.
    • getPaidOutOfBand

      public Boolean getPaidOutOfBand()
      Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
    • getPaymentSettings

      public Invoice.PaymentSettings getPaymentSettings()
    • getPeriodEnd

      public Long getPeriodEnd()
      End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the line item period to get the service period for each price.
    • getPeriodStart

      public Long getPeriodStart()
      Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the line item period to get the service period for each price.
    • getPostPaymentCreditNotesAmount

      public Long getPostPaymentCreditNotesAmount()
      Total amount of all post-payment credit notes issued for this invoice.
    • getPrePaymentCreditNotesAmount

      public Long getPrePaymentCreditNotesAmount()
      Total amount of all pre-payment credit notes issued for this invoice.
    • getReceiptNumber

      public String getReceiptNumber()
      This is the transaction number that appears on email receipts sent for this invoice.
    • getRendering

      public Invoice.Rendering getRendering()
      The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
    • getShippingCost

      public Invoice.ShippingCost getShippingCost()
      The details of the cost of shipping, including the ShippingRate applied on the invoice.
    • getShippingDetails

      public ShippingDetails getShippingDetails()
      Shipping details for the invoice. The Invoice PDF will use the shipping_details value if it is set, otherwise the PDF will render the shipping address from the customer.
    • getStartingBalance

      public Long getStartingBalance()
      Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
    • getStatementDescriptor

      public String getStatementDescriptor()
      Extra information about an invoice for the customer's credit card statement.
    • getStatus

      public String getStatus()
      The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more
    • getStatusTransitions

      public Invoice.StatusTransitions getStatusTransitions()
    • getSubscriptionDetails

      public Invoice.SubscriptionDetails getSubscriptionDetails()
      Details about the subscription that created this invoice.
    • getSubscriptionProrationDate

      public Long getSubscriptionProrationDate()
      Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
    • getSubtotal

      public Long getSubtotal()
      Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
    • getSubtotalExcludingTax

      public Long getSubtotalExcludingTax()
      The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
    • getTax

      public Long getTax()
      The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
    • getThresholdReason

      public Invoice.ThresholdReason getThresholdReason()
    • getTotal

      public Long getTotal()
      Total after discounts and taxes.
    • getTotalDiscountAmounts

      public List<Invoice.TotalDiscountAmount> getTotalDiscountAmounts()
      The aggregate amounts calculated per discount across all line items.
    • getTotalExcludingTax

      public Long getTotalExcludingTax()
      The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
    • getTotalTaxAmounts

      public List<Invoice.TotalTaxAmount> getTotalTaxAmounts()
      The aggregate amounts calculated per tax rate for all line items.
    • getTransferData

      public Invoice.TransferData getTransferData()
      The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
    • getWebhooksDeliveredAt

      public Long getWebhooksDeliveredAt()
      Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
    • setAccountCountry

      public void setAccountCountry(String accountCountry)
      The country of the business associated with this invoice, most often the business creating the invoice.
    • setAccountName

      public void setAccountName(String accountName)
      The public name of the business associated with this invoice, most often the business creating the invoice.
    • setAmountDue

      public void setAmountDue(Long amountDue)
      Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due.
    • setAmountPaid

      public void setAmountPaid(Long amountPaid)
      The amount, in cents (or local equivalent), that was paid.
    • setAmountRemaining

      public void setAmountRemaining(Long amountRemaining)
      The difference between amount_due and amount_paid, in cents (or local equivalent).
    • setAmountShipping

      public void setAmountShipping(Long amountShipping)
      This is the sum of all the shipping amounts.
    • setApplicationFeeAmount

      public void setApplicationFeeAmount(Long applicationFeeAmount)
      The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
    • setAttemptCount

      public void setAttemptCount(Long attemptCount)
      Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
    • setAttempted

      public void setAttempted(Boolean attempted)
      Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users.
    • setAutoAdvance

      public void setAutoAdvance(Boolean autoAdvance)
      Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action.
    • setAutomaticTax

      public void setAutomaticTax(Invoice.AutomaticTax automaticTax)
    • setBillingReason

      public void setBillingReason(String billingReason)
      Indicates the reason why the invoice was created.

      * manual: Unrelated to a subscription, for example, created via the invoice editor. * subscription: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * subscription_create: A new subscription was created. * subscription_cycle: A subscription advanced into a new period. * subscription_threshold: A subscription reached a billing threshold. * subscription_update: A subscription was updated. * upcoming: Reserved for simulated invoices, per the upcoming invoice endpoint.

      One of automatic_pending_invoice_item_invoice, manual, quote_accept, subscription, subscription_create, subscription_cycle, subscription_threshold, subscription_update, or upcoming.

    • setCollectionMethod

      public void setCollectionMethod(String collectionMethod)
      Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.

      One of charge_automatically, or send_invoice.

    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setCurrency

      public void setCurrency(String currency)
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • setCustomFields

      public void setCustomFields(List<Invoice.CustomField> customFields)
      Custom fields displayed on the invoice.
    • setCustomerAddress

      public void setCustomerAddress(Address customerAddress)
      The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated.
    • setCustomerEmail

      public void setCustomerEmail(String customerEmail)
      The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated.
    • setCustomerName

      public void setCustomerName(String customerName)
      The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated.
    • setCustomerPhone

      public void setCustomerPhone(String customerPhone)
      The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated.
    • setCustomerShipping

      public void setCustomerShipping(ShippingDetails customerShipping)
      The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated.
    • setCustomerTaxExempt

      public void setCustomerTaxExempt(String customerTaxExempt)
      The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated.

      One of exempt, none, or reverse.

    • setCustomerTaxIds

      public void setCustomerTaxIds(List<Invoice.CustomerTaxId> customerTaxIds)
      The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated.
    • setDefaultTaxRates

      public void setDefaultTaxRates(List<TaxRate> defaultTaxRates)
      The tax rates applied to this invoice, if any.
    • setDeleted

      public void setDeleted(Boolean deleted)
      Always true for a deleted object.
    • setDescription

      public void setDescription(String description)
      An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
    • setDiscount

      public void setDiscount(Discount discount)
      Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
    • setDueDate

      public void setDueDate(Long dueDate)
      The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically.
    • setEffectiveAt

      public void setEffectiveAt(Long effectiveAt)
      The date when this invoice is in effect. Same as finalized_at unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
    • setEndingBalance

      public void setEndingBalance(Long endingBalance)
      Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
    • setFooter

      public void setFooter(String footer)
      Footer displayed on the invoice.
    • setFromInvoice

      public void setFromInvoice(Invoice.FromInvoice fromInvoice)
      Details of the invoice that was cloned. See the revision documentation for more details.
    • setHostedInvoiceUrl

      public void setHostedInvoiceUrl(String hostedInvoiceUrl)
      The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
    • setId

      public void setId(String id)
      Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See Retrieve an upcoming invoice for more details.
    • setInvoicePdf

      public void setInvoicePdf(String invoicePdf)
      The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
    • setIssuer

      public void setIssuer(Invoice.Issuer issuer)
    • setLastFinalizationError

      public void setLastFinalizationError(StripeError lastFinalizationError)
      The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
    • setLines

      public void setLines(InvoiceLineItemCollection lines)
      The individual line items that make up the invoice. lines is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMetadata

      public void setMetadata(Map<String,String> metadata)
      Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
    • setNextPaymentAttempt

      public void setNextPaymentAttempt(Long nextPaymentAttempt)
      The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice.
    • setNumber

      public void setNumber(String number)
      A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to invoice.

    • setPaid

      public void setPaid(Boolean paid)
      Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.
    • setPaidOutOfBand

      public void setPaidOutOfBand(Boolean paidOutOfBand)
      Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
    • setPaymentSettings

      public void setPaymentSettings(Invoice.PaymentSettings paymentSettings)
    • setPeriodEnd

      public void setPeriodEnd(Long periodEnd)
      End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the line item period to get the service period for each price.
    • setPeriodStart

      public void setPeriodStart(Long periodStart)
      Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the line item period to get the service period for each price.
    • setPostPaymentCreditNotesAmount

      public void setPostPaymentCreditNotesAmount(Long postPaymentCreditNotesAmount)
      Total amount of all post-payment credit notes issued for this invoice.
    • setPrePaymentCreditNotesAmount

      public void setPrePaymentCreditNotesAmount(Long prePaymentCreditNotesAmount)
      Total amount of all pre-payment credit notes issued for this invoice.
    • setReceiptNumber

      public void setReceiptNumber(String receiptNumber)
      This is the transaction number that appears on email receipts sent for this invoice.
    • setRendering

      public void setRendering(Invoice.Rendering rendering)
      The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
    • setShippingCost

      public void setShippingCost(Invoice.ShippingCost shippingCost)
      The details of the cost of shipping, including the ShippingRate applied on the invoice.
    • setShippingDetails

      public void setShippingDetails(ShippingDetails shippingDetails)
      Shipping details for the invoice. The Invoice PDF will use the shipping_details value if it is set, otherwise the PDF will render the shipping address from the customer.
    • setStartingBalance

      public void setStartingBalance(Long startingBalance)
      Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
    • setStatementDescriptor

      public void setStatementDescriptor(String statementDescriptor)
      Extra information about an invoice for the customer's credit card statement.
    • setStatus

      public void setStatus(String status)
      The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more
    • setStatusTransitions

      public void setStatusTransitions(Invoice.StatusTransitions statusTransitions)
    • setSubscriptionDetails

      public void setSubscriptionDetails(Invoice.SubscriptionDetails subscriptionDetails)
      Details about the subscription that created this invoice.
    • setSubscriptionProrationDate

      public void setSubscriptionProrationDate(Long subscriptionProrationDate)
      Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
    • setSubtotal

      public void setSubtotal(Long subtotal)
      Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
    • setSubtotalExcludingTax

      public void setSubtotalExcludingTax(Long subtotalExcludingTax)
      The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
    • setTax

      public void setTax(Long tax)
      The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
    • setThresholdReason

      public void setThresholdReason(Invoice.ThresholdReason thresholdReason)
    • setTotal

      public void setTotal(Long total)
      Total after discounts and taxes.
    • setTotalDiscountAmounts

      public void setTotalDiscountAmounts(List<Invoice.TotalDiscountAmount> totalDiscountAmounts)
      The aggregate amounts calculated per discount across all line items.
    • setTotalExcludingTax

      public void setTotalExcludingTax(Long totalExcludingTax)
      The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
    • setTotalTaxAmounts

      public void setTotalTaxAmounts(List<Invoice.TotalTaxAmount> totalTaxAmounts)
      The aggregate amounts calculated per tax rate for all line items.
    • setTransferData

      public void setTransferData(Invoice.TransferData transferData)
      The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
    • setWebhooksDeliveredAt

      public void setWebhooksDeliveredAt(Long webhooksDeliveredAt)
      Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See Retrieve an upcoming invoice for more details.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,String> getMetadata()
      Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
      Specified by:
      getMetadata in interface MetadataStore<Invoice>