---
title: "Card identification before refunding"
description: "Before issuing an unreferenced refund, verify that the same card is used as for the payment."
url: "https://docs.adyen.com/point-of-sale/shopper-recognition/before-refund"
source_url: "https://docs.adyen.com/point-of-sale/shopper-recognition/before-refund.md"
canonical: "https://docs.adyen.com/point-of-sale/shopper-recognition/before-refund"
last_modified: "2021-05-06T15:02:00+02:00"
language: "en"
---

# Card identification before refunding

Before issuing an unreferenced refund, verify that the same card is used as for the payment.

[View source](/point-of-sale/shopper-recognition/before-refund.md)

Before issuing an [unreferenced refund](/point-of-sale/basic-tapi-integration/refund-payment/unreferenced) to the shopper's card, you may want to check if this is the same card that was used for the original payment. To do so, you make a card acquisition request with `PaymentType` **Refund** and compare the card alias against the card alias used for purchases. Then you either:

* Pay the refund to the card the shopper presented for the card acquisition: you make a payment request with `PaymentType` **Refund** and a reference to the card acquisition.
* Cancel the card acquisition. You can then ask the shopper for a different card and start again.

## Requirements

Before you begin, take into account the following requirements and preparations.

| Requirement          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------- |   |
| **Integration type** | A [Terminal API integration](/point-of-sale/basic-tapi-integration/) with payment terminals.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Setup steps**      | Before you begin:- Be aware of the [requirements for unreferenced refunds](/point-of-sale/basic-tapi-integration/refund-payment/unreferenced#requirements), and [enable unreferenced refunds](/point-of-sale/basic-tapi-integration/refund-payment/unreferenced#before-you-begin-unreferenced).
- Set up [receiving the card alias in Terminal API responses](/point-of-sale/card-acquisition/identifiers#receiving-identifiers-in-responses).
- Contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to enable single tap. For contactless transactions, this ensures the terminal does not ask the shopper to tap their card again when you issue the refund. |

## Card alias

To verify that you will be issuing the refund to the same card that was used for the payment, you need to save the following [identifier](/point-of-sale/card-acquisition/identifiers) from your card acquisition and payment responses:

* **Card alias** (`alias`): A value that uniquely represents the shopper's card number (PAN), for example `A37317672402294`. With this, you can recognize the card that a shopper is using. You cannot use the card alias for making payments. You receive the card alias in the `AdditionalResponse`.

Depending on your use case, you could also save:

* **Other transaction details**. For example, the transaction amount.

## Make a Refund card acquisition request

1. [Make a card acquisition request](/point-of-sale/card-acquisition), specifying:

   * The standard [`SaleToPOIRequest.MessageHeader` ](/point-of-sale/design-your-integration/terminal-api#request-message-header)object, with `MessageClass` set to **Service** and `MessageCategory` set to **CardAcquisition**.

     | Parameter         | Required                                                                                    | Description                                                                                                                                                 |
     | ----------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `ProtocolVersion` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **3.0**                                                                                                                                                     |
     | `MessageClass`    | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Service**                                                                                                                                                 |
     | `MessageCategory` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **CardAcquisition**                                                                                                                                         |
     | `MessageType`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Request**                                                                                                                                                 |
     | `ServiceID`       | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (`POIID`) being used. |
     | `SaleID`          | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for the POS system component to send this request from.                                                                                      |
     | `POIID`           | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The unique ID of the terminal to send this request to. Format: *\[device model]-\[serial number]*.                                                          |

   - The [CardAcquisitionRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition) object, including:

     | Parameter                     | Required                                                                                    | Description                                                                                                                                                                                                                                             |
     | ----------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `SaleData.SaleTransactionID`  | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: Your reference to identify the refund. We recommend using a unique value.
     - `TimeStamp`: The date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). |
     | `SaleData.TokenRequestedType` |                                                                                             | **Customer**. Returns the card alias in the `TokenValue` field of the response. Note that the card alias is always returned in the `AdditionalResponse`.                                                                                                |
     | `CardAcquisitionTransaction`  | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | This object contains:- `TotalAmount`: The amount you want to refund.
     - `PaymentType`: **Refund**.                                                                                                                                                       |

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"812",
               "SaleID":"POSSystemID12345",
               "POIID":"P400Plus-347069832"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"136",
                       "TimeStamp":"2021-05-06T12:54:12.509Z"
                   },
                   "{hint:Optional, returns the card alias in TokenValue}TokenRequestedType":"Customer{/hint}"
               },
               "CardAcquisitionTransaction":{
                   "TotalAmount":24.98,
                   "PaymentType":"Refund"
               }
           }
       }
   }
   ```

   The terminal shows the refund amount with a minus sign (for example, -24.98) and asks the shopper to present their card.

2. When you receive the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response), save the following details:

   * `POIData.POITransactionID.TimeStamp` and `POIData.POITransactionID.TransactionID`: you need these details later in your payment request for an unreferenced refund.

   From the `AdditionalResponse` (depending on the format you used in the request, you receive either a string of form-encoded key-value pairs or a Base64 string that you need to decode to get a JSON object):

   * `alias`: The card alias, to recognize the customer based on their card.

   **Response for the Refund card acquisition**

   ```json
   {
       "SaleToPOIResponse": {
           "CardAcquisitionResponse": {
               "POIData": {
                   "POIReconciliationID": "1000",
                   "POITransactionID": {
                       "{hint:For use in the CardAcquisitionReference of the payment request}TimeStamp": "2021-05-06T12:54:15.000Z{/hint}",
                       "{hint:For use in the CardAcquisitionReference of the payment request}TransactionID": "CWf3001620305655003{/hint}"
                   }
               },
               "PaymentInstrumentData": {
                   "CardData": {
                       "CardCountryCode": "528",
                       "MaskedPan": "541333 **** 9999",
                       "PaymentBrand": "mc",
                       "PaymentToken": {
                           "TokenRequestedType": "Customer",
                           "TokenValue": "{hint:This is the card alias}M469509594859802{/hint}"
                       },
                       "SensitiveCardData": {
                           "ExpiryDate": "0228"
                       }
                   },
                   "PaymentInstrumentType": "Card"
               },
               "Response": {
                   "AdditionalResponse": "tid=47314497&transactionType=REFUND&backendGiftcardIndicator=false&posadditionalamounts.originalAmountValue=2498&expiryYear=2028&alias=M469509594859802&giftcardIndicator=false&posAmountGratuityValue=0&paymentMethodVariant=mc&store=A3nStoreNL&aliasType=Default&cardType=mc&iso8601TxDate=2021-05-06T12%3a54%3a15.0000000%2b0000&posOriginalAmountValue=2498&txtime=14%3a54%3a15&paymentMethod=mc&txdate=06-05-2021&cardSummary=9999&expiryMonth=02&merchantReference=136&posadditionalamounts.originalAmountCurrency=EUR&posAuthAmountCurrency=EUR&message=CARD_ACQ_COMPLETED&cardIssuerCountryId=528&posAmountCashbackValue=0&fundingSource=CREDIT&posEntryMode=CLESS_CHIP&cardBin=541333&cardScheme=mc&issuerCountry=NL&posAuthAmountValue=2498",
                   "Result": "Success"
               },
               "SaleData": {
                   "SaleTransactionID": {
                       "TimeStamp": "2021-05-06T12:54:12.509Z",
                       "TransactionID": "136"
                   }
               }
           },
           "MessageHeader": {
               ...
           }
       }
   }
   ```

3. Search the payments stored in your back-end system for a match with the card alias returned in the card acquisition response and the refund amount.

## Continue with a refund

If you decide to issue an unreferenced refund to the card that the shopper presented when you made the card acquisition request:

1. [Make a payment request](/point-of-sale/basic-tapi-integration/make-a-payment), specifying:

   * The standard [`SaleToPOIRequest.MessageHeader` ](/point-of-sale/design-your-integration/terminal-api#request-message-header)object, with `MessageClass` set to **Service** and `MessageCategory` set to **Payment**.

     | Parameter         | Required                                                                                    | Description                                                                                                                                                 |
     | ----------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `ProtocolVersion` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **3.0**                                                                                                                                                     |
     | `MessageClass`    | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Service**                                                                                                                                                 |
     | `MessageCategory` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Payment**                                                                                                                                                 |
     | `MessageType`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Request**                                                                                                                                                 |
     | `ServiceID`       | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (`POIID`) being used. |
     | `SaleID`          | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for the POS system component to send this request from.                                                                                      |
     | `POIID`           | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The unique ID of the terminal to send this request to. Format: *\[device model]-\[serial number]*.                                                          |

   - The [PaymentRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/payment) object with:

     | Parameter                              | Required                                                                                    | Description                                                                                                                                                                                                                                                               |
     | -------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `PaymentTransaction.AmountsReq`        | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `Currency`: The transaction [currency](/development-resources/currency-codes).
     - `RequestedAmount`: The refund amount.                                                                                                                                   |
     | `PaymentData.PaymentType`              | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Refund**                                                                                                                                                                                                                                                                |
     | `PaymentData.CardAcquisitionReference` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object referring to the card acquisition:- `TimeStamp`: The time stamp returned in the `POIData.POITransactionID` of the card acquisition response.
     - `TransactionID`: The transaction ID returned in the `POIData.POITransactionID` of the card acquisition response. |

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"Payment",
               "MessageType":"Request",
               "SaleID":"POSSystemID12345",
               "ServiceID":"952",
               "POIID":"P400Plus-248069832"
           },
           "PaymentRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"899",
                       "TimeStamp":"2021-05-06T12:54:45.000Z"
                   }
               },
               "PaymentTransaction":{
                   "AmountsReq":{
                       "Currency":"EUR",
                       "RequestedAmount":24.98
                   }
               },
               "PaymentData":{
                   "PaymentType":"Refund",
                   "CardAcquisitionReference":{
                       "{hint:POITransactionID.TimeStamp from the card acquisition}TimeStamp{/hint}":"2021-05-06T12:54:15.000Z",
                       "{hint:POITransactionID.TransactionID from the card acquisition}TransactionID{/hint}":"CWf3001620305655003"
                   }
               }
           }
       }
   }
   ```

