Refund operations for the Paysafe Payments API.
Refunds return funds to the customer after a completed payment or settlement. Full and partial refunds are supported. Multiple partial refunds can be issued up to the original payment amount.
Important: refunds are addressed by settlement ID, not payment ID
Base path: /paymenthub/v1/settlements/{settlementId}/refunds.
If settle_with_auth was true on the original payment, the settlement
ID is the same value as the payment ID — pass it directly. If you settled
separately afterwards, pass the settlement ID returned by
Paysafe.Payments.Settlements.create/4, not the original payment ID.
Don't mix refund paths on the same transaction
If you've already issued a partial refund against a settlement, you cannot also issue a subsequent refund using a different settlement ID tied to the same payment. Stick to one settlement ID per transaction's refund history.
Summary
Functions
Cancel a pending refund.
Issue a refund for a completed payment or settlement.
Retrieve a refund by ID.
Functions
@spec cancel(Paysafe.Config.t(), String.t(), keyword()) :: {:ok, Paysafe.Types.Refund.t()} | {:error, Paysafe.Error.t()}
Cancel a pending refund.
@spec create(Paysafe.Config.t(), String.t(), map(), keyword()) :: {:ok, Paysafe.Types.Refund.t()} | {:error, Paysafe.Error.t()}
Issue a refund for a completed payment or settlement.
Parameters
:merchant_ref_num(required) — Unique reference.:amount— Amount to refund in minor units (defaults to full amount).:settlement_id(required) — ID of the completed settlement (or payment ID, ifsettle_with_authwastrue).
@spec get(Paysafe.Config.t(), String.t(), keyword()) :: {:ok, Paysafe.Types.Refund.t()} | {:error, Paysafe.Error.t()}
Retrieve a refund by ID.