---
title: "Log in and log out"
description: "Log in your terminal and begin processing payments. Log out of your terminal when changing operator, or at the end of a shift."
url: "https://docs.adyen.com/point-of-sale/reconciling-totals/log-in-and-log-out"
source_url: "https://docs.adyen.com/point-of-sale/reconciling-totals/log-in-and-log-out.md"
canonical: "https://docs.adyen.com/point-of-sale/reconciling-totals/log-in-and-log-out"
last_modified: "2019-08-20T11:45:00+02:00"
language: "en"
---

# Log in and log out

Log in your terminal and begin processing payments. Log out of your terminal when changing operator, or at the end of a shift.

[View source](/point-of-sale/reconciling-totals/log-in-and-log-out.md)

If you want to use Terminal API requests to retrieve transaction totals of a terminal or reconcile balance mismatches, you must first make a Terminal API request to log in to the terminal.

This login request can additionally mark events like a change of operator or the start of a new shift, so that you can get the totals by operator or shift.

The login request does not authenticate the operator.

## Requirements

Before you begin, take into account the following requirements.

| Requirement          | Description                                                                                               |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| **Integration type** | A [Terminal API](/point-of-sale/design-your-integration/terminal-api) integration with payment terminals. |

## Log in to the terminal

1. Make a [Terminal API](/point-of-sale/design-your-integration/terminal-api) login 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 **Login**.

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

     | Parameter                        | Required                                                                                    | Description                                                                                                                                                      |
     | -------------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `DateTime`                       | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The date and time in UTC format.                                                                                                                                 |
     | `SaleSoftware`                   | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with the manufacturer, application name, software version, and certification code of the sale system.                                                  |
     | `OperatorLanguage`               | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The language of the operator in two-character [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. For example, **en** for English. |
     | `OperatorID`                     |                                                                                             | Your identification of the operator.                                                                                                                             |
     | `SaleTerminalData.TotalsGroupID` |                                                                                             | Your identification of a group of transactions, for reconciliation purposes.                                                                                     |
     | `ShiftNumber`                    |                                                                                             | Your identification of the shift.                                                                                                                                |

   #### JSON

   ```json
   {  
      "SaleToPOIRequest":{  
         "MessageHeader":{  
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"Login",
            "MessageType":"Request",
            "ServiceID":"0403105031",
            "SaleID":"POSSystemID12345",
            "POIID":"P400Plus-275008565"
         },
         "LoginRequest":{  
            "DateTime":"2018-04-03T08:50:31+00:00",
            "SaleSoftware":{  
               "ManufacturerID":"Adyen",
               "ApplicationName":"TestScripts",
               "SoftwareVersion":"1.0",
               "CertificationCode":""
            },
            "SaleTerminalData":{  
               "TotalsGroupID":"GroupA"
            },
            "OperatorLanguage":"en",
            "OperatorID":"John"
         }
      }
   }
   ```

   #### Java

   ```java
   String serviceID = "YOUR_UNIQUE_ATTEMPT_ID";
   String saleID = "YOUR_CASH_REGISTER_ID";
   String POIID = "YOUR_TERMINAL_ID";

   SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();
   MessageHeader messageHeader = new MessageHeader();
   messageHeader.setProtocolVersion("3.0");
   messageHeader.setMessageClass( MessageClassType.SERVICE );
   messageHeader.setMessageCategory( MessageCategoryType.LOGIN );
   messageHeader.setMessageType( MessageType.REQUEST );
   messageHeader.setServiceID(serviceID);
   messageHeader.setSaleID(saleID);
   messageHeader.setPOIID(POIID);
   saleToPOIRequest.setMessageHeader(messageHeader);

   LoginRequest loginRequest = new LoginRequest();
   loginRequest.setDateTime("2018-04-03T08:50:31+00:00");
   SaleSoftware saleSoftware = new SaleSoftware();
   saleSoftware.setManufacturerID("Adyen");
   saleSoftware.setApplicationName("TestScripts");
   saleSoftware.setSoftwareVersion("1.0");
   saleSoftware.setCertificationCode("");
   loginRequest.setSaleSoftware(saleSoftware);

   SaleTerminalData saleTerminalData = new SaleTerminalData();
   saleTerminalData.setTotalsGroupID("GroupA");
   loginRequest.setSaleTerminalData(saleTerminalData);
   loginRequest.setOperatorLanguage("en");
   loginRequest.setOperatorID("John");
   saleToPOIRequest.setLoginRequest(loginRequest);
   terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);
   ```

2. In the [LoginResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/login#responses-200-Response), check the following:

   * `Response.Result`: **Success** indicates that you logged in to the terminal.
   * `POIStatus`: Indicates if the terminal is ready for use.

   ```json
   {
     "SaleToPOIResponse":{
        "LoginResponse":{
           "POISystemData":{
              "POISoftware":{
                 "CertificationCode":"",
                 "SoftwareVersion":"adyen_423314",
                 "ManufacturerID":"Adyen",
                 "ApplicationName":"Nexo"
              },
              "DateTime":"2018-04-03T08:50:23.000Z",
              "POIStatus":{
                 "CommunicationOKFlag":true,
                 "GlobalStatus":"OK"
              }
           },
           "Response":{
              "Result":"Success"
           }
        },
        "MessageHeader":{
           "ProtocolVersion":"3.0",
           "SaleID":"POSSystemID12345",
           "MessageClass":"Service",
           "MessageCategory":"Login",
           "ServiceID":"0403105031",
           "POIID":"P400Plus-275008565",
           "MessageType":"Response"
        }
     }
   }
   ```

After logging in, the terminal saves the provided values. The values remain in effect until a new login request is processed for the same terminal, or until you log out from this terminal.

## Log out from the terminal

1. Make a [Terminal API](/point-of-sale/design-your-integration/terminal-api) logout 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 **Logout**.

     | 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-") | **Logout**                                                                                                                                                  |
     | `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]*.                                                          |

   * An empty [LogoutRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/logout) object.

   #### JSON

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"Logout",
            "MessageType":"Request",
            "ServiceID":"0403105613",
            "SaleID":"POSSystemID12345",
            "POIID":"P400Plus-275008565"
         },
         "LogoutRequest":{

         }
      }
   }
   ```

   #### Java

   ```java
   String serviceID = "YOUR_UNIQUE_ATTEMPT_ID";
   String saleID = "YOUR_CASH_REGISTER_ID";
   String POIID = "YOUR_TERMINAL_ID";

   SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();
   MessageHeader messageHeader = new MessageHeader();
   messageHeader.setProtocolVersion("3.0");
   messageHeader.setMessageClass( MessageClassType.SERVICE );
   messageHeader.setMessageCategory( MessageCategoryType.LOGOUT );
   messageHeader.setMessageType( MessageType.REQUEST );
   messageHeader.setServiceID(serviceID);
   messageHeader.setSaleID(saleID);
   messageHeader.setPOIID(POIID);
   saleToPOIRequest.setMessageHeader(messageHeader);

   LogoutRequest logoutRequest = new LogoutRequest();
   saleToPOIRequest.setLogoutRequest(logoutRequest);
   terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);
   ```

2. In the [LogoutResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/logout#responses-200-Response), check the following:

   * `Response.Result`: **Success** indicates that you logged out from the terminal.

   ```json
   {
     "SaleToPOIResponse":{
        "LogoutResponse":{
           "Response":{
              "Result":"Success"
           }
        },
        "MessageHeader":{
           "ProtocolVersion":"3.0",
           "SaleID":"POSSystemID12345",
           "MessageClass":"Service",
           "MessageCategory":"Logout",
           "ServiceID":"0403105613",
           "POIID":"P400Plus-275008565",
           "MessageType":"Response"
        }
     }
   }
   ```

## See also

* [Retrieve totals from a terminal](/point-of-sale/reconciling-totals/retrieve-totals-from-the-terminal)
* [Reconcile a balance mismatch](/point-of-sale/reconciling-totals/reconcile-a-balance-mismatch)
