---
page_source: https://juspay.io/in/docs/payment-method-integrations/hypercheckout/reward-integration/twid-v2
page_title: TWID V2
---


# **Twid_V2 (S2S Rewards) Onboarding and API Specification** 




## **1. Pre-requisites** 




### Step 1 Configuring a new gateway account for Twid_v2 on the Juspay Dashboard


**→** Sandbox Dashboard Url - [https://sandbox.portal.juspay.in](https://sandbox.portal.juspay.in)

→  Production Dashboard Url - [https://portal.juspay.in/](https://portal.juspay.in/)**** 

**•   Select TWID_V2 Gateway** 

**•  Enter Gateway Credentials** 



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Twid_v2-n0g5Z.png)
*All Fields are Mandatory except Resend Otp Wait Time (default Resend OTP time is 15s)*




### Step 2 Payment Method Configuration


Select Twid Rewards from payment Method Configurations



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Twid_PMC-1mo1o.png)
*Payment Method Configuration*




### Step 3 Advanced Features


 In Advanced Features, enable Power Wallet



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Advanced%20Configuration%20%20.png)
*Power Wallet Toggle*




### Step 4 Updating existing gateway account to add Twid_v2 from the Juspay Dashboard


The gateway can be modified for all fields except for Secret Key, which is non-editable.




### Step 5 Enabling 'Rewards' as a Payment Method Type in Studio


Merchant has to enable Rewards as a Payment Method Type if not already done. Not required for merchants using TWID currently




## **2. End-to-end User flow** 




### Step 1.1. Authentication Flow


This is a one-time step for each user for the very first time they try to link their Twid account by logging in to their Twid Account from a merchant’s platform.



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Untitled%20presentation%20(2).png)
*Authentication Flow*




### Step 1.1. Best Reward and Instrument Locking


• Once the user is logged in and if they are eligible for any rewards, the best reward is automatically displayed as the default option in Rewards home page.

• Once the user selects a reward, only the Payment Instruments which are eligible for that specific reward will be displayed while rest of them will be filtered out



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Untitled%20presentation%20(3).png)
*More Rewards and Instrument Locking*




### Step 1.1. More Rewards & Voucher Selection


• The user may choose to select another reward from the list of rewards that they are eligible for by clicking on ‘View All Rewards’.

• And the user may also apply a voucher from amongst the list of vouchers that they are eligible for on top of the selected reward.

• However, the voucher cannot be applied without selecting a Reward. While they can pay using a Reward alone without clubbing it with a Voucher.



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Untitled%20presentation%20(5).png)
*More Rewards and Voucher Selection*




### Step 1.1. Split Payment & Transaction


The total order amount will be split into two transactions one for the Reward (and Voucher if applied) and one more for the secondary transaction based on the other payment instrument selected.



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Untitled%20presentation%20(7).png)
*Split Payment and Transaction*




### Step 1.1. Note


* Once a phone number is used to link with _Twid Rewards_  on a merchant platform, it will remain linked forever with that user account for that merchant.
* If the authentication failed or if the entered OTP is incorrect, a user can re-attempt to get a new OTP not more than 5 times in the span of every 30 minutes.
* A _Twid Voucher_  can be applied only if the user selects one of the _Twid Rewards_  that the user is eligible for.
* A user can select a maximum of one _Twid Reward_ and a maximum of one Twid Voucher per Order.




## **3. Handling Eligibility Failure Cases** 




### Ineligible Case Unable to find Rewards for you 


It looks like you cannot use Rewards at this time, please try again later 




### Authentication Failed Incorrect OTP


Entered OTP is incorrect, please retry.




### Authentication Attempts Exhausted Retry OTP attempts exhausted


OTP retry attempts are exhausted. Please try again after 30 minutes.




## **4. Sample Requests and Responses** 



With the existing implementation on Juspay , the transaction level details are available in the root structure of the orderStatus JSON block.With Integration TWID_v2 and being a split transactions , you would get **txn_list**  as an array block in which the 2 transactions (UPI + TWID). You need to make sure to consume the params from inside the **txn_list**  array block.

