Struct stripe::Customer [−][src]
The resource representing a Stripe "Customer".
For more details see https://stripe.com/docs/api/customers/object.
Fields
id: CustomerId
Unique identifier for the object.
address: Option<Address>
The customer's address.
balance: Option<i64>
Current balance, if any, being 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 will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
created: Option<Timestamp>
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 are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.
deleted: bool
delinquent: Option<bool>
When the customer's latest invoice is billed by charging automatically, delinquent
is true
if the invoice's latest charge failed.
When the customer's latest invoice is billed by sending an invoice, delinquent
is true
if the invoice isn't paid by its due date. If an invoice is marked uncollectible by dunning, delinquent
doesn't get reset 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.
invoice_prefix: Option<String>
The prefix for the customer used to generate unique invoice numbers.
invoice_settings: Option<InvoiceSettingCustomerSetting>
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.
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, e.g., 0001.
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: List<PaymentSource>
The customer's payment sources, if any.
subscriptions: List<Subscription>
The customer's current subscriptions, if any.
tax_exempt: Option<CustomerTaxExempt>
Describes the customer's tax exemption status.
One of none
, exempt
, or reverse
.
When set to reverse
, invoice and receipt PDFs include the text "Reverse charge".
tax_ids: List<TaxId>
The customer's tax IDs.
Implementations
impl Customer
[src]
pub fn list(
client: &Client,
params: ListCustomers<'_>
) -> Response<List<Customer>>
[src]
client: &Client,
params: ListCustomers<'_>
) -> Response<List<Customer>>
Returns a list of your customers.
The customers are returned sorted by creation date, with the most recent customers appearing first.
pub fn create(client: &Client, params: CreateCustomer<'_>) -> Response<Customer>
[src]
Creates a new customer object.
pub fn retrieve(
client: &Client,
id: &CustomerId,
expand: &[&str]
) -> Response<Customer>
[src]
client: &Client,
id: &CustomerId,
expand: &[&str]
) -> Response<Customer>
Retrieves the details of an existing customer.
You need only supply the unique customer identifier that was returned upon customer creation.
pub fn update(
client: &Client,
id: &CustomerId,
params: UpdateCustomer<'_>
) -> Response<Customer>
[src]
client: &Client,
id: &CustomerId,
params: UpdateCustomer<'_>
) -> Response<Customer>
Updates the specified customer by setting the values of the parameters passed.
Any parameters not provided will be left unchanged.
For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future.
When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due
state, then the latest open invoice for the subscription with automatic collection enabled will be retried.
This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice.
Changing the default_source for a customer will not trigger this behavior. This request accepts mostly the same arguments as the customer creation call.
pub fn delete(client: &Client, id: &CustomerId) -> Response<Deleted<CustomerId>>
[src]
Permanently deletes a customer.
It cannot be undone. Also immediately cancels any active subscriptions on the customer.
impl Customer
[src]
pub fn attach_source(
client: &Client,
customer_id: &CustomerId,
source: PaymentSourceParams
) -> Response<PaymentSource>
[src]
client: &Client,
customer_id: &CustomerId,
source: PaymentSourceParams
) -> Response<PaymentSource>
Attaches a source to a customer, does not change default Source for the Customer
For more details see https://stripe.com/docs/api#attach_source.
pub fn detach_source(
client: &Client,
customer_id: &CustomerId,
source_id: &PaymentSourceId
) -> Response<DetachedSource>
[src]
client: &Client,
customer_id: &CustomerId,
source_id: &PaymentSourceId
) -> Response<DetachedSource>
Detaches a source from a customer
For more details see https://stripe.com/docs/api#detach_source.
pub fn retrieve_source(
client: &Client,
customer_id: &CustomerId,
source_id: &PaymentSourceId
) -> Response<PaymentSource>
[src]
client: &Client,
customer_id: &CustomerId,
source_id: &PaymentSourceId
) -> Response<PaymentSource>
Retrieves a Card, BankAccount, or Source for a Customer
pub fn verify_bank_account(
client: &Client,
customer_id: &CustomerId,
bank_account_id: &BankAccountId,
params: VerifyBankAccount<'_>
) -> Response<BankAccount>
[src]
client: &Client,
customer_id: &CustomerId,
bank_account_id: &BankAccountId,
params: VerifyBankAccount<'_>
) -> Response<BankAccount>
Verifies a Bank Account for a Customer.
For more details see https://stripe.com/docs/api/customer_bank_accounts/verify.
Trait Implementations
impl Clone for Customer
[src]
impl Debug for Customer
[src]
impl<'de> Deserialize<'de> for Customer
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Object for Customer
[src]
type Id = CustomerId
The canonical id type for this object.
fn id(&self) -> Self::Id
[src]
fn object(&self) -> &'static str
[src]
impl Serialize for Customer
[src]
Auto Trait Implementations
impl RefUnwindSafe for Customer
[src]
impl Send for Customer
[src]
impl Sync for Customer
[src]
impl Unpin for Customer
[src]
impl UnwindSafe for Customer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,