Qronomnom.Customers (Qronomnom v0.1.1)
Functions for interacting with Customers resource.
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
create(client, customer_data)
Specs
create(Tesla.Client.t(), customer_type()) :: {:error, any()} | {:ok, customer_type()}
Creates a customer.
Note that account
must be a valid account ID hash.
Examples
iex> Qronomnom.client(%{api_key: "MY_KEY"}) |> Qronomnom.Customers.create(%{
account: "asklf",
email: "string",
full_name: "string",
nickname: "string",
phone: "string",
metadata: %{
additionalProp: "foo"
}
})
{:ok, %{customer_id: "cus_EvLnqYo", ...}}
Link to this function
index(client)
Specs
index(Tesla.Client.t()) :: {:error, any()} | {:ok, customer_type()}
Lists customers.
Examples
iex> Qronomnom.client(%{api_key: "MY_KEY"}) |> Qronomnom.Customers.index()
{:ok, [%{customer_id: "cus_EvLnqYo"}, %{customer_id: "cus_SFOo"}]}
Link to this function
show(client, customer_id)
Specs
show(Tesla.Client.t(), String.t()) :: {:error, any()} | {:ok, customer_type()}
Shows a single customer.
Examples
iex> Qronomnom.client(%{api_key: "MY_KEY"}) |> Qronomnom.Customers.show("cus_EvLnqYo")
{:ok, %{customer_id: "cus_EvLnqYo"}}
Link to this function
update(client, customer_id, customer_data)
Specs
update(Tesla.Client.t(), String.t(), customer_type()) :: {:error, any()} | {:ok, customer_type()}
Updates a customer.
Examples
iex> Qronomnom.client(%{api_key: "MY_KEY"}) |> Qronomnom.Customers.update("cus_EvLnqYo", %{
email: "string",
full_name: "string",
nickname: "string",
phone: "string",
metadata: %{
additionalProp: "foo"
}
})
{:ok, %{customer_id: "cus_EvLnqYo", ...}}