Also, There will be a new status called as **AUTO_REFUNDED**  case, in which your primary transaction fails, Juspay will auto-refund the TWID_v2 reward balance. 


### **Order Status** 




### Step 1.1. Request


Order status request




#### Shell Code Snippet:

```shell
curl --location 'https://api.juspay.in/ecr/orders/<orderId> \
--header 'Authorization: Basic Auth'
--header 'Version: 2024-01-01'
```



### Step 1.1. Response


Order status response




#### Shell Code Snippet:

```shell
{
  "customer_email": "krishna.gprasad@juspay.in",
  "customer_phone": "7093125824",
  "customer_id": "cth_gdSPLGw37EgtJBXw",
  "status_id": 21,
  "status": "CHARGED",
  "id": "ordeh_fe7a2de881b14549bc550adaaab8b6c1",
  "merchant_id": "azhar_test",
  "amount": 1000,
  "currency": "INR",
  "order_id": "HD-1699336785",
  "date_created": "2023-11-07T05:59:45Z",
  "return_url": "http://www.google.com/",
  "product_id": "1",
  "payment_links": {
    "iframe": "https://sandbox.juspay.in/r/QhtogV",
    "web": "https://sandbox.juspay.in/r/g1RmIJ",
    "mobile": "https://sandbox.juspay.in/r/fET7GM"
  },
  "udf1": "",
  "udf2": "",
  "udf3": "",
  "udf4": "",
  "udf5": "",
  "udf6": "",
  "udf7": "",
  "udf8": "",
  "udf9": "",
  "udf10": "",
  "refunded": false,
  "amount_refunded": 0,
  "effective_amount": 1000,
  "txn_list": [
    {
      "txn_id": "azhar_test-HD-1699336785-1-1",
      "payment_method_type": "UPI",
      "auth_type": "",
      "payment_method": "UPI",
      "refunded": true,
      "amount_refunded": 998,
      "effective_amount": 998,
      "refunds": [
        {
          "id": "refund1699336957",
          "amount": 998,
          "unique_request_id": "refund1699336957",
          "ref": "refund_1319199494",
          "created": "2023-11-07T06:02:37Z",
          "status": "SUCCESS",
          "error_message": "MERCHANT_INITIATED",
          "sent_to_gateway": true,
          "arn": "Test_ARN",
          "expected_refund_credit_time": "2023-11-18T07:00:00Z",
          "initiated_by": "API",
          "refund_source": "GOCASHFREE",
          "refund_type": "STANDARD",
          "pg_processed_at": "2023-11-07T06:04:33Z",
          "bank_processed_at": "2023-11-07T06:04:33Z",
          "error_code": "SUCCESS"
        }
      ],
      "resp_code": null,
      "resp_message": null,
      "bank_error_code": "",
      "bank_error_message": "",
      "txn_uuid": "mozsTQdwb1L6pQymAgD",
      "txn_detail": {
        "txn_id": "azhar_test-HD-1699336785-1-1",
        "order_id": "HD-1699336785",
        "status": "CHARGED",
        "error_code": null,
        "net_amount": 1000,
        "surcharge_amount": 0,
        "tax_amount": 0,
        "txn_amount": 998,
        "offer_deduction_amount": null,
        "gateway_id": 70,
        "currency": "INR",
        "express_checkout": false,
        "redirect": true,
        "txn_uuid": "mozsTQdwb1L6pQymAgD",
        "gateway": "GOCASHFREE",
        "error_message": "",
        "created": "2023-11-07T06:00:24Z",
        "txn_flow_type": "COLLECT"
      },
      "payment_gateway_response": {
        "resp_code": "SUCCESS",
        "rrn": "1234567890",
        "created": "2023-11-07T06:00:25Z",
        "epg_txn_id": "2150281800",
        "resp_message": "Simulated response message",
        "auth_id_code": "NA",
        "txn_id": "azhar_test-HD-1699336785-1-1"
      },
      "gateway_id": 70,
      "gateway_reference_id": "twid-s2s",
      "payer_vpa": "testsuccess@gocash",
      "upi": {
        "payer_vpa": "testsuccess@gocash",
        "txn_flow_type": "COLLECT"
      },
      "metadata": {
        "payment_links": {
          "iframe": "https://sandbox.juspay.in/r/QhtogV",
          "web": "https://sandbox.juspay.in/r/g1RmIJ",
          "mobile": "https://sandbox.juspay.in/r/fET7GM"
        },
        "payment_page_client_id": "change",
        "JUSPAY:gateway_reference_id": "twid-s2s"
      },
      "offers": [],
      "status": "CHARGED"
    },
    {
      "txn_id": "azhar_test-HD-1699336785-1-2",
      "payment_method_type": "REWARD",
      "auth_type": "",
      "payment_method": "TWID",
      "refunded": true,
      "amount_refunded": 998,
      "effective_amount": 2,
      "refunds": [
        {
          "id": null,
          "amount": 2,
          "unique_request_id": "refund1699336957-1",
          "ref": "RF-2558",
          "created": "2023-11-07T06:02:37Z",
          "status": "SUCCESS",
          "error_message": "Transaction Cancelled Successfully",
          "sent_to_gateway": true,
          "expected_refund_credit_time": "2023-11-18T07:00:00Z",
          "initiated_by": "API",
          "refund_source": "TWID_V2",
          "refund_type": "STANDARD",
          "metadata": {
            "refund_pg_amount": null,
            "refund_points_amount": null,
            "refund_total_amount": null
          },
          "error_code": null
        }
      ],
      "resp_code": null,
      "resp_message": null,
      "bank_error_code": "",
      "bank_error_message": "",
      "txn_uuid": "mozmNoLkQJLeMvvVTZS",
      "txn_detail": {
        "txn_id": "azhar_test-HD-1699336785-1-2",
        "order_id": "HD-1699336785",
        "status": "CHARGED",
        "error_code": null,
        "net_amount": 1000,
        "surcharge_amount": 0,
        "tax_amount": 0,
        "txn_amount": 2,
        "offer_deduction_amount": null,
        "gateway_id": 92,
        "currency": "INR",
        "express_checkout": false,
        "redirect": false,
        "txn_uuid": "mozmNoLkQJLeMvvVTZS",
        "gateway": "TWID_V2",
        "error_message": "",
        "created": "2023-11-07T06:00:16Z",
        "txn_flow_type": "DIRECT_DEBIT"
      },
      "payment_gateway_response": {
        "resp_code": "True",
        "rrn": null,
        "created": "2023-11-07T06:00:24Z",
        "epg_txn_id": null,
        "resp_message": "success",
        "auth_id_code": null,
        "txn_id": "azhar_test-HD-1699336785-1-2"
      },
      "gateway_id": 92,
      "gateway_reference_id": "twid-s2s",
      "metadata": {
        "payment_links": {
          "iframe": "https://sandbox.juspay.in/r/QhtogV",
          "web": "https://sandbox.juspay.in/r/g1RmIJ",
          "mobile": "https://sandbox.juspay.in/r/fET7GM"
        },
        "payment_page_client_id": "change",
        "JUSPAY:gateway_reference_id": "twid-s2s"
      },
      "offers": [],
      "status": "CHARGED"
    }
  ]
}
```



