# `AdyenClient.Checkout.Modifications`
[🔗](https://github.com/iamkanishka/adyen_client/blob/v1.0.0/lib/adyen_client/checkout/modifications.ex#L1)

Adyen Checkout Modifications API.

Capture, cancel, refund, reverse, and update authorised payments.
All modification endpoints require the `paymentPspReference` from the
original authorisation response.

# `cancel`

```elixir
@spec cancel(String.t(), map(), keyword()) :: AdyenClient.Client.response()
```

Cancel an authorised payment (by PSP reference path).

## Parameters
- `psp_reference` — the PSP reference of the authorisation
- `params` — `%{merchantAccount: "..."}` plus optional `reference`

# `cancel_by_reference`

```elixir
@spec cancel_by_reference(
  map(),
  keyword()
) :: AdyenClient.Client.response()
```

Cancel an authorised payment using your own merchant reference (global endpoint).
Use when you don't have the PSP reference yet.

## Parameters
- `params` — must include `merchantAccount` and `reference` (your original order reference)

# `capture`

```elixir
@spec capture(String.t(), map(), keyword()) :: AdyenClient.Client.response()
```

Capture an authorised payment.

## Parameters
- `psp_reference` — the PSP reference of the authorisation
- `params` — at minimum `%{merchantAccount: "...", amount: %{currency: "USD", value: 1000}}`

# `refund`

```elixir
@spec refund(String.t(), map(), keyword()) :: AdyenClient.Client.response()
```

Refund a captured payment.

## Parameters
- `psp_reference` — PSP reference of the captured payment
- `params` — `%{merchantAccount: "...", amount: %{currency: "USD", value: 500}}`

# `reverse`

```elixir
@spec reverse(String.t(), map(), keyword()) :: AdyenClient.Client.response()
```

Reverse a payment — refund if captured, cancel if not yet captured.

## Parameters
- `psp_reference` — PSP reference of the payment
- `params` — `%{merchantAccount: "..."}`

# `update_amount`

```elixir
@spec update_amount(String.t(), map(), keyword()) :: AdyenClient.Client.response()
```

Update the authorised amount of a payment.

Useful for tip adjustments or incremental authorisations.

## Parameters
- `psp_reference` — PSP reference of the authorisation
- `params` — `%{merchantAccount: "...", amount: %{currency: "USD", value: 1100}, industryUsage: "DelayedCharge"}`

---

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