Struct Customer

Source
pub struct Customer {
Show 27 fields pub address: Option<Address>, pub balance: Option<i64>, pub cash_balance: Option<CashBalance>, pub created: i64, pub currency: Option<Currency>, pub default_source: Option<Expandable<PaymentSource>>, pub delinquent: Option<bool>, pub description: Option<String>, pub discount: Option<Discount>, pub email: Option<String>, pub id: CustomerId, pub invoice_credit_balance: Option<HashMap<String, i64>>, pub invoice_prefix: Option<String>, pub invoice_settings: Option<InvoiceSettingCustomerSetting>, pub livemode: bool, pub metadata: Option<HashMap<String, String>>, pub name: Option<String>, pub next_invoice_sequence: Option<i64>, pub phone: Option<String>, pub preferred_locales: Option<Vec<String>>, pub shipping: Option<Shipping>, pub sources: Option<List<PaymentSource>>, pub subscriptions: Option<List<Subscription>>, pub tax: Option<CustomerTax>, pub tax_exempt: Option<CustomerTaxExempt>, pub tax_ids: Option<List<TaxId>>, pub test_clock: Option<Expandable<TestHelpersTestClock>>,
}
Expand description

This object represents a customer of your business. Use it to create recurring charges, save payment and contact information,. and track payments that belong to the same customer.

For more details see <https://stripe.com/docs/api/customers/object>.

Fields§

§address: Option<Address>

The customer’s address.

§balance: Option<i64>

The current balance, if any, that’s stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that’s added to their next invoice. The balance only considers amounts that Stripe hasn’t successfully applied to any invoice. It doesn’t reflect unpaid invoices. This balance is only taken into account after invoices finalize.

§cash_balance: Option<CashBalance>

The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is “cash_balance”. The settings[reconciliation_mode] field describes if these funds apply to these payment intents manually or automatically.

§created: i64

Time at which the object was created. Measured in seconds since the Unix epoch.

§currency: Option<Currency>

Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.

§default_source: Option<Expandable<PaymentSource>>

ID of the default payment source for the customer.

If you use payment methods created through the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

§delinquent: Option<bool>

Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the invoice.due_date will set this field to true.

If an invoice becomes uncollectible by dunning, delinquent doesn’t reset to false.

If you care whether the customer has paid their most recent subscription invoice, use subscription.status instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to false.

§description: Option<String>

An arbitrary string attached to the object. Often useful for displaying to users.

§discount: Option<Discount>

Describes the current discount active on the customer, if there is one.

§email: Option<String>

The customer’s email address.

§id: CustomerId

Unique identifier for the object.

§invoice_credit_balance: Option<HashMap<String, i64>>

The current multi-currency balances, if any, that’s stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that’s added to their next invoice denominated in that currency. These balances don’t apply to unpaid invoices. They solely track amounts that Stripe hasn’t successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes.

§invoice_prefix: Option<String>

The prefix for the customer used to generate unique invoice numbers.

§invoice_settings: Option<InvoiceSettingCustomerSetting>§livemode: bool

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

§metadata: Option<HashMap<String, String>>

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.

§name: Option<String>

The customer’s full name or business name.

§next_invoice_sequence: Option<i64>

The suffix of the customer’s next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.

§phone: Option<String>

The customer’s phone number.

§preferred_locales: Option<Vec<String>>

The customer’s preferred locales (languages), ordered by preference.

§shipping: Option<Shipping>

Mailing and shipping address for the customer. Appears on invoices emailed to this customer.

§sources: Option<List<PaymentSource>>

The customer’s payment sources, if any.

§subscriptions: Option<List<Subscription>>

The customer’s current subscriptions, if any.

§tax: Option<CustomerTax>§tax_exempt: Option<CustomerTaxExempt>

Describes the customer’s tax exemption status, which is none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the following text: “Reverse charge”.

§tax_ids: Option<List<TaxId>>

The customer’s tax IDs.

§test_clock: Option<Expandable<TestHelpersTestClock>>

ID of the test clock that this customer belongs to.

Trait Implementations§

Source§

impl Clone for Customer

Source§

fn clone(&self) -> Customer

Returns a duplicate 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 Debug for Customer

Source§

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

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

impl Deserialize for Customer

Source§

fn begin(out: &mut Option<Customer>) -> &mut dyn Visitor

The only correct implementation of this method is: Read more
Source§

impl Object for Customer

Source§

type Id = CustomerId

The canonical id type for this object.
Source§

fn id(&self) -> &<Customer as Object>::Id

The id of the object.
Source§

fn into_id(self) -> <Customer as Object>::Id

The owned id of the object.
Source§

impl ObjectDeser for Customer

Source§

type Builder = CustomerBuilder

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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

Source§

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

Source§

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