### Sample Webhook Response



Please find the sample webhook response. 


#### Webhook ORDER_SUCCEEDED Code Snippet:

```webhook order_succeeded
{
  "event_name": "ORDER_SUCCEEDED",
  "content": {
    "order": {
      "txn_list": [
        {
          "payer_app_name": "upi://pay",
          "payer_vpa": "FILTERED",
          "payment_method": "UPI",
          "payment_gateway_response": {
            "network_error_message": null,
            "txn_id": "test-kCu4JuZixrGmcqu4-1-1",
            "rrn": "413481094441",
            "debit_amount": "500.0",
            "auth_id_code": "",
            "resp_message": "",
            "epg_txn_id": "pay_O9pGYiofwswtLf",
            "resp_code": "captured",
            "created": "2024-05-13T03:14:52Z",
            "network_error_code": null
          },
          "txn_id": "test-kCu4JuZixrGmcqu4-1-1",
          "gateway_reference_id": null,
          "txn_detail": {
            "txn_id": "test-kCu4JuZixrGmcqu4-1-1",
            "order_id": "kCu4JuZixrGmcqu4",
            "error_code": null,
            "txn_flow_type": "INTENT",
            "status": "CHARGED",
            "express_checkout": false,
            "gateway_id": 23,
            "error_message": "",
            "offer_deduction_amount": null,
            "tax_amount": null,
            "currency": "INR",
            "txn_amount": 500,
            "created": "2024-05-13T03:14:40Z",
            "gateway": "RAZORPAY",
            "surcharge_amount": null,
            "txn_uuid": "mozvSYwDrhbSQiFLeyE",
            "net_amount": 500,
            "redirect": true,
            "metadata": {
              "payment_channel": "ANDROID"
            }
          },
          "status": "CHARGED",
          "offers": [],
          "resp_message": null,
          "refunded": false,
          "gateway_id": 23,
          "effective_amount": 500,
          "auth_type": "",
          "resp_code": null,
          "upi": {
            "payer_vpa": "FILTERED",
            "txn_flow_type": "INTENT",
            "payer_app": "FILTERED"
          },
          "payment_method_type": "UPI",
          "txn_uuid": "mozvSYwDrhbSQiFLeyE",
          "resp_category": null,
          "bank_error_code": "",
          "metadata": {
            "webhook_url": "FILTERED",
            "payment_page_client_id": "test",
            "payment_links": {
              "mobile": "FILTERED",
              "web": "https://api.juspay.in/orders/ordeh_0cd90c68700347dcaf667394245bce83/payment-page",
              "iframe": "https://api.juspay.in/orders/ordeh_0cd90c68700347dcaf667394245bce83/payment-page"
            }
          },
          "bank_error_message": ""
        },
        {
          "payment_method": "TWID",
          "payment_gateway_response": {
            "network_error_message": null,
            "txn_id": "test-kCu4JuZixrGmcqu4-1-2",
            "rrn": null,
            "auth_id_code": null,
            "resp_message": "success",
            "epg_txn_id": "20522801",
            "resp_code": "True",
            "created": "2024-05-13T03:14:53Z",
            "network_error_code": null
          },
          "txn_id": "test-kCu4JuZixrGmcqu4-1-2",
          "gateway_reference_id": null,
          "txn_detail": {
            "txn_id": "test-kCu4JuZixrGmcqu4-1-2",
            "order_id": "kCu4JuZixrGmcqu4",
            "error_code": null,
            "txn_flow_type": "DIRECT_DEBIT",
            "status": "CHARGED",
            "express_checkout": false,
            "gateway_id": 92,
            "error_message": "",
            "offer_deduction_amount": null,
            "tax_amount": null,
            "currency": "INR",
            "txn_amount": 0,
            "created": "2024-05-13T03:14:40Z",
            "gateway": "TWID_V2",
            "surcharge_amount": null,
            "txn_uuid": "mozeD7Vn1qB2Bx7wMNZ",
            "net_amount": 500,
            "redirect": false
          },
          "status": "CHARGED",
          "offers": [],
          "resp_message": null,
          "refunded": false,
          "gateway_id": 92,
          "effective_amount": 0,
          "auth_type": "",
          "resp_code": null,
          "payment_method_type": "REWARD",
          "txn_uuid": "mozeD7Vn1qB2Bx7wMNZ",
          "resp_category": null,
          "bank_error_code": "",
          "metadata": {
            "webhook_url": "FILTERED",
            "payment_page_client_id": "test",
            "payment_links": {
              "mobile": "FILTERED",
              "web": "https://api.juspay.in/orders/ordeh_0cdjsjdsfjdsfdscaf667394245bce83/payment-page",
              "iframe": "https://api.juspay.in/orders/ordeh_0cd9dskfjadsfjdsjf7394245bce83/payment-page"
            }
          },
          "bank_error_message": ""
        }
      ],
      "customer_phone": "FILTERED",
      "udf8": "106.195.10.83",
      "order_id": "kCu4JuZixrGmcqu4",
      "udf9": "5",
      "customer_id": "d6383df1ee4009ff77827e3ca8d12716",
      "amount": 500,
      "udf4": "NA",
      "status": "CHARGED",
      "udf5": "false",
      "udf6": "APS",
      "status_id": 21,
      "udf7": "Maharashtra",
      "product_id": "",
      "refunded": false,
      "udf10": "premium",
      "udf1": "",
      "udf2": "",
      "udf3": "",
      "date_created": "2024-05-13T03:14:39Z",
      "id": "ordeh_0cd90c68700347dcaf667394245bce83",
      "merchant_id": "test",
      "return_url": "https://www.a23.com/",
      "effective_amount": 500,
      "currency": "INR",
      "customer_email": "1111111",
      "payment_links": {
        "mobile": "FILTERED",
        "web": "https://api.juspay.in/orders/ordeh_0cd90c68700sdfdsfdsf347dcaf667394245bce83/payment-page",
        "iframe": "https://api.juspay.in/orders/ordeh_0cd90c6870sdfdsfds347dcaf667394245bce83/payment-page"
      },
      "amount_refunded": 0
    }
  },
  "date_created": "2024-05-13T03:14:53Z",
  "id": "evt_V2_80b168f48c894962998e058dc7400caf"
}

```


