---
title: Reversal Transaction
description: PayBiz also offers comprehensive reversal transaction functionality for merchants. Below, you’ll find detailed descriptions of the reversal flows provided by PayBiz. Customer provides any one of the Transaction Id, RRN, Merchant Reference Id, and Payment Id (From the response of…
url: "https://docs.logibiztech.com/docs/reversal-transaction/"
updated: "2024-02-06"
category: Tutorials / Merchant Hosted
---

# Reversal Transaction

PayBiz also offers comprehensive reversal transaction functionality for merchants. Below, you’ll find detailed descriptions of the reversal flows provided by PayBiz.

Customer provides any one of the Transaction Id, RRN, Merchant Reference Id, and Payment Id (From the response of successful purchase transaction) along with the Amount, Transaction Portal Id and Password. Once the transaction complete, PG provide the response accordingly.

Merchant displays transaction result to customer. Below is the sample request and response parameters Request URL:

- #### Java
- #### Json

            Copy Code Copied Use a different Browser

```clike
private String request() throws IOException {
URL url = new URL("https://staging.logibiztech.com:8777/transaction/request-payment-url");
        HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
        conn.setRequestMethod("POST");
        conn.setRequestProperty("Authorization",
    "Bearer OGE4Mjk0MTc0YjdlY2IyODAxNGI5Njk5MjIwMDE1Y2N8c3k2S0pzVDg=");
        conn.setDoInput(true);
        conn.setDoOutput(true);
        String data = {
        "tranPortalId": "t2",
        "password": "password",
        "actionCode": 2,
        "amount": "590.2",
        "tranRefType":”TRANSACTION_ID”,
        "tranRefValue": "9231867155 30001"
    }”
        DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
        wr.writeBytes(data);
        wr.flush();
        wr.close();
        int responseCode = conn.getResponseCode();
        InputStream is;
        if (responseCode >= 400) is = conn.getErrorStream();
        else is = conn.getInputStream();
        return IOUtils.toString(is);
}
```

               Copy Code Copied Use a different Browser

```javascript
{
    "tranPortalId": "t2",
    "password": "password",
    "actionCode": 2,
    "amount": "590.2",
    "tranRefType":"TRANSACTION_ID",
    "tranRefValue": "9231867155 30001"
}
```

### Response

#### Success scenario

                      Copy code Copied Use a different Browser

```javascript
{
    "responseMessage": "Payment Successful!",
    "status": "SUCCESS",
    "merchantRefId": "887171",
    "paymentId": "823186729590001",
    "txnTime": "2023-07-05T16:16:03",
    "amount": "234.0",
    "responseCode": null,
    "rrn": "183035212860",
    "originalTxnId": "183035212860",
    "currencyCode": "840",
    "trxnId": null
}
```

#### Failure scenario

                        Copy code Copied Use a different Browser

```javascript
{
    "errorCode": "LOG-300",
    "errorDesc": "Invalid Reversal Amount"
}
```
