Class Invoice

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

public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice>
  • 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)
    • 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)
    • 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
    • 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
    • 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 a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. 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_proration_date on the upcoming invoice resource.

      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 a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. 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_proration_date on the upcoming invoice resource.

      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 a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. 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_proration_date on the upcoming invoice resource.

      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 a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. 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_proration_date on the upcoming invoice resource.

      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 a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. 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_proration_date on the upcoming invoice resource.

      Throws:
      StripeException
    • create

      public static Invoice create(Map<String,Object> params) throws StripeException
      This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in all pending invoice items on that customer, including prorations. 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 draft invoice created pulls in all pending invoice items on that customer, including prorations. 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 draft invoice created pulls in all pending invoice items on that customer, including prorations. 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 draft invoice created pulls in all pending invoice items on that customer, including prorations. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.
      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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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.
      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.
      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.
      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.
      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.
      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.
      Throws:
      StripeException
    • 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 %s, that was paid.
    • getAmountRemaining

      public Long getAmountRemaining()
      The amount remaining, in %s, that is due.
    • getApplicationFeeAmount

      public Long getApplicationFeeAmount()
      The fee in %s 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.
    • 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 will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action.
    • getAutomaticTax

      public Invoice.AutomaticTax getAutomaticTax()
    • getBillingReason

      public String getBillingReason()
      Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached.

      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.
    • 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.
    • getCustomFields

      public List<Invoice.CustomField> getCustomFields()
      Custom fields displayed on the invoice.
    • 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.
    • 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.
    • 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.
    • 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: invoice items in reverse chronological order, followed by the subscription, if any.
    • 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.
    • getPeriodStart

      public Long getPeriodStart()
      Start of the usage period during which invoice items were added to this invoice.
    • 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.
    • 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.
    • 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()
    • 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 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.DiscountAmount> getTotalDiscountAmounts()
      The aggregate amounts calculated per discount across all line items.
    • getTotalTaxAmounts

      public List<Invoice.TaxAmount> 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 %s, that was paid.
    • setAmountRemaining

      public void setAmountRemaining(Long amountRemaining)
      The amount remaining, in %s, that is due.
    • setApplicationFeeAmount

      public void setApplicationFeeAmount(Long applicationFeeAmount)
      The fee in %s 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.
    • 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 will perform automatic collection of the invoice. When false, the invoice's state will not 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. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached.

      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.
    • 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.
    • setCustomFields

      public void setCustomFields(List<Invoice.CustomField> customFields)
      Custom fields displayed on the invoice.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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: invoice items in reverse chronological order, followed by the subscription, if any.
    • 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.
    • setPeriodStart

      public void setPeriodStart(Long periodStart)
      Start of the usage period during which invoice items were added to this invoice.
    • 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.
    • 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.
    • 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)
    • 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 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.DiscountAmount> totalDiscountAmounts)
      The aggregate amounts calculated per discount across all line items.
    • setTotalTaxAmounts

      public void setTotalTaxAmounts(List<Invoice.TaxAmount> 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.
      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>