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

A subject identifier requested or returned in a grant's subject information.

The pinned schema requires an `id` string and the format discriminator `uri`.
The `id` property itself has no URI format/pattern constraint, so this codec
checks its string type without imposing wallet discovery or request URL rules.
Additional JSON fields are retained in `extensions`.

Inspection omits the identifier and extensions. Explicit map/JSON export includes
them. This type does not resolve a wallet, verify identity, or make requests.
Validate manually constructed or modified structs with `validate/1`;
`to_map/1` converts shape without validating it.

# `t`

```elixir
@type t() :: %OpenPayments.Types.SubjectIdentifier{
  extensions: %{optional(String.t()) =&gt; term()},
  format: String.t(),
  id: String.t()
}
```

# `from_map`

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

Decodes a subject identifier without interpreting or resolving its value.

# `to_map`

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

Converts to protocol fields, including the identifier, without validating.

# `validate`

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

Validates the identifier, format discriminator and permitted extension data.

---

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