Skip to main content

How to Refund a Payment

This guide explains how to Refund a Payment, which allows you to refund a previously captured payment.

Prerequisites

Before calling the refund endpoint, ensure the following:

  • The payment you want to refund has been previously captured.
  • You have the unique payment identifier of the transaction to refund.
  • The refund amount.

Refund a Payment

To refund a captured payment, you will use the Refund a Payment endpoint, adding the following parameters:

Certainly! Below is a consolidated table that includes both Path Parameters and Body Parameters for the refund endpoint. The table outlines each parameter's name, location (whether it's a path or body parameter), whether it is required, and a detailed description.

ParameterLocationRequiredDescription
payment_identifierPathYesThe unique identifier of the payment to be refunded.
refundedAlreadyAtProcessorBodyNoIndicates whether the refund has already been processed by the payment processor.
amountBodyNoThe amount to be refunded. Must be a numeric value (double format).

Below you find an example request to refund a payment:

curl --request POST \
--url https://testapi.linksmerchantservices.com/api/payments/<payment_identifier>/refund \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <your_base64_encoded_credentials>' \
--data '{
"refundedAlreadyAtProcessor": false,
"amount": 50.00
}'