2. Check whether we received your refund request. If we received it:

   * The terminal shows the transaction is approved.

   * You receive a JSON response with:

     * `Result`: **Success**
     * `POIData.POITransactionID.TransactionID`: The [transaction identifier](/point-of-sale/design-your-integration/terminal-api#transaction-identifier) for this refund request.

   **Refund payment response**

   ```json
   {
       "SaleToPOIResponse": {
           "MessageHeader": {...},
           "PaymentResponse": {
               "POIData": {
                   "POIReconciliationID": "1000",
                   "POITransactionID": {
                       "TimeStamp": "2021-05-06T12:54:42.000Z",
                       "TransactionID": "CWf3001620305655003.NC6HT9CRT65ZGN82"
                   }
               },
               "PaymentReceipt": [...],
               "PaymentResult": {
                   "AmountsResp": {
                       "AuthorizedAmount": 24.98,
                       "Currency": "EUR"
                   },
                   "OnlineFlag": true,
                   "PaymentAcquirerData": {...},
                   "PaymentInstrumentData": {
                       "CardData": {
                           "CardCountryCode": "826",
                           "EntryMode": [
                               "Contactless"
                           ],
                           "MaskedPan": "541333 **** 9999",
                           "PaymentBrand": "mc",
                           "SensitiveCardData": {
                               "CardSeqNumb": "33",
                               "ExpiryDate": "0228"
                           }
                       },
                       "PaymentInstrumentType": "Card"
                   },
                   "PaymentType": "Refund"
               },
               "Response": {
                   "AdditionalResponse": "AID=A000000004101001&tid=47314497&transactionType=REFUND&backendGiftcardIndicator=false&posadditionalamounts.originalAmountValue=2498&expiryYear=2028&alias=M469509594859802&giftcardIndicator=false&posAmountGratuityValue=0&batteryLevel=100%25&paymentMethodVariant=mc&pspReference=NC6HT9CRT65ZGN82&applicationPreferredName=mc%20en%20gbr%20gbp&store=A3nStoreNL&aliasType=Default&cardType=mc&iso8601TxDate=2021-05-06T12%3a54%3a45.0000000%2b0000&offline=false&posOriginalAmountValue=2498&txtime=14%3a54%3a45&paymentMethod=mc&txdate=06-05-2021&startYear=2017&tc=104DB3F1983EE147&cardIssueNumber=33&cardSummary=9999&expiryMonth=02&merchantReference=5&mid=1000&posadditionalamounts.originalAmountCurrency=EUR&transactionReferenceNumber=NC6HT9CRT65ZGN82&posAuthAmountCurrency=EUR&cardHolderVerificationMethodResults=1F0302&cardIssuerCountryId=826&posAmountCashbackValue=0&fundingSource=CREDIT&posEntryMode=CLESS_CHIP&startMonth=01&cardBin=541333&cardScheme=mc&issuerCountry=GB&posAuthAmountValue=2498",
                   "Result": "Success"
               },
               "SaleData": {
                   "SaleTransactionID": {
                       "TimeStamp": "2021-05-06T12:54:42.229Z",
                       "TransactionID": "5"
                   }
               }
           }
       }
   }
   ```

3. To learn the result, wait for the [REFUND\_WITH\_DATA webhook](/point-of-sale/basic-tapi-integration/refund-payment/refund-webhooks#refund-with-data-webhook).\
   Refunds are always processed asynchronously. If successful, the refund is issued to the shopper's account.

## Continue in a different way

If you decide not to issue an unreferenced refund to the card that the shopper presented when you made the card acquisition request, you need to [cancel the card acquisition](/point-of-sale/card-acquisition#cancel-completed).

You can then, for example, ask the shopper for another card and start the process again.

## See also

* [Card acquisition](/point-of-sale/card-acquisition)
* [Card and shopper identifiers](/point-of-sale/card-acquisition/identifiers)
* [Refund a payment](/point-of-sale/basic-tapi-integration/refund-payment)
