Customer
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.
Summary
Functions
Create a customer
Delete a customer
Delete a customer discount
List all customers
Retrieve a customer
Search customers
Update a customer
Functions
@spec create(StripeElixir.Client.t(), map(), keyword()) :: {:ok, term()} | {:error, StripeElixir.Error.t()}
Create a customer
Creates a new customer object.
@spec delete(StripeElixir.Client.t(), String.t(), map(), keyword()) :: {:ok, term()} | {:error, StripeElixir.Error.t()}
Delete a customer
Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
@spec delete_discount(StripeElixir.Client.t(), String.t(), map(), keyword()) :: {:ok, term()} | {:error, StripeElixir.Error.t()}
Delete a customer discount
Removes the currently applied discount on a customer.
@spec list(StripeElixir.Client.t(), map(), keyword()) :: {:ok, term()} | {:error, StripeElixir.Error.t()}
List all customers
Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
@spec retrieve(StripeElixir.Client.t(), String.t(), map(), keyword()) :: {:ok, term()} | {:error, StripeElixir.Error.t()}
Retrieve a customer
Retrieves a Customer object.
@spec search(StripeElixir.Client.t(), map(), keyword()) :: {:ok, term()} | {:error, StripeElixir.Error.t()}
Search customers
Search for customers 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.
@spec update(StripeElixir.Client.t(), String.t(), map(), keyword()) :: {:ok, term()} | {:error, StripeElixir.Error.t()}
Update a 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.