Search docs

Are you looking for test card numbers?

Would you like to contact support?

Start searching Adyen's documentation...

  Documentation

Refund to a card

Outlines refunding a payment that has been authorised.

There are two ways to refund a payment using the Terminal API:

  • With a card present: A PaymentRequest, with the PaymentType set to Refund
  • Without a card present: A ReversalRequest, which performs a reversal of a given transaction. For more information on this type of refund, see Refund a completed payment.

Endpoint

The URL used to send Terminal API messages depends on your type of implementation. For more information on the architectures available, see the Terminal API Overview.

PaymentRequest refund request

For a list of Payment Request fields, see PaymentRequest fields.

The SaleID and ServiceID in the MessageHeader should be unique. SaleID and ServiceID combinations are rejected if used recently, within 48 hours.
{
   "SaleToPOIRequest" : {
      "MessageHeader" : {
         "SaleID" : "POSSystemID12345",
         "POIID" : "MX925-123456789",
         "MessageCategory" : "Payment",
         "MessageType" : "Request",
         "ServiceID" : "12392",
         "ProtocolVersion" : "3.0",
         "MessageClass" : "Service"
      },
      "PaymentRequest" : {
         "SaleData" : {
            "SaleTransactionID" : {
               "TimeStamp" : "2017-06-23T12:15:01+00:00",
               "TransactionID" : "24144"
            }
         },
         "PaymentTransaction" : {
            "TransactionConditions" : {},
            "AmountsReq" : {
               "Currency" : "EUR",
               "RequestedAmount" : 10.99
            }
         },
         "PaymentData" : {
            "PaymentType" : "Refund"
         }
      }
   }
}

Response

For a list of Payment Response fields, see  PaymentResponse fields.

{
   "SaleToPOIResponse" : {
      "PaymentResponse" : {
         "SaleData" : {
            "SaleTransactionID" : {
               "TimeStamp" : "2017-06-23T12:15:01.000Z",
               "TransactionID" : "24144"
            }
         },
         "PaymentResult" : {
            "PaymentType" : "Refund",
            "PaymentInstrumentData" : {
               "CardData" : {
                  "EntryMode" : [
                     "ICC"
                  ]
               },
               "PaymentInstrumentType" : "Card"
            }
         },
         "Response" : {
            "AdditionalResponse" : "132 Invalid parameter (app select)",
            "Result" : "Failure",
            "ErrorCondition" : "UnavailableService"
         },
         "POIData" : {
            "POITransactionID" : {
               "TimeStamp" : "2017-06-23T12:14:47.000Z",
               "TransactionID" : "oLkO001498220087000"
            }
         }
      },
      "MessageHeader" : {
         "MessageClass" : "Service",
         "POIID" : "MX925-123456789",
         "ProtocolVersion" : "3.0",
         "SaleID" : "POSSystemID12345",
         "MessageType" : "Response",
         "ServiceID" : "12392",
         "MessageCategory" : "Payment"
      }
   }
}

The POITransactionID returned by the Terminal API consists of a PSP reference and a Tender reference. The format of the TransactionID is: ., for example, oLkO001503399575001.9815033996072250.
If a PSP reference has not yet been generated, the TransactionID will only consist of a tender reference. This could occur if the transaction was completed offline.