ExPlain.CustomerGroups (ExPlain v0.3.0)

Copy Markdown View Source

Operations for managing customer groups in Plain.

Summary

Functions

Fetches a customer group by its Plain ID. Returns {:ok, nil} if not found.

Returns a paginated list of customer groups.

Functions

get_by_id(client, customer_group_id)

@spec get_by_id(ExPlain.Client.t(), String.t()) ::
  {:ok, ExPlain.CustomerGroups.CustomerGroup.t() | nil}
  | {:error, ExPlain.Error.t()}

Fetches a customer group by its Plain ID. Returns {:ok, nil} if not found.

list(client, opts \\ [])

@spec list(
  ExPlain.Client.t(),
  keyword()
) ::
  {:ok,
   %{
     nodes: [ExPlain.CustomerGroups.CustomerGroup.t()],
     page_info: ExPlain.PageInfo.t()
   }}
  | {:error, ExPlain.Error.t()}

Returns a paginated list of customer groups.

Options

Pagination: first:, after:, last:, before:.