GoCardlessClient Customers API.
Customers represent the people or organisations you collect payments from. Each customer can have multiple bank accounts and mandates.
Example
{:ok, customer} = GoCardlessClient.Resources.Customers.create(client, %{
email: "alice@example.com",
given_name: "Alice",
family_name: "Smith",
country_code: "GB"
})
Summary
Functions
Eagerly collects all customers into a list.
Creates a new customer. :email is required.
Retrieves a single customer by ID.
Returns a page of customers with optional filters (:email, :created_at[gte], etc.).
Removes (GDPR-erases) a customer. All associated mandates are cancelled.
Returns a lazy Stream over all pages of customers.
Updates a customer. All params are optional.
Functions
@spec collect_all(GoCardlessClient.Client.t(), map(), keyword()) :: {:ok, [map()]} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Eagerly collects all customers into a list.
@spec create(GoCardlessClient.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Creates a new customer. :email is required.
@spec get(GoCardlessClient.Client.t(), String.t(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Retrieves a single customer by ID.
@spec list(GoCardlessClient.Client.t(), map(), keyword()) :: {:ok, %{items: [map()], meta: map()}} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Returns a page of customers with optional filters (:email, :created_at[gte], etc.).
@spec remove(GoCardlessClient.Client.t(), String.t(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Removes (GDPR-erases) a customer. All associated mandates are cancelled.
@spec stream(GoCardlessClient.Client.t(), map(), keyword()) :: Enumerable.t()
Returns a lazy Stream over all pages of customers.
@spec update(GoCardlessClient.Client.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}
Updates a customer. All params are optional.