MollieEx.Customers (mollie_ex v0.2.0)

Copy Markdown View Source

Create, retrieve, list, update, and delete Mollie customers.

All functions return result tuples. They do not raise for ordinary API, transport, or validation failures.

Customer creation accepts a caller-owned idempotency key. The SDK never generates idempotency keys implicitly.

{:ok, customer} =
  MollieEx.Customers.create(
    client,
    %{
      name: "Jane Doe",
      email: "jane@example.org"
    },
    idempotency_key: "0e4f812e-5d50-4fcb-8c42-153f17e52147"
  )

Summary

Functions

Creates a Mollie customer.

Deletes a Mollie customer by ID.

Retrieves a Mollie customer by ID.

Lists Mollie customers.

Updates a Mollie customer by ID.

Types

create_option()

(since 0.1.0)
@type create_option() ::
  {:idempotency_key, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

create_params()

(since 0.1.0)
@type create_params() :: map()

delete_option()

(since 0.1.0)
@type delete_option() ::
  {:idempotency_key, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

get_option()

(since 0.1.0)
@type get_option() ::
  {:include, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

list_option()

(since 0.1.0)
@type list_option() ::
  {:from, String.t()}
  | {:limit, pos_integer()}
  | {:sort, :asc | :desc | String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

update_option()

(since 0.1.0)
@type update_option() ::
  {:idempotency_key, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

update_params()

(since 0.1.0)
@type update_params() :: map()

Functions

create(client, params, opts \\ [])

(since 0.1.0)
@spec create(MollieEx.Client.t(), create_params(), [create_option()]) ::
  {:ok, MollieEx.Customer.t()} | {:error, MollieEx.Error.t()}

Creates a Mollie customer.

Customer creation supports caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.

delete(client, customer_id, opts \\ [])

(since 0.1.0)
@spec delete(MollieEx.Client.t(), String.t(), [delete_option()]) ::
  {:ok, :no_content} | {:error, MollieEx.Error.t()}

Deletes a Mollie customer by ID.

Customer deletion supports caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.

get(client, customer_id, opts \\ [])

(since 0.1.0)
@spec get(MollieEx.Client.t(), String.t(), [get_option()]) ::
  {:ok, MollieEx.Customer.t()} | {:error, MollieEx.Error.t()}

Retrieves a Mollie customer by ID.

list(client, opts \\ [])

(since 0.1.0)
@spec list(MollieEx.Client.t(), [list_option()]) ::
  {:ok, MollieEx.List.t(MollieEx.Customer.t())} | {:error, MollieEx.Error.t()}

Lists Mollie customers.

update(client, customer_id, params, opts \\ [])

(since 0.1.0)
@spec update(MollieEx.Client.t(), String.t(), update_params(), [update_option()]) ::
  {:ok, MollieEx.Customer.t()} | {:error, MollieEx.Error.t()}

Updates a Mollie customer by ID.

Customer updates support caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.