# Reconcile a balance mismatch

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

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

Use the ReconciliationRequest to:

• Get the totals of the current reconciliation period and start a new period using ReconciliationType SaleReconciliation.

• Get the report of a previous reconciliation period using ReconciliationType PreviousReconciliation and POIReconciliationID **NNN*** . In this case, no new reconciliation period is started.

## Endpoint

The URL used to send Terminal API messages depends on your type of implementation. See Use the correct endpoint.

## ReconciliationRequest

For a list of ReconciliationRequest fields, see ReconciliationRequest fields.

The SaleID and ServiceID in the MessageHeader should be unique. SaleID and ServiceID combinations are rejected if used recently, within 48 hours.

The fields described below are the fields you specify when making a ReconciliationRequest call to the Terminal API.

{
"SaleToPOIRequest":{
"ProtocolVersion":"3.0",
"MessageClass":"Service",
"MessageCategory":"Reconciliation",
"MessageType":"Request",
"ServiceID":"0518145303",
"SaleID":"CashRegB3",
"POIID":"P400Plus-275008565"
},
"ReconciliationRequest":{
"ReconciliationType":"SaleReconciliation"
}
}
}
String serviceID = "YOUR_UNIQUE_ATTEMPT_ID";
String saleID = "YOUR_CASH_REGISTER_ID";
String POIID = "YOUR_TERMINAL_ID";

SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();

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

## ReconciliationResponse

For a list of ReconciliationResponse fields, see ReconciliationResponse fields.

The reconciliation response contains information about the status of the terminal in the following fields:

{
"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"
}
]
},
}