## FAQs:

### Will i get txn_list for all the existing payment methods ? 

No, Only for the split payments via TWID_v2 you will receive the order status with txn_list. For all other payment methods, which has only Cards or Netbanking, You will not get txn_list. 

### Why should i incorporate a new status "AUTO_REFUNDED" ?  

There are cases in which the primary card, UPI or Netbanking transaction fails and TWID payment would be successful. In order to handle these cases, Juspay will refund the TWID payment. Hence it is necessary to handle the AUTO_REFUNDED status. 

### Why should i update my order Status version to 2024-01-01? 

The updating of orderStatus version becomes necessary in order to obtain the  AUTO_REFUNDED status. 

### Will my webhooks also change ? 

Yes, As the orderStatus is changing the structure webhooks will also change. 

### How does Juspay handle primary transaction pending status ? 

Juspay will sync the pending transaction based on the sync frequency. We would suggest merchant to show a Pending screen for the time being. 




### **Refund Calls** 



1. Refund requests (full/partial) can be initiated by a Juspay’s merchant at Transaction level or at Order level.
2. Given that Twid V2 transactions are always split between an existing Gateway and Twid rewards, the merchant can choose between one of the two provisions -
3. For Order based refunds, 
   
         a. merchant will have to pass order Id & refund amount to Juspay
   
         b. each order would have a minimum of 2 transactions and Juspay internally                  handles the split refund initiation (full and partial), to both Twid and other                  configured gateway
   
         c. Juspay will ensure checks for eligible refund amount, split calculation etc
   
         d. Merchant will receive Juspay’s refund response accordingly (post PG                         processing) and is expected to handle the same (new key                                            “**split_refund_details** ”)
