---
title: "NFC tags reading and writing"
description: "Read and write data on NFC tags using Adyen payment terminals."
url: "https://docs.adyen.com/point-of-sale/nfc-tags"
source_url: "https://docs.adyen.com/point-of-sale/nfc-tags.md"
canonical: "https://docs.adyen.com/point-of-sale/nfc-tags"
last_modified: "2023-02-27T14:43:00+01:00"
language: "en"
---

# NFC tags reading and writing

Read and write data on NFC tags using Adyen payment terminals.

[View source](/point-of-sale/nfc-tags.md)

Near Field Communication (NFC) tags can be cards, phones, bracelets, or similar. They can store data and are commonly used for contactless payments, loyalty programs, festival entrance, and more. By sending a Terminal API card acquisition request to your Adyen payment terminal, you can [identify](#identify-nfc) the type of NFC tag, or [read](#read-nfc) and [write](#write-nfc) data to it.

If you prefer to use a dedicated Android app for specific NFC operations, it is possible to [hide the Adyen UI](#hide) and keep your app's UI in the foreground. You can also [create a session](#create-session) to perform multiple requests as a single user interaction.

To understand how you can use this, here are some examples:

* Enroll shoppers in a loyalty program.
* Identify a customer when entering an area such as festival grounds or a parking garage.
* Check the balance and top up NFC tags such as loyalty and transport cards, or festival tags used to pay for drinks.
* Define multiple behaviours of the NFC tag. For example, use the tag to enter one event and reuse it to pay for drinks at a different event.

## Requirements

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

| Requirement          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Integration type** | A [Terminal API integration](/point-of-sale/basic-tapi-integration/) with payment terminals.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Hardware**         | The payment terminal model must [support the NFC tags](#supported-products) that you want to use.                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Limitations**      | Note the following:- Writing MIFARE DESFire and reading and writing MIFARE Ultralight is supported only on Android terminals.
- Engage terminals can only read/write to MIFARE Ultralight C pages if the pages are unlocked.
- [Hiding the Adyen UI](#hide) for stored value cards and identity cards is only supported with terminal models S1E, S1E2L, S1F2, and S1U2 on software version 1.114 or later.
- See the [supported NFC tag types and terminal models](#supported-products).                    |
| **Setup steps**      | Before you begin, provide our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) with the following information so that the team can create your NFC configuration:- The type of [NFC tag](#supported-products) you want to use.
- If your NFC tags have cryptographic keys: the keys you want to use to access data.
- Whether you want to [hide the Adyen UI](#hide) and instead keep your own UI in the foreground if you use a dedicated Android app for NFC operations. |

## How it works

To use NFC tags on Adyen payment terminals:

1. Make a card acquisition request to [identify](#identify-nfc), [read](#read-nfc), or [write](#write-nfc) to an NFC tag.

   For more complex use cases that require multiple requests, see [Create a session](#create-session).

2. The terminal prompts the user to present their NFC tag or NFC-enabled card.

3. The user presents their NFC tag by tapping, inserting, or swiping.

4. The terminal makes one or multiple read/write requests to the NFC tag.\
   While this is going on, the terminal shows the *One moment* loading screen.

   If you want to use a [dedicated Android app](/point-of-sale/android-terminals/app-requirements/) to process NFC operations, it is possible to [hide the Adyen UI](#hide) and keep your app's UI in the foreground.

## Identify the NFC tag type

You can use the card acquisition request to get the unique identifier and the type of the NFC tag. You can use this identifier, for example, to check if the NFC tag exists in your system or if it is still valid.

1. Create an `Operation` JSON object with `Operation.Type`: **NFCReadUID**:

   **Operation JSON object**

   ```json
   {
      "Operation":[
         {
            "Type":"NFCReadUID"
         }
      ]
   }
   ```

2. Encode the `Operation` JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
   ewogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNSZWFkVUlEIgogICAgICAgIH0KICAgIF0KfQ==
   ```

3. [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.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-SaleData) object with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                  |
     | ------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
     | `SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: Your reference to identify the transaction. 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\)). |
     | `SaleToPOIData`     |                                                                                             | The Base64-encoded `Operation` JSON object.                                                                                                                                                                                                                  |

   * The [CardAcquisitionRequest.CardAcquisitionTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-CardAcquisitionTransaction) object with:

     | Parameter     | Required | Description                                                                                                                                                                                                         |
     | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `TotalAmount` |          | The transaction amount. You can omit the `TotalAmount` field when getting the `UID` of the NFC tag.If you omit `TotalAmount`, you still have to include an empty `CardAcquisitionTransaction` field in the request. |

   The following example shows a card acquisition request to identify the NFC tag.

   **Request to identify the NFC tag**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"1020711110",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"02072",
                       "TimeStamp":"2020-01-07T14:14:04+00:00"
                   },
                   "SaleToPOIData":"ewogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNSZWFkVUlEIgogICAgICAgIH0KICAgIF0KfQ=="
               },
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

4. In the `AdditionalResponse` of the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response) note:

   * `NFC.uid`: The unique identifier of the NFC tag.
   * `NFC.variant`: The type of the NFC tag, for example **mf\_classic** for MIFARE Classic.

   **Response identifying the NFC tag**

   ```json
   {
       "SaleToPOIResponse":{
           "CardAcquisitionResponse":{
               "POIData":{
                   "POIReconciliationID": "1000",
                   "POITransactionID":{
                       "TimeStamp": "2022-10-10T12:50:31.000Z",
                       "TransactionID": "CglQ001665406231000"
                   }
               },
               "PaymentInstrumentData":{
                   "CardData": {},
                   "PaymentInstrumentType": "Card"
               },
               "Response":{
                   "AdditionalResponse": "...NFC.uid=96924E37...NFC.variant=mf_classic...",
                   "Result": "Success"
               },
               "SaleData":{
                   "SaleTransactionID":{
                       "TimeStamp": "2022-10-03T10:56:42.198Z",
                       "TransactionID": "729"
                   }
               }
           },
           "MessageHeader": {...}
       }
   }
   ```

   After you have identified the NFC tag, the loading screen continues to show until you send an enable service request (see the next step).

5. To stop the loading screen, make an enable service request, 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 **EnableService**.

     | 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-") | **EnableService**                                                                                                                                           |
     | `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 [EnableServiceRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/enableservice) object with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
     | ------------------- | ------------------------------------------------------------------------------------------- |   |
     | `TransactionAction` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **AbortTransaction**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
     | `DisplayOutput`     |                                                                                             | [Optional object](/point-of-sale/card-acquisition#alternative) to show your own message and an 'Approved' icon (green check mark) or a 'Declined' icon (red cross).If you omit `DisplayOutput`, the terminal shows *Canceled*, a red cross **![](/images/5/8/8/4/9/58849deb729ef765fb92c34a2b367b9ae58a5598-cancel2x.png)**, and *Transaction canceled*. Omit if you have an NFC configuration that [hides the Adyen UI](#hide) while using a dedicated Android app for NFC operations. Otherwise the Adyen UI will be brought to the foreground. |

   The following example is the basic request, without the `DisplayOutput` object, to stop the card acquisition flow.

   **Basic request to stop the card acquisition**

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"EnableService",
            "MessageType":"Request",
            "ServiceID":"3020711110",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-346403161"
         },
         "EnableServiceRequest":{
            "TransactionAction":"AbortTransaction"
         }
      }
   }
   ```

## Read data

NFC tags have multiple parts that can store data. Because the data structure is different for every NFC tag type, the request needs to specify where to read the data from. For some tags, you need to include the key to read data from a `sector`, `aid`, or`page`.\
Select a tab to see the parameters that you need to specify to read data from MIFARE Classic, MIFARE DESFire, or MIFARE Ultralight.

### Tab: MIFARE Classic - read

1. Create an `Operation` JSON object specifying:

   | Parameter | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   | --------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | `Type`    | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **NFCRead**: Reads data from the specified sector.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   | `Variant` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **MifareClassic**: The type of NFC tag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   | `NFCData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If you leave the `NFCData` array empty, the terminal will try to read all sectors.An array with:- `sector`: Specifies what sector on **MifareClassic** to read from.
   - `keyType`: Specifies what key is used to access a sector, **a** (default) or **b**.

     On [Castles Android terminals](#supported-products) you cannot use `keyType`: **b** due to a limitation from Castles.
   - `keyId`: Specifies what unique key for the specified `keyType` to use to access a sector. Can be any positive numerical value. |

   **Structure of Operation object for read data request - MIFARE Classic**

   ```json
   {
        "Operation":[
            {
                "Type":"NFCRead",
                "Variant":"MifareClassic",
                "NFCData":[
                    {
                        "sector":1,
                        "keyType":"a",
                        "keyId":1
                    },
                    {
                        "sector":2,
                        "keyType":"b",
                        "keyId": 2
                    }
                ]
            }
        ]
    }
   ```

2. Encode the `Operation` JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
   ewogICAiT3BlcmF0aW9uIjpbCiAgICAgIHsKICAgICAgICAgIlR5cGUiOiJORkNSZWFkIiwKICAgICAgICAgIlZhcmlhbnQiOiJNaWZhcmVDbGFzc2ljIiwKICAgICAgICAgIk5GQ0RhdGEiOlsKICAgICAgICAgICAgewogICAgICAgICAgICAgICAic2VjdG9yIjoxLAogICAgICAgICAgICAgICAia2V5VHlwZSI6ImEiLAogICAgICAgICAgICAgICAia2V5SWQiOjEKICAgICAgICAgICAgfSwKICAgICAgICAgICAgewogICAgICAgICAgICAgICAic2VjdG9yIjoyLAogICAgICAgICAgICAgICAia2V5VHlwZSI6ImIiLAogICAgICAgICAgICAgICAia2V5SWQiOjIKICAgICAgICAgICAgfQogICAgICAgICBdCiAgICAgIH0KICAgXQp9
   ```

3. [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**.

   * The [CardAcquisitionRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-SaleData) object with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                              |
     | ------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: your reference to identify the transaction. We recommend using a unique value.
     - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). |
     | `SaleToPOIData`     |                                                                                             | The Base64-encoded `Operation` JSON object.                                                                                                                                                                                                              |

   * The [CardAcquisitionRequest.CardAcquisitionTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-CardAcquisitionTransaction) object with:

     | Parameter     | Required | Description                                                                                                                                                                                            |
     | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
     | `TotalAmount` |          | The transaction amount. You can omit the `TotalAmount` field when reading the NFC tag.If you omit `TotalAmount`, you still have to include an empty `CardAcquisitionTransaction` field in the request. |

   The following example shows a card acquisition request to read data from sectors **1** and **2** on a **MifareClassic** NFC tag:

   **Read data request - MIFARE Classic**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"282",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"369",
                       "TimeStamp":"2021-03-05T12:22:57.449Z"
                   },
                   "SaleToPOIData":"ewogICAiT3BlcmF0aW9uIjpbCiAgICAgIHsKICAgICAgICAgIlR5cGUiOiJORkNSZWFkIiwKICAgICAgICAgIlZhcmlhbnQiOiJNaWZhcmVDbGFzc2ljIiwKICAgICAgICAgIk5GQ0RhdGEiOlsKICAgICAgICAgICAgewogICAgICAgICAgICAgICAic2VjdG9yIjoxLAogICAgICAgICAgICAgICAia2V5VHlwZSI6ImEiLAogICAgICAgICAgICAgICAia2V5SWQiOjEKICAgICAgICAgICAgfSwKICAgICAgICAgICAgewogICAgICAgICAgICAgICAic2VjdG9yIjoyLAogICAgICAgICAgICAgICAia2V5VHlwZSI6ImIiLAogICAgICAgICAgICAgICAia2V5SWQiOjIKICAgICAgICAgICAgfQogICAgICAgICBdCiAgICAgIH0KICAgXQp9"
               },
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

4. When the card acquisition succeeds, in the `AdditionalResponse` of the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response) note:

   * `NFC.data`: the data from the specified sectors.

     * For a single sector, the data shows as **NFC.data=afafafafafafafafafa...**.
     * For multiple sectors, the data from each sector shows as value of the `NFC.data` for that sector, for example: **NFC.data.S01=afafafafafafafafafa**, **NFC.data.S02=2222222222222222**.

   * `NFC.status`: the status of the read action for every `sector`, for example **NFC.status=s01.OKs02.OKS03.AUTH\_ERROR**.

   * `NFC.uid`: the unique identifier of the NFC tag.

   * `NFC.variant`: the type of the NFC tag, in this case MIFARE Classic.

   **Read data response - MIFARE Classic**

   ```json
   {
       "SaleToPOIResponse":{
           "CardAcquisitionResponse":{
               "POIData":{
                   "POIReconciliationID":"1000",
                   "POITransactionID":{
                       "TimeStamp":"2022-10-17T11:35:04.000Z",
                       "TransactionID":"CglQ001666006504012"
                   }
               },
               "PaymentInstrumentData":{
                   "CardData":{
                   },
                   "PaymentInstrumentType":"Card"
               },
               "Response":{
                   "AdditionalResponse":"tid=47353332&transactionType=GOODS_SERVICES&giftcardIndicator=false&posAmountGratuityValue=0&store=YourStore&iso8601TxDate=2022-10-17T11%3a35%3a04.733Z&posOriginalAmountValue=0&txtime=13%3a35%3a04&NFC.data.S01=AFAFAFAFAFAFAFAF&NFC.uid=96924E37&txdate=17-10-2022&NFC.data.S02=2222222222222222&merchantReference=868&posadditionalamounts.originalAmountCurrency=EUR&NFC.ref=mifareClassicCard&posAuthAmountCurrency=EUR&message=CARD_ACQ_COMPLETED&posAmountCashbackValue=0&NFC.variant=mf_classic&posEntryMode=CLESS_SWIPE&NFC.status=S01.OKS02.OK&posAuthAmountValue=0",
                   "Result":"Success"
               },
               "SaleData":{
                   "SaleTransactionID":{
                       "TimeStamp":"2022-10-03T10:56:42.966Z",
                       "TransactionID":"868"
                   }
               }
           },
           "MessageHeader":{
               "MessageCategory":"CardAcquisition",
               "MessageClass":"Service",
               "MessageType":"Response",
               "POIID":"V400m-346403161",
               "ProtocolVersion":"3.0",
               "SaleID":"POSSystemID12345",
               "ServiceID":"40"
           }
       }
   }
   ```

   After you have read the specified sectors on the NFC tag, the loading screen continues to show until you send an\
   enable service request (see the next step).

5. To stop the loading screen, make an enable service request to a [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), 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 **EnableService**.

   * [EnableServiceRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/enableservice) with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
     | ------------------- | ------------------------------------------------------------------------------------------- |   |
     | `TransactionAction` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **AbortTransaction**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
     | `DisplayOutput`     |                                                                                             | [Optional object](/point-of-sale/card-acquisition#alternative) to show your own message and an 'Approved' icon (green check mark) or a 'Declined' icon (red cross).If you omit `DisplayOutput`, the terminal shows *Canceled*, a red cross **![](/images/5/8/8/4/9/58849deb729ef765fb92c34a2b367b9ae58a5598-cancel2x.png)**, and *Transaction canceled*. Omit if you have a NFC configuration that [hides the Adyen UI](#hide) while using a dedicated Android app for NFC operations. Otherwise the Adyen UI will be brought to the foreground. |

   The following example is the basic request, without the `DisplayOutput` object, to stop the card acquisition flow.

   **Basic request to cancel the card acquisition data**

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"EnableService",
            "MessageType":"Request",
            "ServiceID":"3020711110",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-346403161"
         },
         "EnableServiceRequest":{
            "TransactionAction":"AbortTransaction"
         }
      }
   }
   ```

### Tab: MIFARE DESFire - read

1. Create an `Operation` JSON object specifying:

   | Parameter | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                              |
   | --------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | `Variant` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **MifareDesfire**: the type of NFC tag.                                                                                                                                                                                                                                                                                                                                                                  |
   | `NFCData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An array with:- `aid`: the application ID to read from.
   - `keyId`: the ID of the key used to access the specified `aid`.
   - `fileIds`: the files inside the `aid` to read.
   - `fileOffsets`: the byte in the specified file from which to start reading data.
   - `fileLengths`: the number of bytes to read, starting from the byte specified in `fileOffset`. To read all bytes in the file, set to **0**. |

   **Structure of Operation object for read data request - MIFARE DESFire**

   ```json
   {
        "Operation":[
            {
                "Type":"NFCRead",
                "Variant":"MifareDesfire",
                "NFCData":[
                    {
                        "aid":"7f21f5",
                        "keyId":1,
                        "fileIds":[1],
                        "fileOffsets":[0],
                        "fileLengths":[0]
                    }
                ]
            }
       ]
   }
   ```

