Marqeta.CardTransitions (marqeta v1.0.0)

Copy Markdown View Source

Manage card state transitions.

States

  • UNACTIVATEDACTIVE — first activation
  • ACTIVESUSPENDED — temporary hold
  • SUSPENDEDACTIVE — reactivate
  • ACTIVE / SUSPENDEDTERMINATED — permanent close

Channels

API, FRAUD, IVR, ADMIN, SYSTEM, CARDHOLDER, NETWORK

Reason Codes

00 New/replacement card, 01 Mechanical failure, 02 Suspected fraud, 04 Lost, 05 Stolen, 06 Loss of card privileges, 07 Card damaged, 08 Named: cardholder requested, 10 Excessive PIN failures, 16 Account closed, 23 Terminal error, 99 Administrative action.

Examples

{:ok, _} = Marqeta.CardTransitions.create(%{
  card_token: "card_01",
  state: "ACTIVE",
  reason_code: "00",
  channel: "API"
})

Summary

Functions

Creates a new card transition.

Creates a new card transition. Raises Marqeta.Error on failure.

Retrieves a card transition by token.

Retrieves a card transition by token. Raises Marqeta.Error on failure.

Lists card transition resources.

Lists card transition resources. Raises Marqeta.Error on failure.

Lists all state transitions for a specific card.

Returns a lazy Stream that auto-paginates card transition resources.

Streams state transitions for a specific card.

Functions

create(params \\ %{}, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Creates a new card transition.

Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.

create!(params \\ %{}, opts \\ [])

@spec create!(
  map(),
  keyword()
) :: map()

Creates a new card transition. Raises Marqeta.Error on failure.

get(token, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Retrieves a card transition by token.

Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.

get!(token, opts \\ [])

@spec get!(
  String.t(),
  keyword()
) :: map()

Retrieves a card transition by token. Raises Marqeta.Error on failure.

list(params \\ %{}, opts \\ [])

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

Lists card transition resources.

Accepts standard Marqeta pagination params: count, start_index, sort_by, sort_order, fields.

Use stream/2 to lazily iterate all pages automatically.

list!(params \\ %{}, opts \\ [])

@spec list!(
  map(),
  keyword()
) :: map()

Lists card transition resources. Raises Marqeta.Error on failure.

list_by_card(card_token, params \\ %{}, opts \\ [])

@spec list_by_card(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Lists all state transitions for a specific card.

stream(params \\ %{}, opts \\ [])

@spec stream(
  map(),
  keyword()
) :: Enumerable.t()

Returns a lazy Stream that auto-paginates card transition resources.

stream_by_card(card_token, params \\ %{})

@spec stream_by_card(String.t(), map()) :: Enumerable.t()

Streams state transitions for a specific card.