4. For Transaction based refunds
   
         a. merchant would initiate refunds against all transaction Ids, with transaction Id           and amount to Juspay
   
         b. mechant will ensure the amount checks and the refund split for both full and             partial refunds. This refund split will include an additional API call to Twid.                  Alternatively, split can also be calculated by first exhausting the gateway                   amount and then Twid amount (merchant to confirm with Twid).
   
         c. Juspay’s refund response will remain the same as what merchants currently              see for transaction based refunds. No additional handling required.


### Step 1.1. Request


Transaction based refund request




#### Shell Code Snippet:

```shell
curl --location 'https://api.juspay.in/orders/txns/<txnId>/refunds' \
--header 'Accept: application/json' \
--header 'version: 2022-03-16' \
--header 'x-merchantid:<merchantId>' \
--header 'Authorization: Basic Auth' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'unique_request_id=req-1695671557' \
--data-urlencode 'amount=998'
```



### Step 1.1. Response


Transaction based refund response




#### Shell Code Snippet:

```shell
{
  "order_id": "HD-1695671905",
  "udf3": "",
  "status": "CHARGED",
  "amount": 1,
  "auth_type": null,
  "refunded": true,
  "udf8": "",
  "udf5": "",
  "payment_method": "TWID",
  "gateway_id": 92,
  "refunds": [
    {
      "status": "SUCCESS",
      "amount": 1,
      "sent_to_gateway": true,
      "unique_request_id": "req-1695672056",
      "error_code": "SUCCESS",
      "created": "2023-09-25T20:00:56Z",
      "pg_processed_at": "2023-09-25T20:00:58Z",
      "initiated_by": "API",
      "refund_source": "TWID_V2",
      "error_message": "SUCCESS",
      "expected_refund_credit_time": "2023-10-06T21:00:00Z",
      "id": "req-1695672056",
      "refund_type": "STANDARD",
      "ref": "rfnd_Mgh0hfnQ0wXUq9"
    }
  ],
  "udf2": "",
  "payment_method_type": "REWARD",
  "txn_uuid": "mozgWyfcrtp51rTvymk",
  "udf4": "",
  "customer_id": "cth_7CphvPFq1Rn61Ep7",
  "udf10": "",
  "bank_pg": null,
  "payment_links": {
    "iframe": "https://sandbox.juspay.in/orders/ordeh_aed3f84d9cb448248afc01505f940db9/payment-page",
    "web": "https://sandbox.juspay.in/orders/ordeh_aed3f84d9cb448248afc01505f940db9/payment-page",
    "mobile": "https://sandbox.juspay.in/orders/ordeh_aed3f84d9cb448248afc01505f940db9/payment-page"
  },
  "effective_amount": 2.02,
  "udf1": "",
  "payment_gateway_response": {
    "debit_amount": "2.02",
    "auth_id_code": "130203",
    "created": "2023-09-25T19:59:05Z",
    "rrn": "130203",
    "epg_txn_id": "pay_MggyRECLynoUet",
    "txn_id": "azhar_test-HD-1695671905-2",
    "resp_message": "SUCCESS",
    "resp_code": "SUCCESS"
  },
  "product_id": "1",
  "txn_detail": {
    "order_id": "HD-1695671905",
    "status": "CHARGED",
    "net_amount": 1,
    "error_code": "",
    "gateway_id": 23,
    "surcharge_amount": 1.02,
    "txn_uuid": "mozgWyfcrtp51rTvymk",
    "gateway": "TWID_V2",
    "created": "2023-09-25T19:58:42Z",
    "tax_amount": 0,
    "txn_amount": 2.02,
    "error_message": "",
    "currency": "INR",
    "redirect": false,
    "express_checkout": false,
    "txn_id": "azhar_test-HD-1695671905-2",
    "txn_flow_type": "DIRECT_DEBIT"
  },
  "amount_refunded": 1,
  "customer_email": "krishna.gprasad@juspay.in",
  "currency": "INR",
  "customer_phone": "7093125824",
  "metadata": {
    "payment_links": {
      "iframe": "https://sandbox.juspay.in/orders/ordeh_aed3f84d9cb448248afc01505f940db9/payment-page",
      "web": "https://sandbox.juspay.in/orders/ordeh_aed3f84d9cb448248afc01505f940db9/payment-page",
      "mobile": "https://sandbox.juspay.in/orders/ordeh_aed3f84d9cb448248afc01505f940db9/payment-page"
    },
    "payment_page_client_id": "change",
    "TWID_V2:gateway_reference_id": "twid_test"
  },
  "bank_error_message": "",
  "id": "ordeh_aed3f84d9cb448248afc01505f940db9",
  "txn_id": "azhar_test-HD-1695671905-2",
  "merchant_id": "azhar_test",
  "maximum_eligible_refund_amount": 0,
  "udf7": "",
  "date_created": "2023-09-25T19:58:25Z",
  "bank_error_code": "",
  "offers": [],
  "udf9": "",
  "gateway_reference_id": "twid_test",
  "return_url": "https://sandbox.juspay.in/r/dXNj1v",
  "status_id": 21,
  "rewards_breakup": null,
  "udf6": ""
}

```