2. Encode the `Operation` JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
   ewogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNSZWFkIiwKICAgICAgICAgICAgIlZhcmlhbnQiOiJNaWZhcmVEZXNmaXJlIiwKICAgICAgICAgICAgIk5GQ0RhdGEiOlsKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAiYWlkIjoiN2YyMWY1IiwKICAgICAgICAgICAgICAgICAgICAia2V5SWQiOjEsCiAgICAgICAgICAgICAgICAgICAgImZpbGVJZHMiOlsxXSwKICAgICAgICAgICAgICAgICAgICAiZmlsZU9mZnNldHMiOlswXSwKICAgICAgICAgICAgICAgICAgICAiZmlsZUxlbmd0aHMiOlswXQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBdCiAgICAgICAgfQogICAgXQp9
   ```

3. [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**.

   * The [CardAcquisitionRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-SaleData) object with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                              |
     | ------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: your reference to identify the transaction. We recommend using a unique value.
     - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). |
     | `SaleToPOIData`     |                                                                                             | The Base64-encoded `Operation` JSON object.                                                                                                                                                                                                              |

   * The [CardAcquisitionRequest.CardAcquisitionTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-CardAcquisitionTransaction) object with:

     | Parameter     | Required | Description                                                                                                                                                                                            |
     | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
     | `TotalAmount` |          | The transaction amount. You can omit the `TotalAmount` field when reading the NFC tag.If you omit `TotalAmount`, you still have to include an empty `CardAcquisitionTransaction` field in the request. |

   The following example shows a card acquisition request to read data from `aid` **7f21f5** on a **MifareDesfire** NFC tag:

   **Read data request - MIFARE DESFire**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"282",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"369",
                       "TimeStamp":"2021-03-05T12:22:57.449Z"
                   },
                   "TokenRequestedType":"Customer",
                   "SaleToPOIData":"ewogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNSZWFkIiwKICAgICAgICAgICAgIlZhcmlhbnQiOiJNaWZhcmVEZXNmaXJlIiwKICAgICAgICAgICAgIk5GQ0RhdGEiOlsKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAiYWlkIjoiN2YyMWY1IiwKICAgICAgICAgICAgICAgICAgICAia2V5SWQiOjEsCiAgICAgICAgICAgICAgICAgICAgImZpbGVJZHMiOlsxXSwKICAgICAgICAgICAgICAgICAgICAiZmlsZU9mZnNldHMiOlswXSwKICAgICAgICAgICAgICAgICAgICAiZmlsZUxlbmd0aHMiOlswXQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBdCiAgICAgICAgfQogICAgXQp9"
               },
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

4. When the card acquisition succeeds, in the `AdditionalResponse` of the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response) note:

   * `NFC.data`: the data from the specified `aid`.

     * For a single `aid`, the data shows as **NFC.data=00000000000000000000001234567890**.
     * For multiple `aid` fields and `fileIds`, the data from each `aid` shows as value of the `NFC.data` for that `aid` and `fileIds`: **NFC.data.7f21f5.F01=00000000000000000000001234567890**.

   * `NFC.status`: the status of the read action for every `aid`, for example **NFC.status=7f21f5.OK**.

   * `NFC.uid`: the unique identifier of the NFC tag.

   * `NFC.variant`: the type of the NFC tag, in this case MIFARE DESFire.

   **Read data response - MIFARE DESFire**

   ```json
   {
        "SaleToPOIResponse":{
            "CardAcquisitionResponse":{
                "POIData":{
                    "POIReconciliationID":"1000",
                    "POITransactionID":{
                        "TimeStamp":"2022-10-18T12:50:17.000Z",
                        "TransactionID":"CglQ001666097417005"
                    }
                },
                "PaymentInstrumentData":{
                    "CardData":{
                    },
                    "PaymentInstrumentType":"Card"
                },
                "Response":{
                    "AdditionalResponse":"tid=47353332&transactionType=GOODS_SERVICES&giftcardIndicator=false&posAmountGratuityValue=0&store=YourStore&iso8601TxDate=2022-10-18T12%3a50%3a17.811Z&posOriginalAmountValue=0&txtime=14%3a50%3a17&NFC.uid=04584882D96B80&txdate=18-10-2022&NFC.data=00000000000000000000001234567890&merchantReference=605&posadditionalamounts.originalAmountCurrency=EUR&NFC.ref=desfireCard&posAuthAmountCurrency=EUR&message=CARD_ACQ_COMPLETED&posAmountCashbackValue=0&NFC.variant=mf_desfire&posEntryMode=CLESS_SWIPE&NFC.status=7f21f5.OK&posAuthAmountValue=0",
                    "Result":"Success"
                },
                "SaleData":{
                    "SaleTransactionID":{
                        "TimeStamp":"2022-10-03T10:56:42.966Z",
                        "TransactionID":"605"
                    }
                }
            },
            "MessageHeader":{
                "MessageCategory":"CardAcquisition",
                "MessageClass":"Service",
                "MessageType":"Response",
                "POIID":"V400m-347353332",
                "ProtocolVersion":"3.0",
                "SaleID":"POSSystemID12345",
                "ServiceID":"946"
            }
        }
    }
   ```

   After you have read the specified `aid` on the NFC tag, the loading screen continues to show until you send an enable service request (see the next step).

5. To stop the loading screen, make an enable service request to a [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), 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 **EnableService**.

   * [EnableServiceRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/enableservice) with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
     | ------------------- | ------------------------------------------------------------------------------------------- |   |
     | `TransactionAction` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **AbortTransaction**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
     | `DisplayOutput`     |                                                                                             | [Optional object](/point-of-sale/card-acquisition#alternative) to show your own message and an 'Approved' icon (green check mark) or a 'Declined' icon (red cross).If you omit `DisplayOutput`, the terminal shows *Canceled*, a red cross **![](/images/5/8/8/4/9/58849deb729ef765fb92c34a2b367b9ae58a5598-cancel2x.png)**, and *Transaction canceled*. Omit if you have a NFC configuration that [hides the Adyen UI](#hide) while using a dedicated Android app for NFC operations. Otherwise the Adyen UI will be brought to the foreground. |

   The following example is the basic request, without the `DisplayOutput` object, to stop the card acquisition flow.

   **Basic request to cancel the card acquisition data**

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"EnableService",
            "MessageType":"Request",
            "ServiceID":"3020711110",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-346403161"
         },
         "EnableServiceRequest":{
            "TransactionAction":"AbortTransaction"
         }
      }
   }
   ```

