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

The bundled Open Payments specification and operation inventory.

Documents are loaded at compilation, so using the SDK does not fetch schemas
from a server or depend on a Git submodule. `revision/0` identifies the exact
upstream commit from which the documents were copied.

# `operation`

```elixir
@type operation() :: %{
  server: server(),
  method: :get | :post | :delete,
  path: String.t(),
  id: String.t(),
  success_statuses: [pos_integer()]
}
```

# `server`

```elixir
@type server() :: :auth | :resource | :wallet_address
```

# `document`

```elixir
@spec document(server()) :: map()
```

Returns the bundled OpenAPI document for a server.

# `fetch_schema`

```elixir
@spec fetch_schema(server(), String.t()) :: {:ok, map()} | :error
```

Fetches a named component schema, or returns `:error` if it is unknown.

# `operations`

```elixir
@spec operations() :: [operation()]
```

Lists supported protocol operations in stable order by operation ID.

# `revision`

```elixir
@spec revision() :: String.t()
```

The full upstream specification commit SHA.

# `version`

```elixir
@spec version() :: String.t()
```

The bundled specification's semantic version.

---

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