---
title: "Reconcile a balance mismatch"
description: "Get the totals of a reconciliation period and use them to reconcile balance mismatches between the terminal and POS app."
url: "https://docs.adyen.com/point-of-sale/reconciling-totals/reconcile-a-balance-mismatch"
source_url: "https://docs.adyen.com/point-of-sale/reconciling-totals/reconcile-a-balance-mismatch.md"
canonical: "https://docs.adyen.com/point-of-sale/reconciling-totals/reconcile-a-balance-mismatch"
last_modified: "2019-08-20T11:45:00+02:00"
language: "en"
---

# Reconcile a balance mismatch

Get the totals of a reconciliation period and use them to reconcile balance mismatches between the terminal and POS app.

[View source](/point-of-sale/reconciling-totals/reconcile-a-balance-mismatch.md)

You may need to reconcile the balance between your payment terminal and POS app when a mismatch occurs. For example, if the connection dropped at some point and your POS app does not receive the final response.

Use the reconciliation request to:

* Get the terminal's totals of the current reconciliation period and start a new period, by setting the reconciliation type to **SaleReconciliation**.

* Get the terminal's report of a previous reconciliation period without starting a new period, by setting the reconciliation type to **PreviousReconciliation** and using `POIReconciliationID` **NNN**.

## 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. |

## Make a reconciliation request

1. [Log in to the terminal](/point-of-sale/reconciling-totals/log-in-and-log-out).

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

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

     | Parameter             | Required                                                                                    | Description                                                                                                                                                                                                                                                                                                      |
     | --------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | `ReconciliationType`  | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The type of reconciliation:- **SaleReconciliation** to get the totals of the current reconciliation period and start a new period.
     - **PreviousReconciliation** to get the report of a previous reconciliation period without starting a new period. Also specify `POIReconciliationID` with a value of **NNN**. |
     | `POIReconciliationID` |                                                                                             | Include this field and set the value to **NNN** when using the reconciliation type **PreviousReconciliation**.                                                                                                                                                                                                   |

   #### JSON

   ```json
   {
      "SaleToPOIRequest":{
         "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"Reconciliation",
            "MessageType":"Request",
            "ServiceID":"0518145303",
            "SaleID":"CashRegB3",
            "POIID":"P400Plus-275008565"
         },
         "ReconciliationRequest":{
            "ReconciliationType":"SaleReconciliation"
         }
      }
   }
   ```

   #### 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.RECONCILIATION );
   messageHeader.setMessageType( MessageType.REQUEST );
   messageHeader.setServiceID(serviceID);
   messageHeader.setSaleID(saleID);
   messageHeader.setPOIID(POIID);
   saleToPOIRequest.setMessageHeader(messageHeader);

   ReconciliationRequest reconciliationRequest = new ReconciliationRequest();
   reconciliationRequest.setReconciliationType( ReconciliationType.SALE_RECONCILIATION );
   saleToPOIRequest.setReconciliationRequest(reconciliationRequest);
   terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);
   ```

3. In the [ReconciliationResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/reconciliation#responses-200-Response), check the `TransactionTotals` object.

   ```json
   {
     "SaleToPOIResponse":{
        "ReconciliationResponse":{
           "ReconciliationType":"SaleReconciliation",
           "POIReconciliationID":"1000",
           "Response":{
              "Result":"Success"
           },
           "TransactionTotals":[
              {
                 "SaleID":"CashRegB3",
                 "PaymentInstrumentType":"Card",
                 "PaymentCurrency":"EUR",
                 "PaymentTotals":[
                    {
                       "TransactionType":"Debit",
                       "TransactionCount":1,
                       "TransactionAmount":10.99
                    }
                 ],
                 "OperatorID":"John",
                 "CardBrand":"mc",
                 "TotalsGroupID":"GroupA",
                 "ShiftNumber":"123"
              }
           ]
        },
        "MessageHeader":{
           "ProtocolVersion":"3.0",
           "SaleID":"CashRegB3",
           "MessageClass":"Service",
           "MessageCategory":"Reconciliation",
           "ServiceID":"0518145303",
           "POIID":"P400Plus-275008565",
           "MessageType":"Response"
        }
     }
   }
   ```

## See also

* [Log in and log out on a terminal](/point-of-sale/reconciling-totals/log-in-and-log-out)
* [Retrieve totals from a terminal](/point-of-sale/reconciling-totals/retrieve-totals-from-the-terminal)