### Tab: MIFARE Ultralight - read

MIFARE Ultralight is an NFC tag with lower security standards. The data is segmented into pages instead of sectors. With the **Ultralight C** and **Ultralight AES** variants, pages can be locked with a key. For example: If pages are locked starting at page 16, then reading/writing to pages 16 - 40 requires specifying a key, and pages 0 - 15 do not require a key.

[Engage terminals](#supported-products) can only read/write to unlocked MIFARE Ultralight C pages.

1. Create an `Operation` JSON object specifying:

   | Parameter | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   | --------- | ------------------------------------------------------------------------------------------- |   |
   | `Type`    | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **NFCRead**: reads data from the specified page.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   | `Variant` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The type of NFC tag used: **MifareUltralight**, **MifareUltralightC**, or **MifareUltralightAES**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
   | `NFCData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If you leave the `NFCData` array empty, the terminal will try to read all pages.An array with:- `pageOffset`: the page from which to start reading data.

   - `numberOfPages`: the number of pages to read, starting from the page specified in `pageOffset`.

   - `ultralightCKey`: required only for the **Ultralight C** variant. HEX-encoded key used to authenticate the card. If you do not provide a key, the default one is used: `49454D4B41455242214E4143554F5946`.

   - `ultralightAESKey`: required only for the **Ultralight AES** variant. HEX-encoded key used to authenticate the card. If you do not provide a key, the default one is used: `00000000000000000000000000000000`.

   - `ultralightAESKeyId`: optional for the **Ultralight AES** variant. The key that specifies what part of the card's memory to access. Possible values:

     * **0**: (default) `DataProtKey` authenticates the card and accesses protected user memory and the `UID`.
     * **1**: `UIDRetrKey` authenticates the card and retrieves the `UID` and the `ECDSA` signature. |

   **Structure of Operation object for read data request - MIFARE Ultralight**

   ```json
   {
       "Operation":[
           {
               "Type":"NFCRead",
               "Variant":"MifareUltralight",
               "NFCData":[
                   {
                       "pageOffset":"4",
                       "numberOfPages":"2"
                   }
               ]
           }
       ]
   }
   ```

2. Encode the `Operation` JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
   ewogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNSZWFkIiwKICAgICAgICAgICAgIlZhcmlhbnQiOiJNaWZhcmVVbHRyYWxpZ2h0IiwKICAgICAgICAgICAgIk5GQ0RhdGEiOlsKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAicGFnZU9mZnNldCI6IjQiLAogICAgICAgICAgICAgICAgICAgICJudW1iZXJPZlBhZ2VzIjoiMiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgXQogICAgICAgIH0KICAgIF0KfQ==
   ```

3. [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**.

   * The [CardAcquisitionRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-SaleData) object with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                              |
     | ------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: your reference to identify the transaction. We recommend using a unique value.
     - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). |
     | `SaleToPOIData`     |                                                                                             | The Base64-encoded `Operation` JSON object.                                                                                                                                                                                                              |

   * The [CardAcquisitionRequest.CardAcquisitionTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-CardAcquisitionTransaction) object with:

     | Parameter     | Required | Description                                                                                                                                                                                            |
     | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
     | `TotalAmount` |          | The transaction amount. You can omit the `TotalAmount` field when reading the NFC tag.If you omit `TotalAmount`, you still have to include an empty `CardAcquisitionTransaction` field in the request. |

   The following example shows a card acquisition request to read data from two pages starting from page **4** on a **MifareUltralight** NFC tag:

   **Read data request - MIFARE Ultralight**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"282",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"369",
                       "TimeStamp":"2021-03-05T12:22:57.449Z"
                   },
                   "TokenRequestedType":"Customer",
                   "SaleToPOIData":"ewogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNSZWFkIiwKICAgICAgICAgICAgIlZhcmlhbnQiOiJNaWZhcmVVbHRyYWxpZ2h0IiwKICAgICAgICAgICAgIk5GQ0RhdGEiOlsKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAicGFnZU9mZnNldCI6IjQiLAogICAgICAgICAgICAgICAgICAgICJudW1iZXJPZlBhZ2VzIjoiMiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgXQogICAgICAgIH0KICAgIF0KfQ=="
               },
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

