# NFC Tag (/global/en/docs/Terminal/DeviceServices/NFC-Tag)

## NFC Tag

The NFC Tag service is designed to pass tag data to the payment terminal for processing.

> **WARN**
>
> NFC Tag presents its own terminal UI. If a previous Display is still shown, abort that Display and wait for the Abort to complete before starting NFC Tag. See [Device Display & Interaction](doc-id:afad6b34) for details.

#### NFC Tag Request

**NFCTagParam**

**transactionReference** *string* — Required

Global reference of the sale transaction for the sale system.

**messageContent** *string* — Required

Message content.

**maximumWaitingTime** *integer*

Maximum time to wait for the transmission to complete.\
Unit: second, the default value is 60.

**detectCount** *integer*

The number of times an NFC tag needs to be read.\
The default value is 1.

#### NFC Tag Response

**NFCTagResult**

**recipientPartyIdentification** *string* — Required

Unique identification of the partner that is the recipient of the message exchange.\
For example, the POS SN

**response** *enum* — Required

Result of the requested transaction.

**Possible enum values**

- `SUCC` — "Success.\nProcessing OK. Information related to the result of the processing is contained in other parts of the response message."
- `FAIL` — "Failure.\nProcessing of the request fails for various reasons."
- `PART` — "Partial Approved.\nThe service was partially completed. Use the Message Status service to query the final transaction status."

**responseReason** *string*

Detail of the response.

**Possible enum values**

- `ABRT` — "Aborted.\nThe initiator of the request has sent an abort message request, which was accepted and processed."
- `BUSY` — "Busy.\nThe system is busy, try later."
- `CANC` — "Cancel.\nThe user has aborted the transaction on the PED keyboard, for instance during PIN entering."
- `DEVO` — "DeviceOut.\nDevice out of order."
- `WPIN` — "WrongPIN.\nThe user has entered the PIN on the PED keyboard and the verification fails."
- `NHOS` — "UnreachableHost.\nAcquirer or any host is unreachable or has not answered to an online request, so is considered as temporary unavailable.\nDepending on the Sale context, the request could be repeated(to be compared with \\"Refusal\\")"
- `UNVS` — "UnavailableService.\nThe service is not available (not implemented, not configured, protocol version too old…)."
- `UNVD` — "UnavailableDevice.\nThe hardware is not available (absent, not configured…)"
- `REFU` — "Refusal.\nThe transaction is refused by the host or by the local rules associated to the card or the POI."
- `TNFD` — "NotFound.\nThe transaction is not found (e.g. for a reversal or a repeat)."
- `WIPG` — "InProgress.\nThe transaction is still in progress and then the command cannot be processed."

**additionalResponseInformation** *string*

Additional information to be logged for further examination.

**Transaction parameters**

When you receive the terminal result through the SDK callback interface and **NFCTagResult.response = SUCC**, you can obtain additional message.

**detectCount** *integer*

How many times the NFC tag has been read.

```java
NFCTagParam nfcTagParam = NFCTagParam.newBuilder()
        .messageContent("https://www.apple.com/")
        .maximumWaitingTime(30)
        .transactionReference(String.valueOf(System.currentTimeMillis()))
        .detectCount(1)
        .build();
RetailerManager.provideDeviceService().newNFCTagExchange(nfcTagParam).startAsyncExchange(new Exchange.RetailerSDKCallback<NFCTagResult>() {
    @Override
    public void onError(int code, String msg) {
        Logger.e(TAG,"NfcTagResult failed: " + code + ", " + msg);
    }

    @Override
    public void onResult(NFCTagResult result) {
        Logger.i(TAG,"NfcTagResult result: " + GsonUtils.toJson(result));
    }
});
```