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

## Reversal

In our implementation, the Reversal interface is primarily used as a Void transaction. It applies when a previously successful transaction (such as a payment or pre-authorization completion) needs to be canceled within the same business day. Once voided, the original transaction becomes invalid and the funds will not be settled to the merchant account.

Typical scenarios:

- A cashier made an error and needs to cancel the completed payment.
- A customer decides to change the payment method, requiring the previous transaction to be voided.
- Canceling the original transaction within the same day to prevent settlement.

#### Reversal Request

**ReversalParam**

**transactionReference** *string* — Required

Global reference of the sale transaction for the sale system.

**orgTransactionReference** *string* — Required

Global reference of the original sale transaction for the sale system

**orgAuthorisationIdentification** *string*

The orgAuthorisationIdentification field specifies the identifier used to link the original pre-authorisation transaction.\
Its value is obtained from the authorisationIdentification returned in the pre-authorisation response message, ensuring consistency and correctness between the original authorisation and its subsequent transactions.

**More parameters**

**accountType** *enum*

Type of cardholder account used for the transaction.

**Possible enum values**

- `CRDT` — "Credit card account."
- `CDBT` — "Debit card account."
- `EBTCS` (U.S. Only) — "Electronic Benefit Transfer (EBT) Cash Sale."
- `EBTCW` (U.S. Only) — "Electronic Benefit Transfer (EBT) Cash Withdrawal"
- `EBTF` (U.S. Only) — "Electronic Benefit Transfer (EBT) Food Stamp."
- `EBTC` (U.S. Only) — "Electronic Benefit Transfer (EBT) Cash Card"

**totalAmount** *string*

Total transaction amount.

**reversedAmount** *string*

Amount that have been reversed.

**gratuity** *string*

Gratuity amount.

**currency** *enum*

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

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

**cashierIdentification** *string*

Identification of the cashier who carried out the transaction.

**cashback** *string*

Cashback amount.

**runInBackground** *boolean*

Indicates whether the transaction process should continue when the app is running in the background.

**orgTransactionDateTime** *date*

Transaction date time of the original sale transaction for the sale system.\
Data: A particular point in the progression of time in a calendar year expressed in the yyyyMMdd format.

**orgIssuerReferenceData** *string*

Identification of the transaction given by the Issuer.

**orgPoiTransactionIdentification** *string*

POI identification of the transaction in an unambiguous way.

**orgAuthorisationCode** *string*

Value assigned by the authorising party.

**invoiceNumber** *string*

Identification of the invoice.

**isFullReversal** *boolean* — Only For TSYS MultiPASS

Full Reversal is initiated to remove an approved transaction from a batch.\
Partial Reversals Decreases the total authorized amount of a previously authorized transaction.

**additionalSaleData** *string*

Additional information associated with the sale transaction.

**attendanceContext** *enum*

Attendance context of the transaction.

**Possible enum values**

- `ATTD` — "Attended. Transaction performed with a cashier present."
- `SATT` — "SemiAttended. Transaction performed with limited cashier interaction."
- `UATT` — "Unattended. Transaction performed without cashier presence."

**acquireManagerPwd** *string*

Acquirer manager password for transaction verification.

#### Reversal Response

**ReversalResult**

**transactionReference** *string* — Required

Copy from Request.

**transactionType** *enum* — Required

Copy from Request.

**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 **ReversalResult.response = SUCC**, you can obtain additional transaction details (including reference numbers returned by the payment channel) to support your business requirements.

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

**totalAmount** *string* — Required

Total transaction amount.

**transactionDateTime** *timestamp*

Transaction time.
timestamp: A particular point in the progression of time in a calendar year expressed in the yyyyMMddHHmmss format.

**currency** *enum*

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

**accountType** *enum*

Type of cardholder account used for the transaction.

**Possible enum values**

- `CRDT` — "Credit card account."
- `CDBT` — "Debit card account."
- `EBTCS` (U.S. Only) — "Electronic Benefit Transfer (EBT) Cash Sale."
- `EBTCW` (U.S. Only) — "Electronic Benefit Transfer (EBT) Cash Withdrawal"
- `EBTF` (U.S. Only) — "Electronic Benefit Transfer (EBT) Food Stamp."
- `EBTC` (U.S. Only) — "Electronic Benefit Transfer (EBT) Cash Card"

**gratuity** *string*

Gratuity amount.

**authorisationCode** *string*

Outcome of the authorisation, and actions to perform.

**More parameters**

**maskedPAN** *string*

Masked PAN to be printed on payment receipts or displayed to the cardholder.

**cardBrand** *string*

Brand of the card.\
For example: Visa, MasterCard, CUP, JCB, DinersClub, AmericaExpress.

**cashierIdentification** *string*

Identification of the cashier who carried out the transaction.

**invoiceNumber** *string*

Identification of the invoice.

**merchantIdentification** *string*

Unique identification of the merchant.

**merchantIdentificationName** *string*

Name of the merchant.

**poiIdentificationId** *string*

Identification of the POI.\
For example: Terminal ID.

**issuerReferenceData** *string*

Identification of the transaction given by the Issuer.

**poiReconciliationIdentification** *string*

Unique identification of the reconciliation period between the acceptor and the acquirer.\
For example: Batch Number.

**poiTransactionIdentification** *string*

POI identification of the transaction in an unambiguous way.

**printReceipts** *array of dictionaries*

Customer or Merchant payment receipt.

**PrintReceipt** *dictionary*

Various receipts.

**Child attributes** of `PrintReceipt`

**documentQualifier** *enum*

Destination of the message.

**Possible enum values**

- `JNRL` — "When the POI or the Sale System wants to store a message on the journal printer or electronic journal of the Sale Terminal (it is sometimes a Sale Logging/Journal Printer)."
- `CRCP` — "When the Sale System requires the POI system to print the Customer receipt."
- `HRCP` — "When the Sale system prints the Cashier copy of the Payment receipt."
- `MRCP` — "When the Sale System requires the POI system to print the Merchant receipt."
- `RPIN` — "Document is a linked payment instruction to which the current payment instruction is related, for example, in a cover scenario."
- `VCHR` — "Document is an electronic payment document."

**messageContent** *string*

Content or reference of the message.\
Maximum number of characters allowed is 20000.

**additionalSaleData** *string*

Additional information associated with the sale transaction.

```java
ReversalParam param = ReversalParam.newBuilder()
        .transactionReference("00000003")
        .orgTransactionReference("00000001")
        .orgTransactionDateTime(new Date(1711680359167L)) //20240329
        .reversalReason(ReversalReason1Code.CUSC) //Customer cancel
        .build();
RetailerManager.provideFinancialService()
        .newReversalExchange(param)
        .startAsyncExchange(new Exchange.RetailerSDKCallback<ReversalResult>() {
            @Override
            public void onError(int code, String msg) {
                Logger.e(TAG, "reversal failed: " + code + ", " + msg);
            }

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