### Step 1.1. Request


Order based refund request




#### Shell Code Snippet:

```shell
curl --location 'https://sandbox.juspay.in/orders/{order_id}/refunds' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic ***' \
--data-urlencode 'unique_request_id=URI_1696429607' \
--data-urlencode 'amount=950' \
--data-urlencode 'direct_refund_response=true'
```



### Step 1.1. Response


Order based refund response




#### Shell Code Snippet:

```shell
{
  "order_id": "HD-1682603668",
  "status": "SUCCESS",
  "amount": 950,
  "sent_to_gateway": false,
  "unique_request_id": "URI_1696428914",
  "gateway": "PAYU",
  "created": "2023-10-04T14:15:15Z",
  "initiated_by": "API",
  "split_refund_details": [
    {
      "status": "SUCCESS",
      "amount": 750,
      "sent_to_gateway": false,
      "unique_request_id": "URI_1696428914",
      "gateway": "PAYU",
      "refund_source": "PAYU",
      "txn_id": "azharamin-HD-1682603668-1-1",
      "refund_type": "STANDARD",
      "epg_txn_id": null,
      "refund_arn": null,
      "authorization_id": null,
      "reference_id": null
    },
    {
      "status": "SUCCESS",
      "amount": 200,
      "sent_to_gateway": false,
      "unique_request_id": "URI_1696428914-1",
      "gateway": "TWID_V2",
      "refund_source": "TWID_V2",
      "txn_id": "azharamin-HD-1682603668-1-2",
      "refund_type": "STANDARD",
      "epg_txn_id": null,
      "refund_arn": null,
      "authorization_id": null,
      "reference_id": null
    }
  ],
  "refund_source": "PAYU",
  "refund_arn": null,
  "error_message": null,
  "epg_txn_id": null,
  "txn_id": "azharamin-HD-1682603668-1-2",
  "authorization_id": null,
  "reference_id": null,
  "response_code": null,
  "refund_type": "STANDARD"
}

```



