# `Wise.Services.OAuth`
[🔗](https://github.com/iamkanishka/wise/blob/v1.0.0/lib/wise/services/oauth.ex#L1)

Wise OAuth 2.0 token exchange and refresh.

# `authorization_url`

```elixir
@spec authorization_url(Wise.Config.t(), String.t(), String.t(), keyword()) ::
  String.t()
```

Generates the OAuth authorization URL.

# `exchange_code`

```elixir
@spec exchange_code(Wise.Config.t(), String.t(), String.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, Wise.Error.t()}
```

Exchanges an authorization code for tokens.

# `exchange_registration_code`

```elixir
@spec exchange_registration_code(Wise.Config.t(), String.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, Wise.Error.t()}
```

Exchanges a registration code for tokens.

# `refresh_token`

```elixir
@spec refresh_token(Wise.Config.t(), String.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, Wise.Error.t()}
```

Refreshes an access token.

---

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