pub struct Invoice {
Show 71 fields pub id: InvoiceId, pub account_country: Option<String>, pub account_name: Option<String>, pub account_tax_ids: Option<Vec<Expandable<TaxId>>>, pub amount_due: Option<i64>, pub amount_paid: Option<i64>, pub amount_remaining: Option<i64>, pub application: Option<Expandable<Application>>, pub application_fee_amount: Option<i64>, pub attempt_count: Option<u64>, pub attempted: Option<bool>, pub auto_advance: Option<bool>, pub automatic_tax: Option<AutomaticTax>, pub billing_reason: Option<InvoiceBillingReason>, pub charge: Option<Expandable<Charge>>, pub collection_method: Option<CollectionMethod>, pub created: Option<Timestamp>, pub currency: Option<Currency>, pub custom_fields: Option<Vec<InvoiceSettingCustomField>>, pub customer: Option<Expandable<Customer>>, pub customer_address: Option<Address>, pub customer_email: Option<String>, pub customer_name: Option<String>, pub customer_phone: Option<String>, pub customer_shipping: Option<Shipping>, pub customer_tax_exempt: Option<InvoiceCustomerTaxExempt>, pub customer_tax_ids: Option<Vec<InvoicesResourceInvoiceTaxId>>, pub default_payment_method: Option<Expandable<PaymentMethod>>, pub default_source: Option<Expandable<PaymentSource>>, pub default_tax_rates: Option<Vec<TaxRate>>, pub deleted: bool, pub description: Option<String>, pub discount: Option<Discount>, pub discounts: Option<Vec<Expandable<Discount>>>, pub due_date: Option<Timestamp>, pub ending_balance: Option<i64>, pub footer: Option<String>, pub hosted_invoice_url: Option<String>, pub invoice_pdf: Option<String>, pub last_finalization_error: Option<Box<ApiErrors>>, pub lines: List<InvoiceLineItem>, pub livemode: Option<bool>, pub metadata: Metadata, pub next_payment_attempt: Option<Timestamp>, pub number: Option<String>, pub on_behalf_of: Option<Expandable<Account>>, pub paid: Option<bool>, pub paid_out_of_band: Option<bool>, pub payment_intent: Option<Expandable<PaymentIntent>>, pub payment_settings: Option<InvoicesPaymentSettings>, pub period_end: Option<Timestamp>, pub period_start: Option<Timestamp>, pub post_payment_credit_notes_amount: Option<i64>, pub pre_payment_credit_notes_amount: Option<i64>, pub quote: Option<Expandable<Quote>>, pub receipt_number: Option<String>, pub starting_balance: Option<i64>, pub statement_descriptor: Option<String>, pub status: Option<InvoiceStatus>, pub status_transitions: Option<InvoicesStatusTransitions>, pub subscription: Option<Expandable<Subscription>>, pub subscription_proration_date: Option<Timestamp>, pub subtotal: Option<i64>, pub tax: Option<i64>, pub test_clock: Option<Expandable<TestHelpersTestClock>>, pub threshold_reason: Option<InvoiceThresholdReason>, pub total: Option<i64>, pub total_discount_amounts: Option<Vec<DiscountsResourceDiscountAmount>>, pub total_tax_amounts: Option<Vec<TaxAmount>>, pub transfer_data: Option<InvoiceTransferData>, pub webhooks_delivered_at: Option<Timestamp>,
}
Expand description

The resource representing a Stripe “Invoice”.

For more details see https://stripe.com/docs/api/invoices/object

Fields

id: InvoiceId

Unique identifier for the object.

account_country: Option<String>

The country of the business associated with this invoice, most often the business creating the invoice.

account_name: Option<String>

The public name of the business associated with this invoice, most often the business creating the invoice.

account_tax_ids: Option<Vec<Expandable<TaxId>>>

The account tax IDs associated with the invoice.

Only editable when the invoice is a draft.

amount_due: Option<i64>

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.

amount_paid: Option<i64>

The amount, in %s, that was paid.

amount_remaining: Option<i64>

The amount remaining, in %s, that is due.

application: Option<Expandable<Application>>

ID of the Connect Application that created the invoice.

application_fee_amount: Option<i64>

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.

attempt_count: Option<u64>

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.

attempted: Option<bool>

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.

auto_advance: Option<bool>

Controls whether Stripe will perform automatic collection of the invoice.

When false, the invoice’s state will not automatically advance without an explicit action.

automatic_tax: Option<AutomaticTax>billing_reason: Option<InvoiceBillingReason>

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.

charge: Option<Expandable<Charge>>

ID of the latest charge generated for this invoice, if any.

collection_method: Option<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.

created: Option<Timestamp>

Time at which the object was created.

Measured in seconds since the Unix epoch.

currency: Option<Currency>

Three-letter ISO currency code, in lowercase.

Must be a supported currency.

custom_fields: Option<Vec<InvoiceSettingCustomField>>

Custom fields displayed on the invoice.

