Triple.Types.Enrich.V2.Request (triple v1.0.0)

Copy Markdown View Source

Request payload for POST /v2/enrich-unstructured-transaction/ — free-text transaction enrichment, for when all you have is a raw description string rather than discrete merchant fields.

Build one with new/1 rather than constructing the struct directly.

Summary

Functions

Builds and validates a request from a map or keyword list.

Types

t()

@type t() :: %Triple.Types.Enrich.V2.Request{
  text: String.t() | nil,
  transaction_amount: number() | String.t() | nil,
  transaction_currency: String.t() | nil,
  transaction_id: String.t() | nil
}

Functions

new(attrs)

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

Builds and validates a request from a map or keyword list.

Returns {:ok, t()} or {:error, %Triple.Error{type: :validation}}.