Moov.Refunds (Moov v1.0.0)

Copy Markdown View Source

Refund or cancel card transfers.

Moov offers two mechanisms: the original refunds sub-resource, and the newer, more flexible reversals sub-resource which can both cancel an uncaptured/unsettled transfer and refund a settled one. New integrations should generally prefer create_reversal/3.

See https://docs.moov.io/api/money-movement/refunds/.

Summary

Functions

Creates a refund via the original refunds sub-resource.

Cancels or refunds a card transfer via the reversals sub-resource.

Lists refunds issued against a transfer.

Functions

create(client, account_id, transfer_id, params \\ %{})

@spec create(Moov.Client.t(), String.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Creates a refund via the original refunds sub-resource.

params: %{amount: %{currency: "USD", value: 500}} for a partial refund, or omit :amount to refund the full amount.

create_reversal(client, account_id, transfer_id, params \\ %{})

@spec create_reversal(Moov.Client.t(), String.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Cancels or refunds a card transfer via the reversals sub-resource.

params: %{amount: %{currency: "USD", value: 500}} for a partial refund, or omit :amount to refund/cancel the full amount.

get(client, account_id, transfer_id, refund_id)

@spec get(Moov.Client.t(), String.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Retrieves a single refund.

list(client, account_id, transfer_id, opts \\ [])

@spec list(Moov.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, [map()]} | {:error, Moov.Error.t()}

Lists refunds issued against a transfer.