Create, retrieve, list, and cancel Mollie payment refunds.
All functions return result tuples. They do not raise for ordinary API, transport, or validation failures.
Refund write operations accept caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.
{:ok, refund} =
MollieEx.Refunds.create(
client,
"tr_123",
%{amount: %{currency: "EUR", value: "10.00"}},
idempotency_key: "f7f88f02-9a60-4a1f-bab8-8ef9e29cfeaf"
)
Summary
Functions
Cancels a Mollie refund by payment ID and refund ID.
Creates a refund for a Mollie payment.
Retrieves a Mollie refund by payment ID and refund ID.
Lists Mollie refunds for a payment.
Types
@type cancel_option() :: {:idempotency_key, String.t()} | {:testmode, boolean()} | {:pool_timeout, pos_integer()} | {:receive_timeout, pos_integer()} | {:request_timeout, pos_integer()}
@type create_option() :: {:idempotency_key, String.t()} | {:testmode, boolean()} | {:pool_timeout, pos_integer()} | {:receive_timeout, pos_integer()} | {:request_timeout, pos_integer()}
@type create_params() :: map()
@type get_option() :: {:embed, String.t()} | {:testmode, boolean()} | {:pool_timeout, pos_integer()} | {:receive_timeout, pos_integer()} | {:request_timeout, pos_integer()}
@type list_option() :: {:from, String.t()} | {:limit, pos_integer()} | {:embed, String.t()} | {:testmode, boolean()} | {:pool_timeout, pos_integer()} | {:receive_timeout, pos_integer()} | {:request_timeout, pos_integer()}
Functions
@spec cancel(MollieEx.Client.t(), String.t(), String.t(), [cancel_option()]) :: {:ok, :no_content} | {:error, MollieEx.Error.t()}
Cancels a Mollie refund by payment ID and refund ID.
Refund cancellation supports caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.
@spec create(MollieEx.Client.t(), String.t(), create_params(), [create_option()]) :: {:ok, MollieEx.Refund.t()} | {:error, MollieEx.Error.t()}
Creates a refund for a Mollie payment.
Refund creation supports caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.
@spec get(MollieEx.Client.t(), String.t(), String.t(), [get_option()]) :: {:ok, MollieEx.Refund.t()} | {:error, MollieEx.Error.t()}
Retrieves a Mollie refund by payment ID and refund ID.
@spec list(MollieEx.Client.t(), String.t(), [list_option()]) :: {:ok, MollieEx.List.t(MollieEx.Refund.t())} | {:error, MollieEx.Error.t()}
Lists Mollie refunds for a payment.