Manage individual cardholders (users) on the Marqeta platform.
User states
UNVERIFIED— created, identity not yet verifiedLIMITED— partial verification; restricted transaction accessACTIVE— fully verified and operationalSUSPENDED— temporarily frozen; no transactions permittedCLOSED— permanently closed
Identification types
SSN, PASSPORT, DRIVERS_LICENSE, SIN, TIN, CPF
Example
{:ok, user} = Marqeta.Users.create(%{
first_name: "Jane",
last_name: "Doe",
email: "jane@example.com",
address1: "123 Main St",
city: "San Francisco",
state: "CA",
postal_code: "94105",
country: "USA",
birth_date: "1990-01-15",
identifications: [%{type: "SSN", value: "123456789"}]
})
Summary
Functions
Returns the GPA balance for a user.
Creates a new user.
Creates a new user. Raises Marqeta.Error on failure.
Creates a note on a user.
Retrieves a user by token.
Retrieves a user by token. Raises Marqeta.Error on failure.
Retrieves KYC verification status for a user.
Lists user resources.
Lists user resources. Raises Marqeta.Error on failure.
Lists addresses associated with a user.
Lists users in an account holder group.
Lists all cards belonging to a user.
Lists child users of a parent user (for hierarchical account structures).
Lists MSA (Merchant-Specific Account) balances for a user.
Lists notes on a user.
Searches for users by one or more criteria (email, first_name, last_name, phone, ssn).
Searches for users. Raises Marqeta.Error on failure.
Generates a single sign-on (SSO) token for the cardholder portal.
Returns a lazy Stream that auto-paginates user resources.
Returns a lazy stream of all cards for a user.
Returns a lazy stream of all transactions for a user.
Lists transactions for a user.
Updates an existing user.
Updates an existing user. Raises Marqeta.Error on failure.
Updates a note on a user.
Functions
@spec balances( String.t(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Returns the GPA balance for a user.
@spec create( map(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Creates a new user.
Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.
Creates a new user. Raises Marqeta.Error on failure.
@spec create_note(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Creates a note on a user.
@spec get( String.t(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Retrieves a user by token.
Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.
Retrieves a user by token. Raises Marqeta.Error on failure.
@spec kyc_status( String.t(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Retrieves KYC verification status for a user.
@spec list( map(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists user resources.
Accepts standard Marqeta pagination params:
count, start_index, sort_by, sort_order, fields.
Use stream/2 to lazily iterate all pages automatically.
Lists user resources. Raises Marqeta.Error on failure.
@spec list_addresses(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists addresses associated with a user.
@spec list_by_account_holder_group(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists users in an account holder group.
@spec list_cards(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists all cards belonging to a user.
@spec list_children(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists child users of a parent user (for hierarchical account structures).
@spec list_msa_balances(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists MSA (Merchant-Specific Account) balances for a user.
@spec list_notes(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists notes on a user.
@spec search( map(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Searches for users by one or more criteria (email, first_name, last_name, phone, ssn).
Searches for users. Raises Marqeta.Error on failure.
@spec sso_token(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Generates a single sign-on (SSO) token for the cardholder portal.
@spec stream( map(), keyword() ) :: Enumerable.t()
Returns a lazy Stream that auto-paginates user resources.
@spec stream_cards(String.t(), map()) :: Enumerable.t()
Returns a lazy stream of all cards for a user.
@spec stream_transactions(String.t(), map()) :: Enumerable.t()
Returns a lazy stream of all transactions for a user.
@spec transactions(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists transactions for a user.
@spec update(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Updates an existing user.
Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.
Updates an existing user. Raises Marqeta.Error on failure.
@spec update_note(String.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Updates a note on a user.