customer: Option<Expandable<Customer>>

The ID of the customer who will be billed.

customer_address: Option<Address>

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.

customer_email: Option<String>

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.

customer_name: Option<String>

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.

customer_phone: Option<String>

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.

customer_shipping: Option<Shipping>

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.

customer_tax_exempt: Option<InvoiceCustomerTaxExempt>

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.

customer_tax_ids: Option<Vec<InvoicesResourceInvoiceTaxId>>

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.

default_payment_method: Option<Expandable<PaymentMethod>>

ID of the default payment method for the invoice.

It must belong to the customer associated with the invoice. If not set, defaults to the subscription’s default payment method, if any, or to the default payment method in the customer’s invoice settings.

default_source: Option<Expandable<PaymentSource>>

ID of the default payment source for the invoice.

It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription’s default source, if any, or to the customer’s default source.

default_tax_rates: Option<Vec<TaxRate>>

The tax rates applied to this invoice, if any.

deleted: booldescription: Option<String>

An arbitrary string attached to the object.

Often useful for displaying to users. Referenced as ‘memo’ in the Dashboard.

discount: Option<Discount>

Describes the current discount applied to this invoice, if there is one.

Not populated if there are multiple discounts.

discounts: Option<Vec<Expandable<Discount>>>

The discounts applied to the invoice.

Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount.

due_date: Option<Timestamp>

The date on which payment for this invoice is due.

This value will be null for invoices where collection_method=charge_automatically.

ending_balance: Option<i64>

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.

footer: Option<String>

Footer displayed on the invoice.

hosted_invoice_url: Option<String>

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.

invoice_pdf: Option<String>

The link to download the PDF for the invoice.

If the invoice has not been finalized yet, this will be null.

last_finalization_error: Option<Box<ApiErrors>>

The error encountered during the previous attempt to finalize the invoice.

This field is cleared when the invoice is successfully finalized.

lines: List<InvoiceLineItem>

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.

livemode: Option<bool>

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata: 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.

next_payment_attempt: Option<Timestamp>

The time at which payment will next be attempted.

This value will be null for invoices where collection_method=send_invoice.

number: Option<String>

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.

on_behalf_of: Option<Expandable<Account>>

The account (if any) for which the funds of the invoice payment are intended.

If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details.

paid: Option<bool>

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.

paid_out_of_band: Option<bool>

Returns true if the invoice was manually marked paid, returns false if the invoice hasn’t been paid yet or was paid on Stripe.

payment_intent: Option<Expandable<PaymentIntent>>

The PaymentIntent associated with this invoice.

The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent.

payment_settings: Option<InvoicesPaymentSettings>period_end: Option<Timestamp>

End of the usage period during which invoice items were added to this invoice.

period_start: Option<Timestamp>

Start of the usage period during which invoice items were added to this invoice.

post_payment_credit_notes_amount: Option<i64>

Total amount of all post-payment credit notes issued for this invoice.

pre_payment_credit_notes_amount: Option<i64>

Total amount of all pre-payment credit notes issued for this invoice.

quote: Option<Expandable<Quote>>

The quote this invoice was generated from.

receipt_number: Option<String>

This is the transaction number that appears on email receipts sent for this invoice.

starting_balance: Option<i64>

Starting customer balance before the invoice is finalized.

If the invoice has not been finalized yet, this will be the current customer balance.

statement_descriptor: Option<String>

Extra information about an invoice for the customer’s credit card statement.

status: Option<InvoiceStatus>

The status of the invoice, one of draft, open, paid, uncollectible, or void.

Learn more.

status_transitions: Option<InvoicesStatusTransitions>subscription: Option<Expandable<Subscription>>

The subscription that this invoice was prepared for, if any.

subscription_proration_date: Option<Timestamp>

Only set for upcoming invoices that preview prorations.

The time used to calculate prorations.

subtotal: Option<i64>

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.

tax: Option<i64>

The amount of tax on this invoice.

This is the sum of all the tax amounts on this invoice.

test_clock: Option<Expandable<TestHelpersTestClock>>

ID of the test clock this invoice belongs to.

threshold_reason: Option<InvoiceThresholdReason>total: Option<i64>

Total after discounts and taxes.

total_discount_amounts: Option<Vec<DiscountsResourceDiscountAmount>>

The aggregate amounts calculated per discount across all line items.

total_tax_amounts: Option<Vec<TaxAmount>>

The aggregate amounts calculated per tax rate for all line items.

transfer_data: Option<InvoiceTransferData>

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.

webhooks_delivered_at: Option<Timestamp>

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.

Implementations

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.

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.

Retrieves the invoice with the given ID.

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.

Retrieves the details of an upcoming invoice_id

For more details see https://stripe.com/docs/api#upcoming_invoice.

Pays an invoice.

For more details see https://stripe.com/docs/api#pay_invoice..

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

The canonical id type for this object.

The id of the object.

The object’s type, typically represented in wire format as the object property.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more