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

The response to rotating an issued access token.

Required `access_token` becomes an `AccessToken`; permitted additional JSON
fields remain in `extensions`. The wrapper is retained, matching the wire
response and Node's rotate result. All nested access entries are validated.

Inspection omits payload values; explicit map/JSON exports include the token
and any card results. This codec does not update a client, persist a token,
assess expiry or compare old/new access. Validate modified structs with
`validate/1`; `to_map/1` converts shape without validating it.

# `t`

```elixir
@type t() :: %OpenPayments.Types.TokenRotationResponse{
  access_token: OpenPayments.Types.AccessToken.t(),
  extensions: %{optional(String.t()) =&gt; term()}
}
```

# `from_map`

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

Decodes the issued token wrapper and preserves permitted JSON extensions.

# `to_map`

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

Converts to protocol fields, including token/card values, without validating.

# `validate`

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

Revalidates the issued token and JSON extension data.

---

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