Struct stripe::CreateInvoice

source ·
pub struct CreateInvoice<'a> {
Show 31 fields pub account_tax_ids: Option<Vec<String>>, pub application_fee_amount: Option<i64>, pub auto_advance: Option<bool>, pub automatic_tax: Option<CreateInvoiceAutomaticTax>, pub collection_method: Option<CollectionMethod>, pub currency: Option<Currency>, pub custom_fields: Option<Vec<CreateInvoiceCustomFields>>, pub customer: Option<CustomerId>, pub days_until_due: Option<u32>, pub default_payment_method: Option<&'a str>, pub default_source: Option<&'a str>, pub default_tax_rates: Option<Vec<String>>, pub description: Option<&'a str>, pub discounts: Option<Vec<CreateInvoiceDiscounts>>, pub due_date: Option<Timestamp>, pub effective_at: Option<Timestamp>, pub expand: &'a [&'a str], pub footer: Option<&'a str>, pub from_invoice: Option<CreateInvoiceFromInvoice>, pub issuer: Option<CreateInvoiceIssuer>, pub metadata: Option<Metadata>, pub on_behalf_of: Option<&'a str>, pub payment_settings: Option<CreateInvoicePaymentSettings>, pub pending_invoice_items_behavior: Option<InvoicePendingInvoiceItemsBehavior>, pub rendering: Option<CreateInvoiceRendering>, pub rendering_options: Option<CreateInvoiceRenderingOptions>, pub shipping_cost: Option<CreateInvoiceShippingCost>, pub shipping_details: Option<CreateInvoiceShippingDetails>, pub statement_descriptor: Option<&'a str>, pub subscription: Option<SubscriptionId>, pub transfer_data: Option<CreateInvoiceTransferData>,
}
Expand description

The parameters for Invoice::create.

Fields§

§account_tax_ids: Option<Vec<String>>

The account tax IDs associated with the invoice.

Only editable when the invoice is a draft.

§application_fee_amount: Option<i64>

A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner’s Stripe account.

The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation.

§auto_advance: Option<bool>

Controls whether Stripe performs automatic collection of the invoice.

If false, the invoice’s state doesn’t automatically advance without an explicit action.

§automatic_tax: Option<CreateInvoiceAutomaticTax>

Settings for automatic tax lookup for this invoice.

§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. Defaults to charge_automatically.

§currency: Option<Currency>

The currency to create this invoice in.

Defaults to that of customer if not specified.

§custom_fields: Option<Vec<CreateInvoiceCustomFields>>

A list of up to 4 custom fields to be displayed on the invoice.

§customer: Option<CustomerId>

The ID of the customer who will be billed.

§days_until_due: Option<u32>

The number of days from when the invoice is created until it is due.

Valid only for invoices where collection_method=send_invoice.

§default_payment_method: Option<&'a str>

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<&'a str>

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<String>>

The tax rates that will apply to any line item that does not have tax_rates set.

§description: Option<&'a str>

An arbitrary string attached to the object.

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

§discounts: Option<Vec<CreateInvoiceDiscounts>>

The coupons to redeem into discounts for the invoice.

If not specified, inherits the discount from the invoice’s customer. Pass an empty string to avoid inheriting any discounts.

§due_date: Option<Timestamp>

The date on which payment for this invoice is due.

Valid only for invoices where collection_method=send_invoice.

§effective_at: Option<Timestamp>

The date when this invoice is in effect.

Same as finalized_at unless overwritten. When defined, this value replaces the system-generated ‘Date of issue’ printed on the invoice PDF and receipt.

§expand: &'a [&'a str]

Specifies which fields in the response should be expanded.

§footer: Option<&'a str>

Footer to be displayed on the invoice.

§from_invoice: Option<CreateInvoiceFromInvoice>

Revise an existing invoice.

The new invoice will be created in status=draft. See the revision documentation for more details.

§issuer: Option<CreateInvoiceIssuer>

The connected account that issues the invoice.

The invoice is presented with the branding and support information of the specified account.

§metadata: Option<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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

§on_behalf_of: Option<&'a str>

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.

§payment_settings: Option<CreateInvoicePaymentSettings>

Configuration settings for the PaymentIntent that is generated when the invoice is finalized.

§pending_invoice_items_behavior: Option<InvoicePendingInvoiceItemsBehavior>

How to handle pending invoice items on invoice creation.

One of include or exclude. include will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. exclude will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to exclude if the parameter is omitted.

§rendering: Option<CreateInvoiceRendering>

The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.

§rendering_options: Option<CreateInvoiceRenderingOptions>

This is a legacy field that will be removed soon.

For details about rendering_options, refer to rendering instead. Options for invoice PDF rendering.

§shipping_cost: Option<CreateInvoiceShippingCost>

Settings for the cost of shipping for this invoice.

§shipping_details: Option<CreateInvoiceShippingDetails>

Shipping details for the invoice.

The Invoice PDF will use the shipping_details value if it is set, otherwise the PDF will render the shipping address from the customer.

§statement_descriptor: Option<&'a str>

Extra information about a charge for the customer’s credit card statement.

It must contain at least one letter. If not specified and this invoice is part of a subscription, the default statement_descriptor will be set to the first subscription item’s product’s statement_descriptor.

§subscription: Option<SubscriptionId>

The ID of the subscription to invoice, if any.

If set, the created invoice will only include pending invoice items for that subscription. The subscription’s billing cycle and regular subscription events won’t be affected.

§transfer_data: Option<CreateInvoiceTransferData>

If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice’s charge.

Implementations§

source§

impl<'a> CreateInvoice<'a>

source

pub fn new() -> Self

Trait Implementations§

source§

impl<'a> Clone for CreateInvoice<'a>

source§

fn clone(&self) -> CreateInvoice<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for CreateInvoice<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for CreateInvoice<'a>

source§

fn default() -> CreateInvoice<'a>

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

impl<'a> Serialize for CreateInvoice<'a>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CreateInvoice<'a>

§

impl<'a> RefUnwindSafe for CreateInvoice<'a>

§

impl<'a> Send for CreateInvoice<'a>

§

impl<'a> Sync for CreateInvoice<'a>

§

impl<'a> Unpin for CreateInvoice<'a>

§

impl<'a> UnwindSafe for CreateInvoice<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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