Returns funds from a paid order to its original payment method.
Refunds are asynchronous financial records. Creating a refund validates the requested line items and amount, while the returned status describes processing progress. Look up the refund until it reaches a terminal state and reconcile it through balance transactions.
Summary
Functions
Cancels a pending refund before processing claims it. Cancellation releases the merchant balance hold and restores the refundable capacity reserved against its order line items. Repeating cancellation returns the same canceled refund.
Starts a refund for one or more paid order line items. Refund processing is asynchronous: a successful request returns the new refund in pending status. Retry an uncertain request with the same URL, idempotency key, and body.
Returns the current lifecycle state and amounts for one refund.
Returns refunds in pages of the requested size. Page numbering starts at 1.
Functions
@spec cancel(Inttegro.Client.t(), Inttegro.Refunds.CancelRequest.t(), keyword()) :: {:ok, Inttegro.Refunds.Refund.t()} | {:error, Exception.t()}
Cancels a pending refund before processing claims it. Cancellation releases the merchant balance hold and restores the refundable capacity reserved against its order line items. Repeating cancellation returns the same canceled refund.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Refunds.CancelRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Refunds.Refund.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Refunds.CancelRequest.new!(request_attributes)
case Inttegro.Refunds.cancel(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end
@spec create(Inttegro.Client.t(), Inttegro.Refunds.CreateRequest.t(), keyword()) :: {:ok, Inttegro.Refunds.Refund.t()} | {:error, Exception.t()}
Starts a refund for one or more paid order line items. Refund processing is asynchronous: a successful request returns the new refund in pending status. Retry an uncertain request with the same URL, idempotency key, and body.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Refunds.CreateRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Refunds.Refund.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Refunds.CreateRequest.new!(request_attributes)
case Inttegro.Refunds.create(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end
@spec lookup(Inttegro.Client.t(), Inttegro.Refunds.LookupRequest.t(), keyword()) :: {:ok, Inttegro.Refunds.Refund.t()} | {:error, Exception.t()}
Returns the current lifecycle state and amounts for one refund.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Refunds.LookupRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Refunds.Refund.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Refunds.LookupRequest.new!(request_attributes)
case Inttegro.Refunds.lookup(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end
@spec page(Inttegro.Client.t(), Inttegro.Refunds.PageRequest.t(), keyword()) :: {:ok, Inttegro.Refunds.Page.t()} | {:error, Exception.t()}
Returns refunds in pages of the requested size. Page numbering starts at 1.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Refunds.PageRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Refunds.Page.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Refunds.PageRequest.new!(request_attributes)
case Inttegro.Refunds.page(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end