Get All Refunds from Transaction IDs

API Command: getAllRefundsFromTxnIds

The Get All Refunds for a Transaction ID API (getAllRefundsFromTxnIds) command is used to retrieve the status of all the refund requests fired for a particular Transaction ID. The output of this API provides the request ID, and the PG used the status of a refund request and the creation of refund date information.

Environment

Sample request
curl -X POST "https://test.payu.in/merchant/postservice?form=2
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d

"key=JP***g&command=getAllRefundsFromTxnIds&var1=db97dd56eff7296e5061&hash=69543c08018121cc882d2f8b1761567367c1806becde3db7f54ab552362677cc08d8dfa4b9411e234e4876e6aba80c05a32e75ed499aff458c7f6027bf4ef2a8"
Sample response

Success Scenario

On successful processing from PayU, the response is similar to the following:

{
      "status": 1,
      "msg": "Refunds fetched successfully.",
      "Refund Details": {
            "403993715521937565": [
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131278422",
                        "RefundToken": "RefundToken1",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-05 01:23:19",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2020-11-05 01:24:04"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131278430",
                        "RefundToken": "RefundToken2",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-05 01:29:13",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2020-11-05 01:30:08"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131278458",
                        "RefundToken": "RefundToken3",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-05 01:47:36",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2020-11-05 01:49:04"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131278471",
                        "RefundToken": "RefundToken4",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-05 01:53:28",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2020-11-05 01:55:05"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131278484",
                        "RefundToken": "RefundToken5",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-05 01:58:32",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2020-11-05 02:00:09"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131278499",
                        "RefundToken": "RefundToken6",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-05 02:05:42",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2020-11-05 02:07:04"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131278515",
                        "RefundToken": "RefundToken7",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-05 02:15:11",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2020-11-05 02:16:03"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131287648",
                        "RefundToken": "RefundToken8",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-06 19:21:32",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2021-01-28 10:25:17"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131295795",
                        "RefundToken": "RefundToken9",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-09 18:59:45",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2021-02-10 01:01:14"
                  },
                  {
                        "PayuID": "403993715521937565",
                        "RequestID": "131297379",
                        "RefundToken": "RefundToken10",
                        "PaymentGateway": "AXISPG",
                        "Amount": "10.00",
                        "Status": "success",
                        "RefundCreationDate": "2020-11-10 09:39:33",
                        "bank_ref_no": "527013524405",
                        "bank_arn": null,
                        "success_at": "2021-02-01 15:50:25"
                  }
            ]
      }
}

Failure scenario

If no refunds found for the transaction:

{
      "status": 1,
      "msg": "No Refunds Found for the transaction."
}
Response parameters description
ParameterDescriptionExample
statusThe status of the response can be any of the following:

- 1: Success
- 2: Failure
1
msgThe description of the response whether the card details were stored successfully or not.Refunds fetched successfully.
Refund DetailsThe details are sent by PayU in JSON format for the successful response. For more information, refer to Additional Info for General APIs.

Request parameters

Reference information for request parameters
ParameterReference
keyFor more information on how to generate the Key and Salt, refer to any of the following:

- Production: Generate Merchant Key and Salt

- Test: Generate Test Merchant Key and Salt
hashHash logic for this API is:
sha512(key|command|var1|salt)
sha512

Example values

Use the following sample values while trying out the API:

  • var1 (txnid): db97dd56eff7296e5061
Language
Click Try It! to start a request and see the response here!