# Reconciliation (/global/en/docs/Terminal/FinancialServices/Reconciliation)

## Reconciliation

This interface is used to verify and synchronize transaction data, ensuring consistency of transaction records across different systems.\
Typically performed at the end of the day or at specific intervals, its main functions include:\
1.Transaction Verification: Check whether transactions are consistent across systems, including transaction status, amount, and number of transactions.\
2.Trigger Settlement: Can be used to trigger settlement on the payment terminal.

Key notes:\
1.The reconciliation result may include multiple transactions; developers should handle exceptions based on the returned status.\
2.The frequency and implementation details of reconciliation depend on the acquirer and terminal configuration.

#### Reconciliation Request

**ReconciliationParam**

**reconciliationType** *enum*

Type of Reconciliation requested by the Sale to the POI.

**Possible enum values**

- `ASYN` — "Reconciliation and closure of the current period, with synchronisation of the reconciliation between the POI and Acquirers."

**More parameters**

**acquirerIdentification** *string*

Identification of the Acquirer.

**poiReconciliationIdentification** *string*

Identification of the reconciliation period between Sale and POI.

**merchantIdentification** *string*

Merchant identification.

**merchantIdentificationName** *string*

Merchant name.

**poiIdentificationId** *string*

Identification of the POI.

**additionalSaleData** *string*

Additional information associated with the sale transaction.

#### Reconciliation Response

**ReconciliationResult**

**reconciliationType** *string* — Required

Copy from Request.
The default value is ASYN.

**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. This field will be gradually replaced by respReason in future versions.

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

**respReason** *string*

Custom status field returned in the transaction result.

**Transaction parameters**

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

The following fields are defined, and the availability of each field depends on the capabilities provided by the payment application.

**transTotalSets** *array of dictionaries*

A list of transaction totals sets.

**TransTotalsSet** *dictionary* — Required

Payment Transaction totals during the reconciliation period, for a certain type of transaction.

**Child attributes** of `TransTotalsSet`

**TransTotals** *dictionary* — Required

Payment Transaction totals during the reconciliation period, for a certain type of transaction.

**Child attributes** of `TransTotals`

**transactionTotalsType** *enum* — Required

Identification of an Acquirer.

**Possible enum values**

- `CRDT` — "Credit: Credit transactions (refund, account, cash service, as defined in the transaction service type)"
- `CRDR` — "CreditReverse: Reversal of credit transactions (cancellation)."
- `DEBT` — "Debit: Debit transactions on the cardholder account."
- `DBTR` — "DebitReverse: Reversal of debit transactions (cancellation)."
- `DECL` — "Declined: Declined transactions."
- `FAIL` — "Failed: Failed transactions."
- `RESV` — "Reservation: Outstanding Reservation transactions."

**totalNum** *integer*

Total number of transactions during a reconciliation period.

**totalAmount** *string*

Total amount of a collection of transactions.

**activeCurrency** *enum*

Currency associated with the transaction.\
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html).

**cashBack** *string*

Cash-back amount.

**fees** *array of dictionaries*

Fees amount.

**DetailedAmount4** *dictionary*

Detailed amounts associated with the total amount of transaction.

**Child attributes** of `DetailedAmount4`

**amount** *string*

Amount value.

**label** *string*

Short description of the amount to display or print.

**valueAddedTax** *array of dictionaries*

A list of value added tax amounts.

**DetailedAmount4** *dictionary*

Detailed amounts associated with the total amount of transaction.

**Child attributes** of `DetailedAmount4`

**amount** *string*

Amount value.

**label** *string*

Short description of the amount to display or print.

**surcharge** *array of dictionaries*

Additional charge paid by the cardholder. For example airline credit card surcharge.

**DetailedAmount4** *dictionary*

Detailed amounts associated with the total amount of transaction.

**Child attributes** of `DetailedAmount4`

**amount** *string*

Amount value.

**label** *string*

Short description of the amount to display or print.

**poiGroupIdentification** *string*

Identifier assigned by the merchant identifying a set of POI terminals performing some categories of transactions.

**cardProductProfile** *string*

Category of cards related the acceptance processing rules defined by the acquirer.

**paymentInstrumentType** *enum*

Type of payment instrument

**Possible enum values**

- `CARD` — "Payment card."
- `CASH` — "Cash managed by a cash handling system."
- `CHCK` — "Paper check."
- `LOTY` — "Account using loyalty processing."
- `SVAC` — "Account accessed by a stored value instrument such as a card."

**acquirerIdentification** *string*

Identification of an Acquirer.

**reconciliationIdentification** *string*

Identifier of a host reconciliation period: acquirer for a payment or server for loyalty.

**saleReconciliationIdentification** *string*

Identifier of a reconciliation period on the sale system.

**brand** *string*

Brand of payment card or loyalty system.

**poiIdentification** *string*

Identification of the POI performing the transaction.

**saleIdentification** *string*

Identification of the sale terminal (electronic cash register or point of sale terminal) or the sale system.

**cashierIdentification** *string*

Identification of the cashier who carried out the transactions.

**shiftNumber** *string*

Identifies the shift of the cashier.

**More parameters**

**poiReconciliationIdentification** *string*

Identification of the reconciliation period between Sale and POI.

**merchantIdentification** *string*

Merchant identification.

**merchantIdentificationName** *string*

Merchant name.

**poiIdentificationId** *string*

Identification of the POI.

**cashierIdentification** *string*

Identification of the cashier who carried out the transaction.

**shiftNumber** *string*

Identifies the shift of the cashier.

**invoiceNumber** *string*

Identification of the invoice.

**additionalSaleData** *string*

Additional information associated with the sale transaction.

```java
ReconciliationParam reconciliationParam = ReconciliationParam.newBuilder()
        .build();
RetailerManager.provideFinancialService()
        .newReconciliationExchange(reconciliationParam)
        .startAsyncExchange(new Exchange.RetailerSDKCallback<ReconciliationResult>() {
            @Override
            public void onError(int code, String msg) {
                Logger.e(TAG,"failed" + code + "," + msg);
            }
            
            @Override
            public void onResult(ReconciliationResult result) {
                Logger.d(TAG,"result:" + GsonUtils.toJson(result));
            }
        });
```