Sumup.Memberships (Sumup v1.0.0)

Copy Markdown View Source

Memberships: lists the currently authenticated user's memberships across merchants/organizations, optionally filtered by resource type, role, status, or parent. API version v0.1.

Unlike Sumup.Members (which lists members of a given merchant), this resource has no merchant/user id in its path — it always reflects whichever user the request is authenticated as.

Summary

Functions

Lists the current user's memberships.

Lists the current user's memberships and decodes them as Sumup.Membership structs (a convenience over list/2, which returns the raw paginated envelope with "total_count").

Functions

list(config, opts \\ [])

@spec list(
  Sumup.Config.t(),
  keyword()
) :: {:ok, map()} | {:error, Sumup.Error.t()}

Lists the current user's memberships.

  • :offset (non_neg_integer/0) - Page offset. The default value is 0.

  • :limit (pos_integer/0) - Page size (max 25). The default value is 10.

  • :kind (String.t/0) - Filter by resource type, e.g. "merchant" or "organization".

  • :status - Filter by membership status.

  • :resource_type (String.t/0) - Same as :kind, filters by resource.type.

  • :resource_name (String.t/0) - Filter by resource.name.

  • :resource_sandbox (boolean/0) - Filter by resource.attributes.sandbox.

  • :resource_parent_id (String.t/0) - Filter by resource.parent.id.

  • :resource_parent_type (String.t/0) - Filter by resource.parent.type.

  • :roles (list of String.t/0) - Filter to one or more role ids.

list_memberships(config, opts \\ [])

@spec list_memberships(
  Sumup.Config.t(),
  keyword()
) :: {:ok, [Sumup.Membership.t()]} | {:error, Sumup.Error.t()}

Lists the current user's memberships and decodes them as Sumup.Membership structs (a convenience over list/2, which returns the raw paginated envelope with "total_count").