Marqeta.CardProducts (marqeta v1.0.0)

Copy Markdown View Source

Card product templates that define card behaviour, fulfillment, JIT funding mode, velocity controls, contactless SCA limits, and more.

Every card issued on your program is derived from a card product.

Examples

{:ok, cp} = Marqeta.CardProducts.create(%{
  name: "My Virtual Prepaid Card",
  start_date: "2024-01-01",
  config: %{
    card_life_cycle: %{activate_upon_issue: true},
    fulfillment: %{payment_instrument: "VIRTUAL_PAN"},
    jit_funding: %{
      program_funding_source: %{
        funding_source_token: "my_program_fs",
        enabled: true
      }
    }
  }
})

Summary

Functions

Creates a new card product.

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

Retrieves a card product by token.

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

Lists card product resources.

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

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

Updates an existing card product.

Updates an existing card product. Raises Marqeta.Error on failure.

Functions

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

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

Creates a new card product.

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

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

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

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

get(token, opts \\ [])

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

Retrieves a card product by token.

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

get!(token, opts \\ [])

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

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

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

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

Lists card product 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 product resources. Raises Marqeta.Error on failure.

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

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

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

update(token, params, opts \\ [])

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

Updates an existing card product.

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

update!(token, params, opts \\ [])

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

Updates an existing card product. Raises Marqeta.Error on failure.