Search docs

Are you looking for test card numbers?

Would you like to contact support?

Start searching Adyen's documentation...

  Documentation

Refund a completed payment

Outlines refunding a payment by using its transaction ID.

Reverse a completed payment where the card that made the payment originally is not available. Use the POITransactionID to reference the original payment.

You can only reverse the full authorised amount. If a ReversedAmount is specified it will be ignored, and the full authorised amount is reversed instead.

There are two ways to reverse a payment via the Terminal API:

Currently, partial referenced refunds are available only using the modification API. Reversal is idempotent. Reversals are not returned in a transaction status request. To refund amounts higher than the original transaction, contact the POS Support Team.

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.

Reverse on the terminal that did the original payment

The SaleID and ServiceID in the MessageHeader should be unique. SaleID and ServiceID combinations are rejected if used recently, within 48 hours.

Request:

{
   "SaleToPOIRequest" : {
      "MessageHeader" : {
         "MessageClass" : "Service",
         "MessageType" : "Request",
         "ProtocolVersion" : "3.0",
         "SaleID" : "POSSystemID12345",
         "POIID" : "MX925-260193322",
         "ServiceID" : "13731",
         "MessageCategory" : "Reversal"
      },
      "ReversalRequest" : {
         "OriginalPOITransaction" : {
            "POITransactionID" : {
               "TimeStamp" : "2017-07-03T07:45:44.000Z",
               "TransactionID" : "oLkO001499071089010"
            }
         },
         "ReversalReason" : "MerchantCancel"
      }
   }
} 

For a list of ReversalRequest fields, see ReversalRequest fields.

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.

Response:

{
   "SaleToPOIResponse" : {
      "ReversalResponse" : {
         "POIData" : {
            "POITransactionID" : {
               "TimeStamp" : "2017-08-22T11:00:32.000Z",
               "TransactionID" : "9815033996432330"
            }
         },
         "Response" : {
            "Result" : "Success"
         }
      },
      "MessageHeader" : {
         "MessageType" : "Response",
         "SaleID" : "POSSystemID12345",
         "ServiceID" : "13731",
         "MessageClass" : "Service",
         "POIID" : "MX925-260193322",
         "MessageCategory" : "Reversal",
         "ProtocolVersion" : "3.0"
      }
   }
}

In case your reversal request was rejected, you will receive a response with the following fields:

{
  "SaleToPOIResponse": {
    "ReversalResponse": {
      "Response": {
        "Result": "Failure",
        "AdditionalResponse": "errorType=security&errorCode=000&status=403&message=Terminal%20is%20not%20allowed",
        "ErrorCondition": "NotAllowed"
      }
    },
    "MessageHeader": {
      "ProtocolVersion": "3.0",
      "SaleID": "John",
      "MessageClass": "Service",
      "MessageCategory": "Reversal",
      "ServiceID": "0309141944",
      "POIID": "MX925-289173817",
      "MessageType": "Response"
    }
  }
}

For a list of Reversal Response fields, see ReversalResponse fields.

Reverse on a different terminal

This will cause the given POIID to be used as unique terminal id when doing the call to the backend's cancelOrRefund.

The terminal will use its own (standalone) merchantAccount like it always does for nexo requests. The Adyen payments platform will check this, and disallow if the original transaction does not match.

Request:

{
   "SaleToPOIRequest" : {
      "MessageHeader" : {
         "MessageClass" : "Service",
         "SaleID" : "POSSystemID12345",
         "MessageCategory" : "Reversal",
         "ServiceID" : "21736",
         "MessageType" : "Request",
         "POIID" : "MX925-123456789",
         "ProtocolVersion" : "3.0"
      },
      "ReversalRequest" : {
         "OriginalPOITransaction" : {
            "POITransactionID" : {
               "TimeStamp" : "2017-06-29T07:58:45.000Z",
               "TransactionID" : "oLkO00198816331007"
            },
            "POIID" : "MX925-260193322"
         },
         "ReversalReason" : "MerchantCancel"
      }
   }
}

For a list of Reversal Request fields, see ReversalRequest fields.

Response:

{
   "SaleToPOIResponse" : {
      "MessageHeader" : {
         "POIID" : "MX925-123456789",
         "ProtocolVersion" : "3.0",
         "MessageClass" : "Service",
         "SaleID" : "POSSystemID12345",
         "ServiceID" : "21736",
         "MessageCategory" : "Reversal",
         "MessageType" : "Response"
      },
      "ReversalResponse" : {
         "Response" : {
            "Result" : "Success"
         },
         "POIData" : {
            "POITransactionID" : {
               "TimeStamp" : "2017-07-19T08:15:20.000Z",
               "TransactionID" : "9815004521242734"
            }
         }
      }
   }
}

For a list of Reversal Response fields, see ReversalResponse fields.

Response where a reverse amount is specified

You can only reverse the full authorised amount. If a ReversedAmount is specified it will be ignored, and the full authorised amount is reversed instead. You receive a response with the following fields:

{
   "SaleToPOIResponse":{
      "ReversalResponse":{
         "Response":{
            "AdditionalResponse":"At SaleToPOIRequest.ReversalRequest, field ReversedAmount: Field not supported",
            "Result":"Success"
         },
         "POIData":{
            "POITransactionID":{
               "TimeStamp":"2017-07-14T08:07:29.000Z",
               "TransactionID":"9815000196503384"
            }
         }
      }
   }
}

For a list of Reversal Response fields, see ReversalResponse fields.