4. When the card acquisition succeeds, in the `AdditionalResponse` of the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response) note:

   * `NFC.data`: the data from the specified page, such as **NFC.data.P05=0F2AF6C4...**.
   * `NFC.status`: the status of the read action for every `page`, for example **NFC.status=P04.OK**.
   * `NFC.uid`: the unique identifier of the NFC tag.
   * `NFC.variant`: the type of the NFC tag, in this case MIFARE Ultralight.

   **Read data response - MIFARE Ultralight**

   ```json
   {
       "SaleToPOIResponse": {
           "CardAcquisitionResponse": {
               "POIData": {
                   "POIReconciliationID": "1000",
                   "POITransactionID": {
                       "TimeStamp": "2022-10-18T13:05:12.000Z",
                       "TransactionID": "CglQ001666098312006"
                   }
               },
               "PaymentInstrumentData": {
                   "CardData": {},
                   "PaymentInstrumentType": "Card"
               },
               "Response": {
                   "AdditionalResponse": "tid=47353332&transactionType=GOODS_SERVICES&giftcardIndicator=false&posAmountGratuityValue=0&store=YourStore&iso8601TxDate=2022-10-18T13%3a05%3a12.508Z&posOriginalAmountValue=0&txtime=15%3a05%3a12&NFC.data.P04=140BE261&NFC.uid=04DDECD2FA7280&txdate=18-10-2022&NFC.data.P05=0F2AF6C4&merchantReference=847&posadditionalamounts.originalAmountCurrency=EUR&NFC.ref=desfireCard&posAuthAmountCurrency=EUR&message=CARD_ACQ_COMPLETED&posAmountCashbackValue=0&NFC.variant=mf_ultralight_ev1&posEntryMode=CLESS_SWIPE&NFC.status=P04.OKP05.OK&posAuthAmountValue=0",
                   "Result": "Success"
               },
               "SaleData": {
                   "SaleTransactionID": {
                       "TimeStamp": "2022-10-03T10:56:42.966Z",
                       "TransactionID": "847"
                   }
               }
           },
           "MessageHeader": {
               "MessageCategory": "CardAcquisition",
               "MessageClass": "Service",
               "MessageType": "Response",
               "POIID": "V400m-347353332",
               "ProtocolVersion": "3.0",
               "SaleID": "POSSystemID12345",
               "ServiceID": "676"
           }
       }
   }
   ```

   After you have read the specified page on the NFC tag, the loading screen continues to show until you send an\
   enable service request (see the next step).

5. To stop the loading screen, make an enable service request to a [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), 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 **EnableService**.

   * [EnableServiceRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/enableservice) with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
     | ------------------- | ------------------------------------------------------------------------------------------- |   |
     | `TransactionAction` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **AbortTransaction**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
     | `DisplayOutput`     |                                                                                             | [Optional object](/point-of-sale/card-acquisition#alternative) to show your own message and an 'Approved' icon (green check mark) or a 'Declined' icon (red cross).If you omit `DisplayOutput`, the terminal shows *Canceled*, a red cross **![](/images/5/8/8/4/9/58849deb729ef765fb92c34a2b367b9ae58a5598-cancel2x.png)**, and *Transaction canceled*. Omit if you have a NFC configuration that [hides the Adyen UI](#hide) while using a dedicated Android app for NFC operations. Otherwise the Adyen UI will be brought to the foreground. |

   The following example is the basic request, without the `DisplayOutput` object, to stop the card acquisition flow.

   **Basic request to cancel the card acquisition data**

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"EnableService",
            "MessageType":"Request",
            "ServiceID":"3020711110",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-346403161"
         },
         "EnableServiceRequest":{
            "TransactionAction":"AbortTransaction"
         }
      }
   }
   ```

## Write data

NFC tags have multiple parts that can store data. Because the data structure is different for every NFC tag type, the request needs to specify the `sector`, `aid`, or `page` where to write the data to.\
Select a tab to see the parameters that you need to specify to write data to MIFARE Classic, MIFARE DESFire, or MIFARE Ultralight.

### Tab: MIFARE Classic - write

1. Create an `Operation` JSON object specifying:

   | Parameter     | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   | ------------- | ------------------------------------------------------------------------------------------- |   |
   | `Type`        | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **NFCWrite**: writes data to the specified sector.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   | `Variant`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **MifareClassic**: specifies the type of NFC tag used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   | `NFCData`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If you leave the `NFCData` array empty when trying to write, the response will return the `UID` and the `variant` but will not write to the card.An array specifying:- `sector`: specifies the sector to write to.
   - `keyType`: specifies what `key` is used to write to a sector, **a** (default) or **b**.

     On [Castles Android terminals](#supported-products) you cannot use `keyType`: **b** due to a limitation from Castles.
   - `keyId`: specifies what unique key for the specified `keyType` to use to access a sector. Can be any positive numerical value.
   - `data`: data to write in the specified sector. |
   | `ExpectedUid` | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | Specifies the `UID` of the NFC tag to which you want to write the data. If the `UID` of the presented NFC tag is different from the `ExpectedUid`, the request fails and `WRONG_CARD` is returned in the `AdditionalResponse`. If passed without a value, the parameter is ignored.                                                                                                                                                                                                                                                                                                                                     |

   **Structure of Operation object for write data request - Mifare Classic**

   ```json
   {
       "Operation":[
           {
               "Type":"NFCWrite",
               "Variant":"MifareClassic",
               "NFCData":[
                   {
                       "sector":1,
                       "data":"afafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafaf"
                   },
                   {
                       "sector":2,
                       "data":"afafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafaf",
                       "keyType":"b",
                       "keyId":1
                   }
               ]
           }
       ]
   }
   ```

2. Encode the `Operation` JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
    
   ```

3. [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**.

   * The [CardAcquisitionRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-SaleData) object with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                              |
     | ------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: your reference to identify the transaction. We recommend using a unique value.
     - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). |
     | `SaleToPOIData`     |                                                                                             | The Base64-encoded `Operation` JSON object.                                                                                                                                                                                                              |

   * The [CardAcquisitionRequest.CardAcquisitionTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-CardAcquisitionTransaction) object with:

     | Parameter     | Required | Description                                                                                                                                                                                               |
     | ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `TotalAmount` |          | The transaction amount. You can omit the `TotalAmount` field when writing to the NFC tag.If you omit `TotalAmount`, you still have to include an empty `CardAcquisitionTransaction` field in the request. |

   The following example shows a card acquisition request to write data to sectors **1** and **2** on a **MifareClassic** NFC tag:

   **Write data request - MIFARE Classic**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"283",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"369",
                       "TimeStamp":"2021-03-05T12:22:57.449Z"
                   },
                   "TokenRequestedType":"Customer",
                   "SaleToPOIData":" "
               },
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

