Class Invoice
- All Implemented Interfaces:
HasId,MetadataStore<Invoice>,StripeActiveObject,StripeObjectInterface
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about AmountsDue, please refer to the API Reference.static classFor more details about AutomaticTax, please refer to the API Reference.static classFor more details about ConfirmationSecret, please refer to the API Reference.static classFor more details about CustomerTaxId, please refer to the API Reference.static classFor more details about CustomField, please refer to the API Reference.static classFor more details about FromInvoice, please refer to the API Reference.static classFor more details about Issuer, please refer to the API Reference.static classFor more details about Parent, please refer to the API Reference.static classFor more details about PaymentSettings, please refer to the API Reference.static classFor more details about Rendering, please refer to the API Reference.static classFor more details about ShippingCost, please refer to the API Reference.static classFor more details about StatusTransitions, please refer to the API Reference.static classFor more details about ThresholdReason, please refer to the API Reference.static classFor more details about TotalDiscountAmount, please refer to the API Reference.static classFor more details about TotalMarginAmount, please refer to the API Reference.static classFor more details about TotalPretaxCreditAmount, please refer to the API Reference.static classFor more details about TotalTax, please refer to the API Reference.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLines(InvoiceAddLinesParams params) Adds multiple line items to an invoice.addLines(InvoiceAddLinesParams params, RequestOptions options) Adds multiple line items to an invoice.Adds multiple line items to an invoice.addLines(Map<String, Object> params, RequestOptions options) Adds multiple line items to an invoice.Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.attachPayment(RequestOptions options) Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.attachPayment(InvoiceAttachPaymentParams params, RequestOptions options) Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.attachPayment(Map<String, Object> params) Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.attachPayment(Map<String, Object> params, RequestOptions options) Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.protected booleanstatic Invoicecreate(InvoiceCreateParams params) This endpoint creates a draft invoice for a given customer.static Invoicecreate(InvoiceCreateParams params, RequestOptions options) This endpoint creates a draft invoice for a given customer.static InvoiceThis endpoint creates a draft invoice for a given customer.static Invoicecreate(Map<String, Object> params, RequestOptions options) This endpoint creates a draft invoice for a given customer.static InvoiceAt any time, you can preview the upcoming invoice for a subscription or subscription schedule.static InvoicecreatePreview(RequestOptions options) At any time, you can preview the upcoming invoice for a subscription or subscription schedule.static InvoiceAt any time, you can preview the upcoming invoice for a subscription or subscription schedule.static InvoicecreatePreview(InvoiceCreatePreviewParams params, RequestOptions options) At any time, you can preview the upcoming invoice for a subscription or subscription schedule.static InvoicecreatePreview(Map<String, Object> params) At any time, you can preview the upcoming invoice for a subscription or subscription schedule.static InvoicecreatePreview(Map<String, Object> params, RequestOptions options) At any time, you can preview the upcoming invoice for a subscription or subscription schedule.delete()Permanently deletes a one-off invoice draft.delete(RequestOptions options) Permanently deletes a one-off invoice draft.Permanently deletes a one-off invoice draft.delete(Map<String, Object> params, RequestOptions options) Permanently deletes a one-off invoice draft.booleanStripe automatically finalizes drafts before sending and attempting payment on invoices.finalizeInvoice(RequestOptions options) Stripe automatically finalizes drafts before sending and attempting payment on invoices.Stripe automatically finalizes drafts before sending and attempting payment on invoices.finalizeInvoice(InvoiceFinalizeInvoiceParams params, RequestOptions options) Stripe automatically finalizes drafts before sending and attempting payment on invoices.finalizeInvoice(Map<String, Object> params) Stripe automatically finalizes drafts before sending and attempting payment on invoices.finalizeInvoice(Map<String, Object> params, RequestOptions options) Stripe automatically finalizes drafts before sending and attempting payment on invoices.The country of the business associated with this invoice, most often the business creating the invoice.The public name of the business associated with this invoice, most often the business creating the invoice.Get expandedaccountTaxIds.Get IDs of expandableaccountTaxIdsobject list.Final amount due at this time for this invoice.Amount that was overpaid on the invoice.The amount, in cents (or local equivalent), that was paid.The difference between amount_due and amount_paid, in cents (or local equivalent).List of expected payments and corresponding due dates.This is the sum of all the shipping amounts.Get ID of expandableapplicationobject.Get expandedapplication.Number of payment attempts made for this invoice, from the perspective of the payment retry schedule.Whether an attempt has been made to pay the invoice.Controls whether Stripe performs automatic collection of the invoice.The time when this invoice is currently scheduled to be automatically finalized.Indicates the reason why the invoice was created.Eithercharge_automatically, orsend_invoice.The confirmation secret associated with this invoice.Time at which the object was created.Three-letter ISO currency code, in lowercase.Get ID of expandablecustomerobject.The ID of the account who will be billed.The customer's address.The customer's email.The customer's name.Get expandedcustomer.The customer's phone number.The customer's shipping information.The customer's tax exempt status.The customer's tax IDs.Custom fields displayed on the invoice.Get expandeddefaultMargins.Get IDs of expandabledefaultMarginsobject list.Get ID of expandabledefaultPaymentMethodobject.Get expandeddefaultPaymentMethod.Get ID of expandabledefaultSourceobject.Get expandeddefaultSource.The tax rates applied to this invoice, if any.Always true for a deleted object.An arbitrary string attached to the object.Get expandeddiscounts.Get IDs of expandablediscountsobject list.The date on which payment for this invoice is due.The date when this invoice is in effect.Ending customer balance after the invoice is finalized.Footer displayed on the invoice.Details of the invoice that was cloned.The URL for the hosted invoice page, which allows customers to view and pay an invoice.getId()Unique identifier for the object.The link to download the PDF for the invoice.The error encountered during the previous attempt to finalize the invoice.Get ID of expandablelatestRevisionobject.Get expandedlatestRevision.getLines()The individual line items that make up the invoice.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.Set of key-value pairs that you can attach to an object.The time at which payment will next be attempted.A unique, identifying string that appears on emails sent to the customer for this invoice.String representing the object's type.Get ID of expandableonBehalfOfobject.Get expandedonBehalfOf.The parent that generated this invoice.Payments for this invoice.End of the usage period during which invoice items were added to this invoice.Start of the usage period during which invoice items were added to this invoice.Total amount of all post-payment credit notes issued for this invoice.Total amount of all pre-payment credit notes issued for this invoice.This is the transaction number that appears on email receipts sent for this invoice.The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.The details of the cost of shipping, including the ShippingRate applied on the invoice.Shipping details for the invoice.Starting customer balance before the invoice is finalized.Extra information about an invoice for the customer's credit card statement.The status of the invoice, one ofdraft,open,paid,uncollectible, orvoid.Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied.The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied.Get ID of expandabletestClockobject.Get expandedtestClock.getTotal()Total after discounts and taxes.The aggregate amounts calculated per discount across all line items.The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.The aggregate amounts calculated per margin across all line items.Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice.The aggregate tax information of all line items.Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted.inthashCode()static InvoiceCollectionlist(InvoiceListParams params) You can list all invoices, or list the invoices for a specific customer.static InvoiceCollectionlist(InvoiceListParams params, RequestOptions options) You can list all invoices, or list the invoices for a specific customer.static InvoiceCollectionYou can list all invoices, or list the invoices for a specific customer.static InvoiceCollectionlist(Map<String, Object> params, RequestOptions options) You can list all invoices, or list the invoices for a specific customer.Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.markUncollectible(RequestOptions options) Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.markUncollectible(InvoiceMarkUncollectibleParams params, RequestOptions options) Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.markUncollectible(Map<String, Object> params) Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.markUncollectible(Map<String, Object> params, RequestOptions options) Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.pay()Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings.pay(RequestOptions options) Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings.pay(InvoicePayParams params) Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings.pay(InvoicePayParams params, RequestOptions options) Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings.Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings.pay(Map<String, Object> params, RequestOptions options) Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings.removeLines(InvoiceRemoveLinesParams params) Removes multiple line items from an invoice.removeLines(InvoiceRemoveLinesParams params, RequestOptions options) Removes multiple line items from an invoice.removeLines(Map<String, Object> params) Removes multiple line items from an invoice.removeLines(Map<String, Object> params, RequestOptions options) Removes multiple line items from an invoice.static InvoiceRetrieves the invoice with the given ID.static Invoiceretrieve(String invoice, RequestOptions options) Retrieves the invoice with the given ID.static Invoiceretrieve(String invoice, InvoiceRetrieveParams params, RequestOptions options) Retrieves the invoice with the given ID.static InvoiceRetrieves the invoice with the given ID.static InvoiceSearchResultsearch(InvoiceSearchParams params) Search for invoices you’ve previously created using Stripe’s Search Query Language.static InvoiceSearchResultsearch(InvoiceSearchParams params, RequestOptions options) Search for invoices you’ve previously created using Stripe’s Search Query Language.static InvoiceSearchResultSearch for invoices you’ve previously created using Stripe’s Search Query Language.static InvoiceSearchResultsearch(Map<String, Object> params, RequestOptions options) Search for invoices you’ve previously created using Stripe’s Search Query Language.Stripe will automatically send invoices to customers according to your subscriptions settings.sendInvoice(RequestOptions options) Stripe will automatically send invoices to customers according to your subscriptions settings.sendInvoice(InvoiceSendInvoiceParams params) Stripe will automatically send invoices to customers according to your subscriptions settings.sendInvoice(InvoiceSendInvoiceParams params, RequestOptions options) Stripe will automatically send invoices to customers according to your subscriptions settings.sendInvoice(Map<String, Object> params) Stripe will automatically send invoices to customers according to your subscriptions settings.sendInvoice(Map<String, Object> params, RequestOptions options) Stripe will automatically send invoices to customers according to your subscriptions settings.voidsetAccountCountry(String accountCountry) The country of the business associated with this invoice, most often the business creating the invoice.voidsetAccountName(String accountName) The public name of the business associated with this invoice, most often the business creating the invoice.voidsetAccountTaxIdObjects(List<TaxId> objs) voidsetAccountTaxIds(List<String> ids) voidsetAmountDue(Long amountDue) Final amount due at this time for this invoice.voidsetAmountOverpaid(Long amountOverpaid) Amount that was overpaid on the invoice.voidsetAmountPaid(Long amountPaid) The amount, in cents (or local equivalent), that was paid.voidsetAmountRemaining(Long amountRemaining) The difference between amount_due and amount_paid, in cents (or local equivalent).voidsetAmountsDue(List<Invoice.AmountsDue> amountsDue) List of expected payments and corresponding due dates.voidsetAmountShipping(Long amountShipping) This is the sum of all the shipping amounts.voidsetApplication(String id) voidsetApplicationObject(Application expandableObject) voidsetAttemptCount(Long attemptCount) Number of payment attempts made for this invoice, from the perspective of the payment retry schedule.voidsetAttempted(Boolean attempted) Whether an attempt has been made to pay the invoice.voidsetAutoAdvance(Boolean autoAdvance) Controls whether Stripe performs automatic collection of the invoice.voidsetAutomaticallyFinalizesAt(Long automaticallyFinalizesAt) The time when this invoice is currently scheduled to be automatically finalized.voidsetAutomaticTax(Invoice.AutomaticTax automaticTax) voidsetBillingReason(String billingReason) Indicates the reason why the invoice was created.voidsetCollectionMethod(String collectionMethod) Eithercharge_automatically, orsend_invoice.voidsetConfirmationSecret(Invoice.ConfirmationSecret confirmationSecret) The confirmation secret associated with this invoice.voidsetCreated(Long created) Time at which the object was created.voidsetCurrency(String currency) Three-letter ISO currency code, in lowercase.voidsetCustomer(String id) voidsetCustomerAccount(String customerAccount) The ID of the account who will be billed.voidsetCustomerAddress(Address customerAddress) The customer's address.voidsetCustomerEmail(String customerEmail) The customer's email.voidsetCustomerName(String customerName) The customer's name.voidsetCustomerObject(Customer expandableObject) voidsetCustomerPhone(String customerPhone) The customer's phone number.voidsetCustomerShipping(ShippingDetails customerShipping) The customer's shipping information.voidsetCustomerTaxExempt(String customerTaxExempt) The customer's tax exempt status.voidsetCustomerTaxIds(List<Invoice.CustomerTaxId> customerTaxIds) The customer's tax IDs.voidsetCustomFields(List<Invoice.CustomField> customFields) Custom fields displayed on the invoice.voidsetDefaultMarginObjects(List<Margin> objs) voidsetDefaultMargins(List<String> ids) voidvoidsetDefaultPaymentMethodObject(PaymentMethod expandableObject) voidvoidsetDefaultSourceObject(PaymentSource expandableObject) voidsetDefaultTaxRates(List<TaxRate> defaultTaxRates) The tax rates applied to this invoice, if any.voidsetDeleted(Boolean deleted) Always true for a deleted object.voidsetDescription(String description) An arbitrary string attached to the object.voidsetDiscountObjects(List<Discount> objs) voidsetDiscounts(List<String> ids) voidsetDueDate(Long dueDate) The date on which payment for this invoice is due.voidsetEffectiveAt(Long effectiveAt) The date when this invoice is in effect.voidsetEndingBalance(Long endingBalance) Ending customer balance after the invoice is finalized.voidFooter displayed on the invoice.voidsetFromInvoice(Invoice.FromInvoice fromInvoice) Details of the invoice that was cloned.voidsetHostedInvoiceUrl(String hostedInvoiceUrl) The URL for the hosted invoice page, which allows customers to view and pay an invoice.voidUnique identifier for the object.voidsetInvoicePdf(String invoicePdf) The link to download the PDF for the invoice.voidsetIssuer(Invoice.Issuer issuer) voidsetLastFinalizationError(StripeError lastFinalizationError) The error encountered during the previous attempt to finalize the invoice.voidvoidsetLatestRevisionObject(Invoice expandableObject) voidThe individual line items that make up the invoice.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidsetNextPaymentAttempt(Long nextPaymentAttempt) The time at which payment will next be attempted.voidA unique, identifying string that appears on emails sent to the customer for this invoice.voidString representing the object's type.voidsetOnBehalfOf(String id) voidsetOnBehalfOfObject(Account expandableObject) voidsetParent(Invoice.Parent parent) The parent that generated this invoice.voidsetPayments(InvoicePaymentCollection payments) Payments for this invoice.voidsetPaymentSettings(Invoice.PaymentSettings paymentSettings) voidsetPeriodEnd(Long periodEnd) End of the usage period during which invoice items were added to this invoice.voidsetPeriodStart(Long periodStart) Start of the usage period during which invoice items were added to this invoice.voidsetPostPaymentCreditNotesAmount(Long postPaymentCreditNotesAmount) Total amount of all post-payment credit notes issued for this invoice.voidsetPrePaymentCreditNotesAmount(Long prePaymentCreditNotesAmount) Total amount of all pre-payment credit notes issued for this invoice.voidsetReceiptNumber(String receiptNumber) This is the transaction number that appears on email receipts sent for this invoice.voidsetRendering(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.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidsetShippingCost(Invoice.ShippingCost shippingCost) The details of the cost of shipping, including the ShippingRate applied on the invoice.voidsetShippingDetails(ShippingDetails shippingDetails) Shipping details for the invoice.voidsetStartingBalance(Long startingBalance) Starting customer balance before the invoice is finalized.voidsetStatementDescriptor(String statementDescriptor) Extra information about an invoice for the customer's credit card statement.voidThe status of the invoice, one ofdraft,open,paid,uncollectible, orvoid.voidsetStatusTransitions(Invoice.StatusTransitions statusTransitions) voidsetSubtotal(Long subtotal) Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied.voidsetSubtotalExcludingTax(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.voidsetTestClock(String id) voidsetTestClockObject(TestClock expandableObject) voidsetThresholdReason(Invoice.ThresholdReason thresholdReason) voidTotal after discounts and taxes.voidsetTotalDiscountAmounts(List<Invoice.TotalDiscountAmount> totalDiscountAmounts) The aggregate amounts calculated per discount across all line items.voidsetTotalExcludingTax(Long totalExcludingTax) The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.voidsetTotalMarginAmounts(List<Invoice.TotalMarginAmount> totalMarginAmounts) The aggregate amounts calculated per margin across all line items.voidsetTotalPretaxCreditAmounts(List<Invoice.TotalPretaxCreditAmount> totalPretaxCreditAmounts) Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice.voidsetTotalTaxes(List<Invoice.TotalTax> totalTaxes) The aggregate tax information of all line items.voidsetWebhooksDeliveredAt(Long webhooksDeliveredAt) Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted.update(InvoiceUpdateParams params) Draft invoices are fully editable.update(InvoiceUpdateParams params, RequestOptions options) Draft invoices are fully editable.Draft invoices are fully editable.update(Map<String, Object> params, RequestOptions options) Draft invoices are fully editable.updateLines(InvoiceUpdateLinesParams params) Updates multiple line items on an invoice.updateLines(InvoiceUpdateLinesParams params, RequestOptions options) Updates multiple line items on an invoice.updateLines(Map<String, Object> params) Updates multiple line items on an invoice.updateLines(Map<String, Object> params, RequestOptions options) Updates multiple line items on an invoice.Mark a finalized invoice as void.voidInvoice(RequestOptions options) Mark a finalized invoice as void.voidInvoice(InvoiceVoidInvoiceParams params) Mark a finalized invoice as void.voidInvoice(InvoiceVoidInvoiceParams params, RequestOptions options) Mark a finalized invoice as void.voidInvoice(Map<String, Object> params) Mark a finalized invoice as void.voidInvoice(Map<String, Object> params, RequestOptions options) Mark a finalized invoice as void.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Invoice
public Invoice()
-
-
Method Details
-
getApplication
Get ID of expandableapplicationobject. -
setApplication
-
getApplicationObject
Get expandedapplication. -
setApplicationObject
-
getCustomer
Get ID of expandablecustomerobject. -
setCustomer
-
getCustomerObject
Get expandedcustomer. -
setCustomerObject
-
getDefaultPaymentMethod
Get ID of expandabledefaultPaymentMethodobject. -
setDefaultPaymentMethod
-
getDefaultPaymentMethodObject
Get expandeddefaultPaymentMethod. -
setDefaultPaymentMethodObject
-
getDefaultSource
Get ID of expandabledefaultSourceobject. -
setDefaultSource
-
getDefaultSourceObject
Get expandeddefaultSource. -
setDefaultSourceObject
-
getLatestRevision
Get ID of expandablelatestRevisionobject. -
setLatestRevision
-
getLatestRevisionObject
Get expandedlatestRevision. -
setLatestRevisionObject
-
getOnBehalfOf
Get ID of expandableonBehalfOfobject. -
setOnBehalfOf
-
getOnBehalfOfObject
Get expandedonBehalfOf. -
setOnBehalfOfObject
-
getTestClock
Get ID of expandabletestClockobject. -
setTestClock
-
getTestClockObject
Get expandedtestClock. -
setTestClockObject
-
getAccountTaxIds
Get IDs of expandableaccountTaxIdsobject list. -
setAccountTaxIds
-
getAccountTaxIdObjects
Get expandedaccountTaxIds. -
setAccountTaxIdObjects
-
getDefaultMargins
Get IDs of expandabledefaultMarginsobject list. -
setDefaultMargins
-
getDefaultMarginObjects
Get expandeddefaultMargins. -
setDefaultMarginObjects
-
getDiscounts
Get IDs of expandablediscountsobject list. -
setDiscounts
-
getDiscountObjects
Get expandeddiscounts. -
setDiscountObjects
-
addLines
Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.- Throws:
StripeException
-
addLines
Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.- Throws:
StripeException
-
addLines
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
-
attachPayment
Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.For the PaymentIntent, when the PaymentIntent’s status changes to
succeeded, the payment is credited to the invoice, increasing itsamount_paid. When the invoice is fully paid, the invoice’s status becomespaid.If the PaymentIntent’s status is already
succeededwhen it’s attached, it’s credited to the invoice immediately.See: Partial payments to learn more.
- Throws:
StripeException
-
attachPayment
Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.For the PaymentIntent, when the PaymentIntent’s status changes to
succeeded, the payment is credited to the invoice, increasing itsamount_paid. When the invoice is fully paid, the invoice’s status becomespaid.If the PaymentIntent’s status is already
succeededwhen it’s attached, it’s credited to the invoice immediately.See: Partial payments to learn more.
- Throws:
StripeException
-
attachPayment
Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.For the PaymentIntent, when the PaymentIntent’s status changes to
succeeded, the payment is credited to the invoice, increasing itsamount_paid. When the invoice is fully paid, the invoice’s status becomespaid.If the PaymentIntent’s status is already
succeededwhen it’s attached, it’s credited to the invoice immediately.See: Partial payments to learn more.
- Throws:
StripeException
-
attachPayment
public Invoice attachPayment(Map<String, Object> params, RequestOptions options) throws StripeExceptionAttaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.For the PaymentIntent, when the PaymentIntent’s status changes to
succeeded, the payment is credited to the invoice, increasing itsamount_paid. When the invoice is fully paid, the invoice’s status becomespaid.If the PaymentIntent’s status is already
succeededwhen it’s attached, it’s credited to the invoice immediately.See: Partial payments to learn more.
- Throws:
StripeException
-
attachPayment
Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.For the PaymentIntent, when the PaymentIntent’s status changes to
succeeded, the payment is credited to the invoice, increasing itsamount_paid. When the invoice is fully paid, the invoice’s status becomespaid.If the PaymentIntent’s status is already
succeededwhen it’s attached, it’s credited to the invoice immediately.See: Partial payments to learn more.
- Throws:
StripeException
-
attachPayment
public Invoice attachPayment(InvoiceAttachPaymentParams params, RequestOptions options) throws StripeException Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list ofpayments.For the PaymentIntent, when the PaymentIntent’s status changes to
succeeded, the payment is credited to the invoice, increasing itsamount_paid. When the invoice is fully paid, the invoice’s status becomespaid.If the PaymentIntent’s status is already
succeededwhen it’s attached, it’s credited to the invoice immediately.See: Partial payments to learn more.
- Throws:
StripeException
-
create
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 StripeExceptionThis 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
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
At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that 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_dateparameter when doing the actual subscription update.The recommended way to get only the prorations being previewed on the invoice is to consider line items where
parent.subscription_item_details.prorationistrue.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.
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
At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that 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_dateparameter when doing the actual subscription update.The recommended way to get only the prorations being previewed on the invoice is to consider line items where
parent.subscription_item_details.prorationistrue.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.
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
At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that 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_dateparameter when doing the actual subscription update.The recommended way to get only the prorations being previewed on the invoice is to consider line items where
parent.subscription_item_details.prorationistrue.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.
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 StripeExceptionAt any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that 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_dateparameter when doing the actual subscription update.The recommended way to get only the prorations being previewed on the invoice is to consider line items where
parent.subscription_item_details.prorationistrue.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.
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
At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that 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_dateparameter when doing the actual subscription update.The recommended way to get only the prorations being previewed on the invoice is to consider line items where
parent.subscription_item_details.prorationistrue.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.
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 subscription or subscription schedule. 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.You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that 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_dateparameter when doing the actual subscription update.The recommended way to get only the prorations being previewed on the invoice is to consider line items where
parent.subscription_item_details.prorationistrue.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.
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
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
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
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
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
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
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
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 StripeExceptionStripe 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
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
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 StripeExceptionYou 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
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
Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.- Throws:
StripeException
-
markUncollectible
Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.- Throws:
StripeException
-
markUncollectible
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 StripeExceptionMarking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.- Throws:
StripeException
-
markUncollectible
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
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
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
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
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
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
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
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 StripeExceptionRemoves multiple line items from an invoice. This is only possible when an invoice is still a draft.- Throws:
StripeException
-
removeLines
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
Retrieves the invoice with the given ID.- Throws:
StripeException
-
retrieve
Retrieves the invoice with the given ID.- Throws:
StripeException
-
retrieve
public static Invoice retrieve(String invoice, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves 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
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 StripeExceptionSearch 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
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
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.sentevent.- Throws:
StripeException
-
sendInvoice
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.sentevent.- Throws:
StripeException
-
sendInvoice
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.sentevent.- Throws:
StripeException
-
sendInvoice
public Invoice sendInvoice(Map<String, Object> params, RequestOptions options) throws StripeExceptionStripe 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.sentevent.- Throws:
StripeException
-
sendInvoice
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.sentevent.- 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.sentevent.- Throws:
StripeException
-
update
Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well ascollection_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:
updatein interfaceMetadataStore<Invoice>- Throws:
StripeException
-
update
Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well ascollection_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:
updatein interfaceMetadataStore<Invoice>- Throws:
StripeException
-
update
Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well ascollection_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
Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well ascollection_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
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 StripeExceptionUpdates multiple line items on an invoice. This is only possible when an invoice is still a draft.- Throws:
StripeException
-
updateLines
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
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
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
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 StripeExceptionMark 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
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
Description copied from interface:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getAccountCountry
The country of the business associated with this invoice, most often the business creating the invoice. -
getAccountName
The public name of the business associated with this invoice, most often the business creating the invoice. -
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, theamount_duemay be 0. If there is a positivestarting_balancefor the invoice (the customer owes money), theamount_duewill also take that into account. The charge that gets generated for the invoice will be for the amount specified inamount_due. -
getAmountOverpaid
Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance. -
getAmountPaid
The amount, in cents (or local equivalent), that was paid. -
getAmountRemaining
The difference between amount_due and amount_paid, in cents (or local equivalent). -
getAmountShipping
This is the sum of all the shipping amounts. -
getAmountsDue
List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically. -
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
Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after theinvoice.createdwebhook, for example, so you might not want to display that invoice as unpaid to your users. -
getAutoAdvance
Controls whether Stripe performs automatic collection of the invoice. Iffalse, the invoice's state doesn't automatically advance without an explicit action. -
getAutomaticTax
-
getAutomaticallyFinalizesAt
The time when this invoice is currently scheduled to be automatically finalized. The field will benullif the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always benull- seefinalized_atfor the time when an already-finalized invoice was finalized. -
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 upcoming invoices created through the Create Preview Invoice API or when aninvoice.upcomingevent is generated for an upcoming invoice on a subscription.One of
automatic_pending_invoice_item_invoice,manual,quote_accept,subscription,subscription_create,subscription_cycle,subscription_threshold,subscription_update, orupcoming. -
getCollectionMethod
Eithercharge_automatically, orsend_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, orsend_invoice. -
getConfirmationSecret
The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getCustomFields
Custom fields displayed on the invoice. -
getCustomerAccount
The ID of the account who will be billed. -
getCustomerAddress
The customer's address. Until the invoice is finalized, this field will equalcustomer.address. Once the invoice is finalized, this field will no longer be updated. -
getCustomerEmail
The customer's email. Until the invoice is finalized, this field will equalcustomer.email. Once the invoice is finalized, this field will no longer be updated. -
getCustomerName
The customer's name. Until the invoice is finalized, this field will equalcustomer.name. Once the invoice is finalized, this field will no longer be updated. -
getCustomerPhone
The customer's phone number. Until the invoice is finalized, this field will equalcustomer.phone. Once the invoice is finalized, this field will no longer be updated. -
getCustomerShipping
The customer's shipping information. Until the invoice is finalized, this field will equalcustomer.shipping. Once the invoice is finalized, this field will no longer be updated. -
getCustomerTaxExempt
The customer's tax exempt status. Until the invoice is finalized, this field will equalcustomer.tax_exempt. Once the invoice is finalized, this field will no longer be updated.One of
exempt,none, orreverse. -
getCustomerTaxIds
The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs ascustomer.tax_ids. Once the invoice is finalized, this field will no longer be updated. -
getDefaultTaxRates
The tax rates applied to this invoice, if any. -
getDeleted
Always true for a deleted object. -
getDescription
An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. -
getDueDate
The date on which payment for this invoice is due. This value will benullfor invoices wherecollection_method=charge_automatically. -
getEffectiveAt
The date when this invoice is in effect. Same asfinalized_atunless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. -
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. -
getFromInvoice
Details of the invoice that was cloned. See the revision documentation for more details. -
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
The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. -
getIssuer
-
getLastFinalizationError
The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. -
getLines
The individual line items that make up the invoice.linesis 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
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getNextPaymentAttempt
The time at which payment will next be attempted. This value will benullfor invoices wherecollection_method=send_invoice. -
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
String representing the object's type. Objects of the same type share the same value.Equal to
invoice. -
getParent
The parent that generated this invoice. -
getPaymentSettings
-
getPayments
Payments for this invoice. -
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
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
Total amount of all post-payment credit notes issued for this invoice. -
getPrePaymentCreditNotesAmount
Total amount of all pre-payment credit notes issued for this invoice. -
getReceiptNumber
This is the transaction number that appears on email receipts sent for this invoice. -
getRendering
The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. -
getShippingCost
The details of the cost of shipping, including the ShippingRate applied on the invoice. -
getShippingDetails
Shipping details for the invoice. The Invoice PDF will use theshipping_detailsvalue if it is set, otherwise the PDF will render the shipping address from the customer. -
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
Extra information about an invoice for the customer's credit card statement. -
getStatus
-
getStatusTransitions
-
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
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 -
getThresholdReason
-
getTotal
Total after discounts and taxes. -
getTotalDiscountAmounts
The aggregate amounts calculated per discount across all line items. -
getTotalExcludingTax
The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. -
getTotalMarginAmounts
The aggregate amounts calculated per margin across all line items. -
getTotalPretaxCreditAmounts
Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. -
getTotalTaxes
The aggregate tax information of all line items. -
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
The country of the business associated with this invoice, most often the business creating the invoice. -
setAccountName
The public name of the business associated with this invoice, most often the business creating the invoice. -
setAmountDue
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, theamount_duemay be 0. If there is a positivestarting_balancefor the invoice (the customer owes money), theamount_duewill also take that into account. The charge that gets generated for the invoice will be for the amount specified inamount_due. -
setAmountOverpaid
Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance. -
setAmountPaid
The amount, in cents (or local equivalent), that was paid. -
setAmountRemaining
The difference between amount_due and amount_paid, in cents (or local equivalent). -
setAmountShipping
This is the sum of all the shipping amounts. -
setAmountsDue
List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically. -
setAttemptCount
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
Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after theinvoice.createdwebhook, for example, so you might not want to display that invoice as unpaid to your users. -
setAutoAdvance
Controls whether Stripe performs automatic collection of the invoice. Iffalse, the invoice's state doesn't automatically advance without an explicit action. -
setAutomaticTax
-
setAutomaticallyFinalizesAt
The time when this invoice is currently scheduled to be automatically finalized. The field will benullif the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always benull- seefinalized_atfor the time when an already-finalized invoice was finalized. -
setBillingReason
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 upcoming invoices created through the Create Preview Invoice API or when aninvoice.upcomingevent is generated for an upcoming invoice on a subscription.One of
automatic_pending_invoice_item_invoice,manual,quote_accept,subscription,subscription_create,subscription_cycle,subscription_threshold,subscription_update, orupcoming. -
setCollectionMethod
Eithercharge_automatically, orsend_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, orsend_invoice. -
setConfirmationSecret
The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setCustomFields
Custom fields displayed on the invoice. -
setCustomerAccount
The ID of the account who will be billed. -
setCustomerAddress
The customer's address. Until the invoice is finalized, this field will equalcustomer.address. Once the invoice is finalized, this field will no longer be updated. -
setCustomerEmail
The customer's email. Until the invoice is finalized, this field will equalcustomer.email. Once the invoice is finalized, this field will no longer be updated. -
setCustomerName
The customer's name. Until the invoice is finalized, this field will equalcustomer.name. Once the invoice is finalized, this field will no longer be updated. -
setCustomerPhone
The customer's phone number. Until the invoice is finalized, this field will equalcustomer.phone. Once the invoice is finalized, this field will no longer be updated. -
setCustomerShipping
The customer's shipping information. Until the invoice is finalized, this field will equalcustomer.shipping. Once the invoice is finalized, this field will no longer be updated. -
setCustomerTaxExempt
The customer's tax exempt status. Until the invoice is finalized, this field will equalcustomer.tax_exempt. Once the invoice is finalized, this field will no longer be updated.One of
exempt,none, orreverse. -
setCustomerTaxIds
The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs ascustomer.tax_ids. Once the invoice is finalized, this field will no longer be updated. -
setDefaultTaxRates
The tax rates applied to this invoice, if any. -
setDeleted
Always true for a deleted object. -
setDescription
An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. -
setDueDate
The date on which payment for this invoice is due. This value will benullfor invoices wherecollection_method=charge_automatically. -
setEffectiveAt
The date when this invoice is in effect. Same asfinalized_atunless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. -
setEndingBalance
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. -
setFromInvoice
Details of the invoice that was cloned. See the revision documentation for more details. -
setHostedInvoiceUrl
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
Unique identifier for the object. For preview invoices created using the create preview endpoint, this id will be prefixed withupcoming_in. -
setInvoicePdf
The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. -
setIssuer
-
setLastFinalizationError
The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. -
setLines
The individual line items that make up the invoice.linesis 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
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setMetadata
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
The time at which payment will next be attempted. This value will benullfor invoices wherecollection_method=send_invoice. -
setNumber
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
String representing the object's type. Objects of the same type share the same value.Equal to
invoice. -
setParent
The parent that generated this invoice. -
setPaymentSettings
-
setPayments
Payments for this invoice. -
setPeriodEnd
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
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
Total amount of all post-payment credit notes issued for this invoice. -
setPrePaymentCreditNotesAmount
Total amount of all pre-payment credit notes issued for this invoice. -
setReceiptNumber
This is the transaction number that appears on email receipts sent for this invoice. -
setRendering
The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. -
setShippingCost
The details of the cost of shipping, including the ShippingRate applied on the invoice. -
setShippingDetails
Shipping details for the invoice. The Invoice PDF will use theshipping_detailsvalue if it is set, otherwise the PDF will render the shipping address from the customer. -
setStartingBalance
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
Extra information about an invoice for the customer's credit card statement. -
setStatus
-
setStatusTransitions
-
setSubtotal
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
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 -
setThresholdReason
-
setTotal
Total after discounts and taxes. -
setTotalDiscountAmounts
The aggregate amounts calculated per discount across all line items. -
setTotalExcludingTax
The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. -
setTotalMarginAmounts
The aggregate amounts calculated per margin across all line items. -
setTotalPretaxCreditAmounts
public void setTotalPretaxCreditAmounts(List<Invoice.TotalPretaxCreditAmount> totalPretaxCreditAmounts) Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. -
setTotalTaxes
The aggregate tax information of all line items. -
setWebhooksDeliveredAt
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
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. For preview invoices created using the create preview endpoint, this id will be prefixed withupcoming_in. -
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:
getMetadatain interfaceMetadataStore<Invoice>
-