Rule-based controls that restrict which merchants cardholders can transact with.
Supports MCC codes, merchant groups, specific merchant IDs, and geographic restrictions (country-level).
Examples
# Block all gambling MCCs for a card product
{:ok, _} = Marqeta.AuthorizationControls.create(%{
name: "No Gambling",
association: %{card_product_token: "cp_01"},
merchant_scope: %{mcc_group: "gambling_mccs"},
active: true
})
Summary
Functions
Adds an exemption to an authorization control.
Creates a new authorization control.
Creates a new authorization control. Raises Marqeta.Error on failure.
Retrieves a authorization control by token.
Retrieves a authorization control by token. Raises Marqeta.Error on failure.
Lists authorization control resources.
Lists authorization control resources. Raises Marqeta.Error on failure.
Lists exemptions configured on an authorization control.
Removes an exemption from an authorization control.
Returns a lazy Stream that auto-paginates authorization control resources.
Updates an existing authorization control.
Updates an existing authorization control. Raises Marqeta.Error on failure.
Functions
@spec add_exemption(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Adds an exemption to an authorization control.
@spec create( map(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Creates a new authorization control.
Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.
Creates a new authorization control. Raises Marqeta.Error on failure.
@spec get( String.t(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Retrieves a authorization control by token.
Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.
Retrieves a authorization control by token. Raises Marqeta.Error on failure.
@spec list( map(), keyword() ) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists authorization control resources.
Accepts standard Marqeta pagination params:
count, start_index, sort_by, sort_order, fields.
Use stream/2 to lazily iterate all pages automatically.
Lists authorization control resources. Raises Marqeta.Error on failure.
@spec list_exemptions(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Lists exemptions configured on an authorization control.
@spec remove_exemption(String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Removes an exemption from an authorization control.
@spec stream( map(), keyword() ) :: Enumerable.t()
Returns a lazy Stream that auto-paginates authorization control resources.
@spec update(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}
Updates an existing authorization control.
Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.
Updates an existing authorization control. Raises Marqeta.Error on failure.