4. When the card acquisition succeeds, in the `AdditionalResponse` of the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response) note:

   * `NFC.data`: the data written to the specified sectors.

     * For a single sector, the data shows as **NFC.data=afafafafafafafafafa...**.
     * For multiple sectors, the data from each sector shows as value of the `NFC.data` for that sector, for example: **NFC.data.S01=afafafafafafafafafa**, **NFC.data.S02=2222222222222222**.

   * `NFC.status`: the status of the write action for every `sector`, for example **NFC.status=s01.OKs02.OKS03.AUTH\_ERROR**.

   * `NFC.uid`: the unique identifier of the NFC tag.

   * `NFC.variant`: the type of the NFC tag, in this case MIFARE Classic.

   **Write data response - MIFARE Classic**

   ```json
   {
       "SaleToPOIResponse":{
           "CardAcquisitionResponse":{
               "POIData":{
                   "POIReconciliationID":"1000",
                   "POITransactionID":{
                       "TimeStamp":"2022-10-18T08:17:51.000Z",
                       "TransactionID":"CglQ001666081071002"
                   }
               },
               "PaymentInstrumentData":{
                   "CardData":{
                   },
                   "PaymentInstrumentType":"Card"
               },
               "Response":{
                   "AdditionalResponse":"tid=47353332&transactionType=GOODS_SERVICES&giftcardIndicator=false&posAmountGratuityValue=0&store=YourStore&iso8601TxDate=2022-10-18T08%3a17%3a51.591Z&posOriginalAmountValue=0&txtime=10%3a17%3a51&NFC.uid=96924E37&txdate=18-10-2022&merchantReference=889&posadditionalamounts.originalAmountCurrency=EUR&NFC.ref=mifareClassicCard&posAuthAmountCurrency=EUR&message=CARD_ACQ_COMPLETED&NFC.data.1=AFAFAFAFAFAFAFAF&posAmountCashbackValue=0&NFC.data.2=AFAFAFAFAFAFAFAF&NFC.variant=mf_classic&posEntryMode=CLESS_SWIPE&NFC.status=S01.OKS02.OK&posAuthAmountValue=0",
                   "Result":"Success"
               },
               "SaleData":{
                   "SaleTransactionID":{
                       "TimeStamp":"2022-10-03T10:56:42.966Z",
                       "TransactionID":"889"
                   }
               }
           },
           "MessageHeader":{
               "MessageCategory":"CardAcquisition",
               "MessageClass":"Service",
               "MessageType":"Response",
               "POIID":"V400m-346403161",
               "ProtocolVersion":"3.0",
               "SaleID":"POSSystemID12345",
               "ServiceID":"833"
           }
       }
   }
   ```

   After you write to the specified sectors on the NFC tag, the loading screen continues to show until you send an\
   enable service request (see the next step).

5. To stop the loading screen, make an enable service request to a [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), 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 **EnableService**.

   * [EnableServiceRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/enableservice) with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
     | ------------------- | ------------------------------------------------------------------------------------------- |   |
     | `TransactionAction` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **AbortTransaction**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
     | `DisplayOutput`     |                                                                                             | [Optional object](/point-of-sale/card-acquisition#alternative) to show your own message and an 'Approved' icon (green check mark) or a 'Declined' icon (red cross).If you omit `DisplayOutput`, the terminal shows *Canceled*, a red cross **![](/images/5/8/8/4/9/58849deb729ef765fb92c34a2b367b9ae58a5598-cancel2x.png)**, and *Transaction canceled*. Omit if you have a NFC configuration that [hides the Adyen UI](#hide) while using a dedicated Android app for NFC operations. Otherwise the Adyen UI will be brought to the foreground. |

   The following example is the basic request, without the `DisplayOutput` object, to stop the card acquisition flow.

   **Basic request to cancel the card acquisition data**

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"EnableService",
            "MessageType":"Request",
            "ServiceID":"3020711110",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-346403161"
         },
         "EnableServiceRequest":{
            "TransactionAction":"AbortTransaction"
         }
      }
   }
   ```

### Tab: MIFARE DESFire - write

Writing data to MIFARE DESFire is currently supported only on [Android terminals](#supported-products).

1. Create an `Operation` JSON object and specify:

   | Parameter     | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   | ------------- | ------------------------------------------------------------------------------------------- |   |
   | `Type`        | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **NFCWrite**: writes data to the specified sector.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   | `Variant`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **MifareDesfire**: the type of NFC tag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   | `NFCData`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If you leave the `NFCData` array empty when trying to write, the response will return the `UID` and the `variant` but will not write to the card.An array with:- `aid`: the application ID that contains the `fileIds` to write to.
   - `keyId`: the ID of the key used to access the specified `aid`.
   - `fileIds`: the files inside the `aid` to write to.
   - `fileOffsets`: the byte in the specified file from which to start writing data.
   - `fileLengths`: the number of bytes to write to, starting from the byte specified in `fileOffset`.
   - `data`: data to write to the specified file. |
   | `ExpectedUid` | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | Specifies the `UID` of the NFC tag to which you want to write the data. If the `UID` of the presented NFC tag is different from the `ExpectedUid`, the request fails and `WRONG_CARD` is returned in the `AdditionalResponse`. If passed without a value, the parameter is ignored.                                                                                                                                                                                                                                                                                                            |

   **Structure of Operation object for write data request - Mifare DESFire**

   ```json
   {
       "Operation":[
           {
               "Type":"NFCWrite",
               "Variant":"MifareDesfire",
               "NFCData":[
                   {
                       "aid":"376632",
                       "keyId":0,
                       "fileIds":[0],
                       "fileOffsets":[0],
                       "fileLengths":[16],
                       "data":"0AA0000000000AA0"
                   },
                   {
                       "aid":"376632",
                       "keyId":0,
                       "fileIds":[1],
                       "fileOffsets":[0],
                       "fileLengths":[16],
                       "data":"0AA0000000000AA1"
                   }
               ]
           }
       ]
   }
   ```

2. Encode the `Operation` JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
    
   ```

3. [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**.

   * The [CardAcquisitionRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-SaleData) object with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                              |
     | ------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: your reference to identify the transaction. We recommend using a unique value.
     - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). |
     | `SaleToPOIData`     |                                                                                             | The Base64-encoded `Operation` JSON object.                                                                                                                                                                                                              |

   * The [CardAcquisitionRequest.CardAcquisitionTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-CardAcquisitionTransaction) object with:

     | Parameter     | Required | Description                                                                                                                                                                                               |
     | ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `TotalAmount` |          | The transaction amount. You can omit the `TotalAmount` field when writing to the NFC tag.If you omit `TotalAmount`, you still have to include an empty `CardAcquisitionTransaction` field in the request. |

   The following example shows a card acquisition request to write data to `fileIds` **0** and **1** of `aid` **376632** on a **MifareDesfire** NFC tag:

   **Write data request - MIFARE DESFire**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"283",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"369",
                       "TimeStamp":"2021-03-05T12:22:57.449Z"
                   },
                   "TokenRequestedType":"Customer",
                   "SaleToPOIData":" "
               },
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

4. When the card acquisition succeeds, in the `AdditionalResponse` of the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response) note:

   * `NFC.data`: the data from the specified `aid`.

     * For a single `aid`, the data shows as **NFC.data.376632.F0=0AA0000000000AA0**.
     * For multiple `aid` fields and `fileIds`, the data from each `aid` shows as value of the `NFC.data` for that `aid` and `fileIds`: **NFC.data.376632.F0=0AA0000000000AA0&...\&NFC.data.376632.F1=0AA0000000000AA1**.

   * `NFC.status`: the status of the write action for every `aid`, for example **NFC.status=376632.OK**.

   * `NFC.uid`: the unique identifier of the NFC tag.

   * `NFC.variant`: the type of the NFC tag, in this case MIFARE DESFire.

   **Write data response - MIFARE DESFire**

   ```json
   {
       "SaleToPOIResponse":{
           "CardAcquisitionResponse":{
               "POIData":{
                   "POIReconciliationID":"1000",
                   "POITransactionID":{
                       "TimeStamp":"2022-10-18T08:17:51.000Z",
                       "TransactionID":"i495001668683154001"
                   }
               },
               "PaymentInstrumentData":{
                   "CardData":{
                   },
                   "PaymentInstrumentType":"Card"
               },
               "Response":{
                   "AdditionalResponse":"tid=10502371&transactionType=GOODS_SERVICES&giftcardIndicator=false&posAmountGratuityValue=0&NFC.data.376632.F0=0AA0000000000AA0&store=BookStore&NFC.data.376632.F1=0AA0000000000AA1&iso8601TxDate=2022-11-17T11%3a05%3a54.879Z&posOriginalAmountValue=0&txtime=12%3a05%3a54&NFC.uid=041842F2325780&txdate=17-11-2022&merchantReference=1&posadditionalamounts.originalAmountCurrency=EUR&posAuthAmountCurrency=EUR&message=CARD_ACQ_COMPLETED&posAmountCashbackValue=0&NFC.variant=mf_desfire&posEntryMode=CLESS_SWIPE&NFC.status=376632.OK&posAuthAmountValue=0",
                   "Result":"Success"
               },
               "SaleData":{
                   "SaleTransactionID":{
                       "TimeStamp":"2022-10-03T10:56:42.966Z",
                       "TransactionID":"889"
                   }
               }
           },
           "MessageHeader":{
               "MessageCategory":"CardAcquisition",
               "MessageClass":"Service",
               "MessageType":"Response",
               "POIID":"S1EL-000150183300032",
               "ProtocolVersion":"3.0",
               "SaleID":"POSSystemID12345",
               "ServiceID":"833"
           }
       }
   }
   ```

   After you write to the specified sectors on the NFC tag, the loading screen continues to show until you send an\
   enable service request (see the next step).

