TreasuryPrime.CardAuthLoopEndpoint (TreasuryPrime v1.0.0)

Copy Markdown View Source

Registers a webhook-like HTTP endpoint that Treasury Prime calls synchronously, in real time, for every authorization on a TreasuryPrime.CardProduct that references it (via the card product's card_auth_loop_endpoint_id) — letting you accept or reject each card transaction yourself (e.g. for velocity limits, custom fraud rules, or balance checks beyond what card_controls supports).

Your endpoint receives an HTTP POST with a TreasuryPrime.CardEvent JSON body and must respond with an empty JSON body and one of the documented HTTP status codes within Treasury Prime's response time budget — any other code, or a timeout, falls back to the default authorization behavior. See the "Card Auth Loop Endpoint Protocol" guide for the exact status codes and timing requirements.

Summary

Functions

Registers a new card auth loop endpoint. Required: url.

Deletes a card auth loop endpoint.

Fetches a single card auth loop endpoint by id.

Lists card auth loop endpoints.

Updates a card auth loop endpoint.

Types

t()

@type t() :: %TreasuryPrime.CardAuthLoopEndpoint{
  created_at: String.t() | nil,
  id: String.t() | nil,
  status: String.t() | nil,
  updated_at: String.t() | nil,
  url: String.t() | nil,
  userdata: map() | nil
}

Functions

create(client, params, opts \\ [])

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

Registers a new card auth loop endpoint. Required: url.

create!(client, params, opts \\ [])

@spec create!(TreasuryPrime.Client.t(), map(), keyword()) :: t()

delete(client, id)

@spec delete(TreasuryPrime.Client.t(), String.t()) ::
  {:ok, nil} | {:error, TreasuryPrime.Error.t()}

Deletes a card auth loop endpoint.

delete!(client, id)

@spec delete!(TreasuryPrime.Client.t(), String.t()) :: nil

get(client, id)

@spec get(TreasuryPrime.Client.t(), String.t()) ::
  {:ok, t()} | {:error, TreasuryPrime.Error.t()}

Fetches a single card auth loop endpoint by id.

get!(client, id)

@spec get!(TreasuryPrime.Client.t(), String.t()) :: t()

list(client, params \\ %{})

@spec list(TreasuryPrime.Client.t(), map()) ::
  {:ok, TreasuryPrime.Page.t()} | {:error, TreasuryPrime.Error.t()}

Lists card auth loop endpoints.

list!(client, params \\ %{})

update(client, id, params)

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

Updates a card auth loop endpoint.

update!(client, id, params)

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