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

Detailed incoming-payment data with the payment methods required by create and
authenticated read responses.

Follows `incoming-payment-with-access-token`: all `IncomingPayment` detail
fields plus required unique `methods`, decoded as typed `ILPPaymentMethod`
structs. Empty arrays are allowed. Fields remain flat on this struct; detail
validation is shared with `IncomingPayment`. Method uniqueness compares complete
protocol objects, preserving entry order.

Optional fields distinguish omission from explicit null, and permitted JSON
extensions are retained. `authServer` is not required by this schema and remains
extension data if supplied. URI/timestamp spelling is preserved without asset,
amount or chronological comparisons. Operation-level checks are separate.

Inspection omits methods, amounts, metadata and extensions. Explicit map/JSON
exports include ILP shared secrets and all protocol data. Errors retain safe
field/index paths. This codec makes no requests or STREAM connections.
Validate modified structs with `validate/1`; `to_map/1` converts shape without
validating it.

# `t`

```elixir
@type t() :: %OpenPayments.Types.IncomingPaymentWithMethods{
  completed: boolean(),
  created_at: String.t(),
  expires_at: String.t() | nil,
  extensions: %{optional(String.t()) =&gt; term()},
  id: String.t(),
  incoming_amount: OpenPayments.Types.Amount.t() | nil,
  metadata: %{optional(String.t()) =&gt; term()} | nil,
  methods: [OpenPayments.Types.ILPPaymentMethod.t()],
  received_amount: OpenPayments.Types.Amount.t(),
  wallet_address: String.t()
}
```

# `from_map`

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

Decodes the detailed payment and its required array of typed payment methods.

# `to_map`

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

Converts to protocol fields, including method secrets, without validating.

# `validate`

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

Revalidates all detail fields, typed methods, uniqueness and extension data.

---

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