## **5. FAQs** 




### Step 1.1. 1. How can payment page merchants avail new TWID flow ?


Update to package version 2.89 or above.




### Step 1.1. 2. How do merchants transition smoothly from TWID redirection flow (referred as V1) to the S2S flow (referred as V1) ?


<p></p>




| Client's Frontend Version (New = Package 2.89 and above) | Merchant configured TWID Gateway (v1/v2) | Eligibility Resp from Juspay Backend | User Experience |
|---|---|---|---|
| Old | V1 | V1 | Redirected to TWID page for payment |
| Old | V2 | No Response | TWID will not be shown |
| Old | V1 & V2 | V1 | Redirected to TWID page for payment |
| New | V1 | V1 | Redirected to TWID page for payment |
| New | V2 | V2 | User will do split transaction |
| New | V1 & V2 | V2 | User will do split transaction |



## 6. Testing Scenarios 



For the final step towards completing your TWID Integration, Kindly perform the below mentioned test cases 


| Test Scenario | Test Scenario Description |
|---|---|
| Order Status | Handling of the Order Status response with txn_list block |
| Payment Methods Testing | Kindly test for all the scenarios of Each payment methods giving Success, Pending and Failure cases.  |
| TWID + Cards | Kindly test for all the scenarios of Each payment methods giving Success, Pending and Failure cases. |
| TWID + NB | Kindly test for all the scenarios of Each payment methods giving Success, Pending and Failure cases. |
| TWID + UPI | Kindly test for all the scenarios of Each payment methods giving Success, Pending and Failure cases. |
| TWID + Wallet | Kindly test for all the scenarios of Each payment methods giving Success, Pending and Failure cases. |
| TWID + Saved Payment Methods | Kindly test for all the scenarios of Each payment methods giving Success, Pending and Failure cases. |
| Refunds | Based on your use case, Initate OrderID or TxnID based refunds |
| Payment Response Handling | Appropriate messaging to user in Success, Failure, Pending Transaction cases |