5. To stop the loading screen, make an enable service request to a [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), 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 **EnableService**.

   * [EnableServiceRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/enableservice) with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
     | ------------------- | ------------------------------------------------------------------------------------------- |   |
     | `TransactionAction` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **AbortTransaction**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
     | `DisplayOutput`     |                                                                                             | [Optional object](/point-of-sale/card-acquisition#alternative) to show your own message and an 'Approved' icon (green check mark) or a 'Declined' icon (red cross).If you omit `DisplayOutput`, the terminal shows *Canceled*, a red cross **![](/images/5/8/8/4/9/58849deb729ef765fb92c34a2b367b9ae58a5598-cancel2x.png)**, and *Transaction canceled*. Omit if you have a NFC configuration that [hides the Adyen UI](#hide) while using a dedicated Android app for NFC operations. Otherwise the Adyen UI will be brought to the foreground. |

   The following example is the basic request, without the `DisplayOutput` object, to stop the card acquisition flow.

   **Basic request to cancel the card acquisition data**

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"EnableService",
            "MessageType":"Request",
            "ServiceID":"3020711110",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-346403161"
         },
         "EnableServiceRequest":{
            "TransactionAction":"AbortTransaction"
         }
      }
   }
   ```

### Tab: MIFARE Ultralight - write

MIFARE Ultralight is an NFC tag with lower security standards so it does not have sectors and keys. The data is instead segmented into pages, and you do not need to specify keys to write.

[Engage terminals](#supported-products) can only read/write to unlocked MIFARE Ultralight C pages.

1. Create an `Operation` JSON object and specify:

   | Parameter     | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   | ------------- | ------------------------------------------------------------------------------------------- |   |
   | `Type`        | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **NFCWrite**: writes data to the specified page.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   | `Variant`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The type of NFC tag used: **MifareUltralight**, **MifareUltralightC**, or **MifareUltralightAES**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   | `NFCData`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If you leave the `NFCData` array empty when trying to write, the response will return the `UID` and the `variant` but will not write to the card.An array with:- `pageOffset`: specifies what page to write data to on **MIFARE Ultralight** or **MIFARE Ultralight C**.

   - `data`: data to write to the specified page.

   - `ultralightCKey`: required only for the **Ultralight C** variant. HEX-encoded key used to authenticate the card. If you do not provide a key, the default one is used: `49454D4B41455242214E4143554F5946`.

   - `ultralightAESKey`: required only for the **Ultralight AES** variant. HEX-encoded key used to authenticate the card. If you do not provide a key, the default one is used: `00000000000000000000000000000000`.

   - `ultralightAESKeyId`: optional for the **Ultralight AES** variant. The key that specifies what part of the card's memory to access. Possible values:

     * **0**: (default) `DataProtKey` authenticates the card and accesses protected user memory and the `UID`.
     * **1**: `UIDRetrKey` authenticates the card and retrieves the `UID` and the `ECDSA` signature. |
   | `ExpectedUid` | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | Specifies the `UID` of the NFC tag to which you want to write the data. If the `UID` of the presented NFC tag is different from the `ExpectedUid`, the request fails and `WRONG_CARD` is returned in the `AdditionalResponse`. If passed without a value, the parameter is ignored.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

   **Structure of Operation object for write data request - Mifare Ultralight**

   ```json
   {
        "Operation":[
            {
                "Type":"NFCWrite",
                "Variant":"MifareUltralight",
                "NFCData":[
                    {
                        "pageOffset":4,
                        "data":"BFBFBFBF"
                    }
                ]
            }
        ]
   }
   ```

2. Encode the `Operation` JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
   ewogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNXcml0ZSIsCiAgICAgICAgICAgICJWYXJpYW50IjoiTWlmYXJlVWx0cmFsaWdodCIsCiAgICAgICAgICAgICJORkNEYXRhIjpbCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgInBhZ2VPZmZzZXQiOjQsCiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiJCRkJGQkZCRiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgXQogICAgICAgIH0KICAgIF0KfQ==
   ```

3. [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**.

   * The [CardAcquisitionRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-SaleData) object with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                              |
     | ------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: your reference to identify the transaction. We recommend using a unique value.
     - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). |
     | `SaleToPOIData`     |                                                                                             | The Base64-encoded `Operation` JSON object.                                                                                                                                                                                                              |

   * The [CardAcquisitionRequest.CardAcquisitionTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-CardAcquisitionTransaction) object with:

     | Parameter     | Required | Description                                                                                                                                                                                               |
     | ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `TotalAmount` |          | The transaction amount. You can omit the `TotalAmount` field when writing to the NFC tag.If you omit `TotalAmount`, you still have to include an empty `CardAcquisitionTransaction` field in the request. |

   The following example shows a card acquisition request to write data to page 4 on a **MifareUltralight** NFC tag:

   **Write data request - MIFARE Ultralight**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"283",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"369",
                       "TimeStamp":"2021-03-05T12:22:57.449Z"
                   },
                   "TokenRequestedType":"Customer",
                   "SaleToPOIData":"ewogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNXcml0ZSIsCiAgICAgICAgICAgICJWYXJpYW50IjoiTWlmYXJlVWx0cmFsaWdodCIsCiAgICAgICAgICAgICJORkNEYXRhIjpbCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgInBhZ2VPZmZzZXQiOjQsCiAgICAgICAgICAgICAgICAgICAgImRhdGEiOiJCRkJGQkZCRiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgXQogICAgICAgIH0KICAgIF0KfQ=="
               },
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

4. When the card acquisition succeeds, in the `AdditionalResponse` of the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response) note:

   * `NFC.data`: The data from the specified page, such as **NFC.data.P05=0F2AF6C4...**.
   * `NFC.status`: The status of the write action for every `page`, for example **NFC.status=P04.OK**.
   * `NFC.uid`: The unique identifier of the NFC tag.
   * `NFC.variant`: The type of the NFC tag, in this case MIFARE Ultralight.

   **Write data response - MIFARE Ultralight**

   ```json
   {
       "SaleToPOIResponse": {
           "CardAcquisitionResponse": {
               "POIData": {
                   "POIReconciliationID": "1000",
                   "POITransactionID": {
                       "TimeStamp": "2022-10-18T13:22:07.000Z",
                       "TransactionID": "CglQ001666099327010"
                   }
               },
               "PaymentInstrumentData": {
                   "CardData": {},
                   "PaymentInstrumentType": "Card"
               },
               "Response": {
                   "AdditionalResponse": "tid=47353332&transactionType=GOODS_SERVICES&giftcardIndicator=false&posAmountGratuityValue=0&store=BookStore&iso8601TxDate=2022-10-18T13%3a22%3a07.324Z&posOriginalAmountValue=0&txtime=15%3a22%3a07&NFC.uid=04DDECD2FA7280&txdate=18-10-2022&merchantReference=247&posadditionalamounts.originalAmountCurrency=EUR&posAuthAmountCurrency=EUR&message=CARD_ACQ_COMPLETED&posAmountCashbackValue=0&NFC.data.P04=BFBFBFBF&NFC.variant=mf_ultralight_ev1&posEntryMode=CLESS_SWIPE&NFC.status=P04OK&posAuthAmountValue=0",
                   "Result": "Success"
               },
               "SaleData": {
                   "SaleTransactionID": {
                       "TimeStamp": "2022-10-03T10:56:42.966Z",
                       "TransactionID": "247"
                   }
               }
           },
           "MessageHeader": {
               "MessageCategory": "CardAcquisition",
               "MessageClass": "Service",
               "MessageType": "Response",
               "POIID": "V400m-347353332",
               "ProtocolVersion": "3.0",
               "SaleID": "POSSystemID12345",
               "ServiceID": "236"
           }
       }
   }
   ```

   After you write to the specified pages on the NFC tag, the loading screen continues to show until you send an\
   enable service request (see the next step).

