# `OpenPayments.Types.InteractionRequest`
[🔗](https://github.com/interledger/open-payments-elixir/blob/v1.0.0/lib/open_payments/types/interaction_request.ex#L1)

Consent interaction preferences sent in a grant request's `interact` field.

The pinned schema requires a `start` array whose entries are `redirect`. It
does not require the array to be nonempty or unique. Optional `finish` becomes
a typed `InteractionFinish`; omission becomes nil, while explicit null is invalid.
Additional JSON fields are preserved in `extensions` at both object levels.

Inspection omits the callback and extensions. Map/JSON export includes callback
nonces. This type does not generate nonces, open a consent page, verify callback
hashes or continue a grant. Validate manually constructed or modified structs
with `validate/1`; `to_map/1` converts shape without validating it.

# `t`

```elixir
@type t() :: %OpenPayments.Types.InteractionRequest{
  extensions: %{optional(String.t()) =&gt; term()},
  finish: OpenPayments.Types.InteractionFinish.t() | nil,
  start: [String.t()]
}
```

# `from_map`

```elixir
@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}
```

Decodes and validates grant interaction preferences and callback data.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Converts to protocol fields, including callback nonces, without validating.

# `validate`

```elixir
@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}
```

Validates a struct and its typed callback, treating nil finish as omitted.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
