Links API DocsLinks API Docs

Refund a Payment

POST/api/payments/{identifier}/refund

This endpoint refunds a previously captured payment by providing the necessary refund details, including the amount to be refunded.

Path Parameters

identifierstringrequired

Body application/json

refundedAlreadyAtProcessorboolean

Indicates if the refund has already been processed by the payment processor.

amountnumber<double>

The amount to be refunded.

Response

A successful response indicating the payment was refunded.

resultobject

The result of the refund request, including status and any relevant messages.

Show result properties
resultType"Accepted" | "Declined" | "NotFound" | "ValidationFailed" | "Forbidden" | "Error"

The type of result indicating the status of the request.

merchantMessagestring

A message intended for the merchant, providing additional details about the result of the request.

logIdentifierstring

A unique identifier for the server log entry related to this request, useful for troubleshooting.

logAsErrorboolean

Indicates whether this log entry should be treated as an error.

merchantIdentifierstring

The unique identifier for the merchant associated with the payment.

amountnumber<double>

The refunded amount.

currencyCodestring

The three-letter currency code (ISO 4217) for the refund.

acquirerstring

The name of the acquirer processing the refund.

customerIdentifierstring

The unique identifier for the customer associated with the refund.

customerReferencestring

A reference provided by the merchant to identify the customer.

merchantOrderIdstring

The unique identifier for the merchant's order.

paymentMethodIdentifierstring

The unique identifier for the payment method used for the refund.

paymentIdentifierstring

The unique identifier for the refunded payment.

The request is invalid or contains incorrect parameters.

resultobject

The result object that contains the outcome and additional details of the API request.

Show result properties
resultType"Accepted" | "Declined" | "NotFound" | "ValidationFailed" | "Forbidden" | "Error"

The type of result indicating the status of the request.

merchantMessagestring

A message intended for the merchant, providing additional details about the result of the request.

logIdentifierstring

A unique identifier for the server log entry related to this request, useful for troubleshooting.

logAsErrorboolean

Indicates whether this log entry should be treated as an error.

Unauthorized request. Authentication is required.

Access is forbidden due to insufficient permissions.

The specified payment was not found.

resultobject

The result object that contains the outcome and additional details of the API request.

Show result properties
resultType"Accepted" | "Declined" | "NotFound" | "ValidationFailed" | "Forbidden" | "Error"

The type of result indicating the status of the request.

merchantMessagestring

A message intended for the merchant, providing additional details about the result of the request.

logIdentifierstring

A unique identifier for the server log entry related to this request, useful for troubleshooting.

logAsErrorboolean

Indicates whether this log entry should be treated as an error.

Request
curl -X POST "https://testapi.linksmerchantservices.com/api/payments/<identifier>/refund" \
  -H "Content-Type: application/json" \
  -d '{
  "refundedAlreadyAtProcessor": true,
  "amount": 0
}'
Response
{
  "result": {
    "resultType": "Accepted",
    "merchantMessage": "string",
    "logIdentifier": "string",
    "logAsError": true
  },
  "merchantIdentifier": "string",
  "amount": 0,
  "currencyCode": "string",
  "acquirer": "string",
  "customerIdentifier": "string",
  "customerReference": "string",
  "merchantOrderId": "string",
  "paymentMethodIdentifier": "string",
  "paymentIdentifier": "string"
}