5. To stop the loading screen, make an enable service request to a [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), 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 **EnableService**.

   * [EnableServiceRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/enableservice) with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                 |
     | ------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `TransactionAction` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **AbortTransaction**.                                                                                                                                                                                                                                                                                                                                       |
     | `DisplayOutput`     |                                                                                             | [Optional object](/point-of-sale/card-acquisition#alternative) to show your own message and an 'Approved' icon (green check mark) or a 'Declined' icon (red cross).Omit if you have an NFC configuration that [hides the Adyen UI](#hide) while using a dedicated Android app for NFC operations. Otherwise the Adyen UI will be brought to the foreground. |

   The following example is the basic request, without `DisplayOutput` object, to stop the card acquisition flow. The terminal will show *Canceled*, a red cross **![](/images/5/8/8/4/9/58849deb729ef765fb92c34a2b367b9ae58a5598-cancel2x.png)**, and *Transaction canceled*.

   **Basic request to cancel the card acquisition data**

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"EnableService",
            "MessageType":"Request",
            "ServiceID":"3020711110",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-346403161"
         },
         "EnableServiceRequest":{
            "TransactionAction":"AbortTransaction"
         }
      }
   }
   ```

## Create a session

If your use case requires multiple read/write actions on an NFC tag, you can create a session to make multiple requests part of the same user interaction. While the session is in progress, the terminal shows the *One moment* loading screen.

The flow consists of the following steps:

1. In the first card acquisition request to [identify](#identify-nfc), [read](#read-nfc), or [write](#write-nfc) NFC tags, you start the session by adding `Session.Type`: **Begin** in the `SaleToPOIData`.

   All requests that belong to the session must contain the same `Session.Id` in the `SaleToPOIData`.

2. You then send more card acquisition requests for subsequent NFC tag operations.

3. To finish the session:

   * In the last NFC tag card acquisition request of the session, you add `Session.Type`: **End** in the `SaleToPOIData`.
   * You send an enable service request to ensure the terminal stops showing the loading screen.

Here is an example of a session that consists of three card acquisition requests, to:

* [Start a session and identify the NFC tag type](#start-session)
* [Continue the session with a Read data request](#session-id)
* [Finish the session with a Write data request](#end-session).

### 1. Start a session and identify the NFC tag type

When starting the session, you need specify the `Id` to connect the requests into a single session. Here's example of how identify the tag and start the session:

1. Create a JSON object with:

   | Parameter         | Required                                                                                    | Description                                                                                                                                                                                           |
   | ----------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | `Session.Type`    | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Begin**: starts the session.                                                                                                                                                                        |
   | `Session.Id`      | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique reference of the session.                                                                                                                                                                 |
   | `Session.Timeout` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | * How long the *One moment* screen is shown on the terminal display, in milliseconds.
   * If there is no end session request, how long before the session data is deleted and new requests can be sent. |
   | `Operation.Type`  | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **NFCReadUID**: returns the NFC tag identifier and type.                                                                                                                                              |

   **JSON object**

   ```json
   {
       "Session": {
           "Type": "Begin",
           "Id": "50",
           "TimeoutMs": "60000"
       },
       "Operation":[
           {
               "Type":"NFCReadUID"
           }
       ]
   }
   ```

2. Encode the JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
   ewogICAgIlNlc3Npb24iOnsKICAgICAgICAiVHlwZSI6IkJlZ2luIiwKICAgICAgICAiSWQiOiI1MCIsCiAgICAgICAgIlRpbWVvdXRNcyI6IjYwMDAwIgogICAgfSwKICAgICJPcGVyYXRpb24iOlsKICAgICAgICB7CiAgICAgICAgICAgICJUeXBlIjoiTkZDUmVhZFVJRCIKICAgICAgICB9CiAgICBdCn0=
   ```

