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

Resource access requested through a grant request's `access_token` field.

Required `access` is an ordered list of typed access entries, validated by
`OpenPayments.Types.Access`. The pinned schema permits additional JSON fields,
which are retained in `extensions`. Empty access arrays remain valid.

Inspection omits all values because access can contain card authorization data.
Explicit map/JSON export includes the protocol payload. This type does not
issue, store or manage access tokens. Validate manually modified structs with
`validate/1`; `to_map/1` converts shape without validating it.

# `t`

```elixir
@type t() :: %OpenPayments.Types.AccessTokenRequest{
  access: OpenPayments.Types.Access.t(),
  extensions: %{optional(String.t()) =&gt; term()}
}
```

# `from_map`

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

Decodes the requested access array and preserves permitted extension fields.

# `to_map`

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

Converts to grant protocol fields, including card payloads, without validating.

# `validate`

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

Revalidates typed access entries, array constraints and extension fields.

---

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