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

Limits under which a grant can authorize outgoing payments.

Supports no amount, a typed `debit_amount`, or a typed `receive_amount`.
Debit and receive amounts are mutually exclusive, matching Node's grant-request
validation in addition to the permissive schema branches. Optional `receiver`
follows the schema's URI format and HTTP(S) incoming-payment URL pattern.
Optional `interval` is a string: its ISO 8601 description supplies no pattern
or format validator, so this codec preserves it without parsing recurrence.

Omitted fields become nil; explicit JSON nulls are rejected. Empty limits are
allowed. Additional JSON fields are retained in `extensions`. URI/interval
spelling and amount strings are preserved. No network requests, budget tracking
or interval calculations occur. Inspection omits amounts and extension metadata.

Struct literals can bypass validation. Call `validate/1` after constructing or
modifying a struct; `to_map/1` converts its shape without validating it.

# `t`

```elixir
@type t() :: %OpenPayments.Types.OutgoingLimits{
  debit_amount: OpenPayments.Types.Amount.t() | nil,
  extensions: %{optional(String.t()) =&gt; term()},
  interval: String.t() | nil,
  receive_amount: OpenPayments.Types.Amount.t() | nil,
  receiver: String.t() | nil
}
```

# `from_map`

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

Decodes limits with at most one amount, keeping permitted JSON extensions.

# `to_map`

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

Converts to protocol fields, omitting nil values, without validating.

# `validate`

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

Validates a struct, treating nil fields as omitted.

---

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