3. [Make a card acquisition request](/point-of-sale/card-acquisition) with the Base64-encoded string in the `SaleToPOIData`.

   **Start a session and identify the NFC tag type**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"1020711110",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"02072",
                       "TimeStamp":"2020-01-07T14:14:04+00:00"
                   },
                   "SaleToPOIData":"ewogICAgIlNlc3Npb24iOnsKICAgICAgICAiVHlwZSI6IkJlZ2luIiwKICAgICAgICAiSWQiOiI1MCIsCiAgICAgICAgIlRpbWVvdXRNcyI6IjYwMDAwIgogICAgfSwKICAgICJPcGVyYXRpb24iOlsKICAgICAgICB7CiAgICAgICAgICAgICJUeXBlIjoiTkZDUmVhZFVJRCIKICAgICAgICB9CiAgICBdCn0="
               },
               "CardAcquisitionTransaction":{

               }
           }
       }
   }
   ```

### 2. Send read data request with Session.Id

Make sure to include the `Session.Id` specified in the `SaleToPOIData` of the first request. Here's example of how to read data from MIFARE Classic as part of the session:

1. Create a JSON object with:

   | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                        |
   | ------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | `Session.Id`        | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique reference of the session, specified in the first request.                                                                                                                                                                                                                                                                                                              |
   | `Operation.Type`    | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **NFCRead**: reads data from the specified sector.                                                                                                                                                                                                                                                                                                                                 |
   | `Operation.Variant` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **MifareClassic**: the type of NFC tag.                                                                                                                                                                                                                                                                                                                                            |
   | `Operation.NFCData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If you leave the `NFCData` array empty, the terminal will try to read all sectors.An array with:- `sector`: specifies what sector on **MifareClassic** to read from.
   - `keyType`: specifies what key is used to access a sector, **a** (default) or **b**.

     On [Castles Android terminals](#supported-terminal)You cannot use `keyType`: **b** due to a limitation from Castles. |

   **JSON object**

   ```json
   {
       "Session":{
           "Id":"50"
       },
       "Operation":[
           {
               "Type":"NFCRead",
               "Variant":"MifareClassic",
               "NFCData":[
                   {
                       "sector":1,
                       "keyType":"a"
                   }
               ]
           }
       ]
   }
   ```

2. Encode the JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
   ewogICAgIlNlc3Npb24iOnsKICAgICAgICAiSWQiOiI1MCIKICAgIH0sCiAgICAiT3BlcmF0aW9uIjpbCiAgICAgICAgewogICAgICAgICAgICAiVHlwZSI6Ik5GQ1JlYWQiLAogICAgICAgICAgICAiVmFyaWFudCI6Ik1pZmFyZUNsYXNzaWMiLAogICAgICAgICAgICAiTkZDRGF0YSI6WwogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICJzZWN0b3IiOjEsCiAgICAgICAgICAgICAgICAgICAgImtleVR5cGUiOiJhIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBdCiAgICAgICAgfQogICAgXQp9
   ```

3. [Make a card acquisition request](/point-of-sale/card-acquisition) with the Base64-encoded string in the `SaleToPOIData`.\
   The following example shows how to read data from **MifareClassic** NFC tag as part of the session:

   **Read data request with Sessions.Id**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"282",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"369",
                       "TimeStamp":"2021-03-05T12:22:57.449Z"
                   },
                   "TokenRequestedType":"Customer"
               },
               "SaleToPOIData":"ewogICAgIlNlc3Npb24iOnsKICAgICAgICAiSWQiOiI1MCIKICAgIH0sCiAgICAiT3BlcmF0aW9uIjpbCiAgICAgICAgewogICAgICAgICAgICAiVHlwZSI6Ik5GQ1JlYWQiLAogICAgICAgICAgICAiVmFyaWFudCI6Ik1pZmFyZUNsYXNzaWMiLAogICAgICAgICAgICAiTkZDRGF0YSI6WwogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICJzZWN0b3IiOjEsCiAgICAgICAgICAgICAgICAgICAgImtleVR5cGUiOiJhIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBdCiAgICAgICAgfQogICAgXQp9",
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

### 3. Write data to the NFC tag and end the session

In the final request of the interaction, make sure to include the same `Session.Id` and `Session.Type`: **End**. Here's example of how to write data to MIFARE Classic and end the session:

1. Create a JSON object with:

   | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   | ------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | `Session.Type`      | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **End**: ends the session.                                                                                                                                                                                                                                                                                                                                                                                                                         |
   | `Session.Id`        | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique reference of the session.                                                                                                                                                                                                                                                                                                                                                                                                              |
   | `Operation.Type`    | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **NFCWrite**: reads data from the specified sector.                                                                                                                                                                                                                                                                                                                                                                                                |
   | `Operation.Variant` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **MifareClassic**: the type of NFC tag.                                                                                                                                                                                                                                                                                                                                                                                                            |
   | `Operation.NFCData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If you leave the `NFCData` array empty when trying to write, the response will return the `UID` and the `variant` but will not write to the card.An array with:- `sector`: specifies what sector on **MifareClassic** to read from.
   - `keyType`: specifies what key is used to access a sector, **a** (default) or **b**.

     On [Castles Android terminals](#supported-products) you cannot use `keyType`: **b** due to a limitation from Castles. |

   **JSON object**

   ```json
   {
       "Session":{
           "Type": "End",
           "Id":"50"
       },
       "Operation":[
           {
               "Type": "NFCWrite",
               "Variant": "MifareClassic",
               "NFCData":[
                   {
                       "sector": 1,
                       "data":"..."
                   }
               ]
           }
       ]
   }
   ```

2. Encode the JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`.

   **Converted to a Base64-encoded string**

   ```raw
   ewogICAgIlNlc3Npb24iOnsKICAgICAgICAiVHlwZSI6IkVuZCIsCiAgICAgICAgIklkIjoiNTAiCiAgICB9LAogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNXcml0ZSIsCiAgICAgICAgICAgICJWYXJpYW50IjoiTWlmYXJlQ2xhc3NpYyIsCiAgICAgICAgICAgICJORkNEYXRhIjpbCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgInNlY3RvciI6MSwKICAgICAgICAgICAgICAgICAgICAiZGF0YSI6Ii4uLiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgXQogICAgICAgIH0KICAgIF0KfQ==
   ```

3. [Make a card acquisition request](/point-of-sale/card-acquisition) with the Base64-encoded string in the `SaleToPOIData`.\
   The following example shows how to write data **MifareClassic** NFC tag and end the session:

   **Write data to the NFC tag and end the session**

   ```json
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "ServiceID":"283",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-346403161"
           },
           "CardAcquisitionRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"369",
                       "TimeStamp":"2021-03-05T12:22:57.449Z"
                   },
                   "TokenRequestedType":"Customer"
               },
               "SaleToPOIData":"ewogICAgIlNlc3Npb24iOnsKICAgICAgICAiVHlwZSI6IkVuZCIsCiAgICAgICAgIklkIjoiNTAiCiAgICB9LAogICAgIk9wZXJhdGlvbiI6WwogICAgICAgIHsKICAgICAgICAgICAgIlR5cGUiOiJORkNXcml0ZSIsCiAgICAgICAgICAgICJWYXJpYW50IjoiTWlmYXJlQ2xhc3NpYyIsCiAgICAgICAgICAgICJORkNEYXRhIjpbCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgInNlY3RvciI6MSwKICAgICAgICAgICAgICAgICAgICAiZGF0YSI6Ii4uLiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgXQogICAgICAgIH0KICAgIF0KfQ==",
               "CardAcquisitionTransaction":{
               }
           }
       }
   }
   ```

   After you end the session, the loading screen continues to show until you send an enable service request (see the\
   next step).

4. To stop the loading screen, make an enable service request to a [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), 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 **EnableService**.

   * [EnableServiceRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/enableservice) with:

     | Parameter           | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
     | ------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `TransactionAction` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **AbortTransaction**.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
     | `DisplayOutput`     |                                                                                             | [Optional object](/point-of-sale/card-acquisition#alternative) to show your own message and an 'Approved' icon (green check mark) or a 'Declined' icon (red cross).If you omit `DisplayOutput`, the terminal shows *Canceled*, a red cross **![](/images/5/8/8/4/9/58849deb729ef765fb92c34a2b367b9ae58a5598-cancel2x.png)**, and *Transaction canceled*. Omit if you have a NFC configuration that [hides the Adyen UI](#hide) to make sure the UI does not show. |

   The following example is the basic request, without the `DisplayOutput` object, to stop the card acquisition flow.

   **Basic request to cancel the card acquisition data**

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"EnableService",
            "MessageType":"Request",
            "ServiceID":"3020711110",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-346403161"
         },
         "EnableServiceRequest":{
            "TransactionAction":"AbortTransaction"
         }
      }
   }
   ```

## Hide the Adyen UI during NFC operations

Optionally, if you want to use a [dedicated Android app](/point-of-sale/android-terminals/app-requirements/) to process NFC operations for stored value cards or for identity cards, you can show your own UI on the terminal display instead of the Adyen UI. This can be useful, for example, for a loyalty card or transport card.

If you want to use this feature, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other).

When this feature is enabled and you make a card acquisition request to [identify](#identify-nfc), [read](#read-nfc), or [write](#write-nfc) to an NFC tag:

* If the payment terminal detects a stored value or identity card, the Adyen UI is hidden.

* If the terminal detects a regular payment card during any of the NFC card acquisition flows, the response returns a **BLOCK\_CARD** error. This does not mean that the card itself is blocked, but that it cannot be used for operations with your Android app. We recommend that your system returns a message that instructs the terminal operator to ask the shopper to present a card or tag that can be used with your app.

The following code sample shows the response for a card acquisition request to identify the NFC tag, when the customer presented a regular payment card.

**Response: Regular payment card blocked for NFC Operations**

```json
{
    "SaleToPOIResponse":{
        "CardAcquisitionResponse":{
            "POIData":{
                "POIReconciliationID": "1000",
                "POITransactionID":{
                    "TimeStamp": "2022-10-10T12:50:31.000Z",
                    "TransactionID": "CglQ001665406231000"
                }
            },
            "PaymentInstrumentData":{
                "CardData": {},
                "PaymentInstrumentType": "Card"
            },
            "Response":{
                "AdditionalResponse": "...refusalReason=199%20Card%20blocked&message=BLOCK_CARD...",
               "ErrorCondition": "Refusal",
               "Result": "Failure"
            },
            "SaleData":{
                "SaleTransactionID":{
                    "TimeStamp": "2022-10-03T10:56:42.198Z",
                    "TransactionID": "729"
                }
            }
        },
        "MessageHeader": {...}
    }
}
```

Regular [card acquisitions](/point-of-sale/card-acquisition) are not affected by this feature and show the Adyen UI as expected.

## Supported terminals and NFC tags

The following table shows the payment terminal models that support NFC tags.

### Castles Android

| Models | **MIFARE Classic**                                                                          | **MIFARE DESFire**                                                                          | **MIFARE Ultralight**                                                                       | **MIFARE Ultralight C**                                                                     | **MIFARE Ultralight AES**                                                                   |
| ------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| AMS1   | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") |
| S1E    | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") |
| S1E2L  | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") |
| S1F2   | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") |
| S1U2   | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") |

### Verifone Android

| Models | **MIFARE Classic**                           | **MIFARE DESFire**                                                                          | **MIFARE Ultralight**                                                                       | **MIFARE Ultralight C**                                                                     | **MIFARE Ultralight AES**                                                                   |
| ------ | -------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| M450   | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") |
| P630   | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") |

### Engage

Engage terminals cannot authenticate MIFARE Ultralight C tags. This means that reading/writing Ultralight C tags only works on unlocked pages.

| Models     | **MIFARE Classic**                                                                          | **MIFARE DESFire**                           | **MIFARE Ultralight**                                                                       | **MIFARE Ultralight C**                                                                     | **MIFARE Ultralight AES**                    |
| ---------- | ------------------------------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------- |
| e285p      | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") |
| M400       | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") |
| P400 Plus  | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") |
| V240m Plus | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") |
| V400c Plus | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") |
| V400m      | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") |
| UX300      | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | ![-x-](/user/data/smileys/emoji/x.png "-x-") |
| UX410      | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | ![-x-](/user/data/smileys/emoji/x.png "-x-")                                                | ![-x-](/user/data/smileys/emoji/x.png "-x-") |

### Datecs

| Models | **MIFARE Classic**                           | **MIFARE DESFire**                           | **MIFARE Ultralight**                        | **MIFARE Ultralight C**                      | **MIFARE Ultralight AES**                    |
| ------ | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| SFO1   | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") | ![-x-](/user/data/smileys/emoji/x.png "-x-") |

## See also

* [Card acquisition](/point-of-sale/card-acquisition)
* [Deploy apps to your terminals](/point-of-sale/android-terminals/deploy-apps)
