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

Spent amounts for the current outgoing-payment grant or recurring interval.

Both spent_receive_amount and spent_debit_amount are required. Each is a typed
`Amount` or nil for explicit JSON null, matching the pinned grant-spent endpoint
and Node's response type. Missing map fields are invalid. Unlike optional spent
fields on creation responses, nil here is always exported as null.

Permitted additional JSON fields remain in extensions. Amount decimal spelling,
asset data and nested extensions are preserved. The codec does not replace null
with zero, infer grant existence or budget, compare assets/values, interpret
recurring intervals, track spending or make requests/payments. The server
determines the grant and current interval associated with the presented token.

Inspection hides all payload data. Explicit map/JSON exports include amounts
and extensions; errors retain safe field paths without rejected data or unknown
names. Validate modified structs with `validate/1`; `to_map/1` converts without
validating.

# `t`

```elixir
@type t() :: %OpenPayments.Types.OutgoingPaymentGrantSpentAmounts{
  extensions: %{optional(String.t()) =&gt; term()},
  spent_debit_amount: OpenPayments.Types.Amount.t() | nil,
  spent_receive_amount: OpenPayments.Types.Amount.t() | nil
}
```

# `from_map`

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

Decodes both required amount-or-null fields and preserves JSON extensions.

# `to_map`

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

Exports both protocol fields, including explicit nulls, without validating.

# `validate`

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

Revalidates both nullable typed amounts and reserved-field-safe JSON extensions.

---

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