Check Refund Status API with Request ID

API Command: check_action_status

Whenever the cancel_refund_transaction API is executed successfully to cancel a transaction, a Request ID is returned in the output parameters for that particular request. For more information on the cancel_refund_transaction API, refer to Refund Transaction.

In check_action_status API, you need to input this Request ID to get the current status of the request. The return parameters are MIHPayID, Amount, Discount, Mode, and Status of transaction. The following are different payment states:

Refund states

Environment

Sample request
curl --location --request POST 'https://test.info.payu.in/merchant/postservice.php?form=2' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'key=JF****g&hash=9f5faabedb7f5d41f519db3a223cf5318ecc0b7e669f49e0a699d4c4879e1ccaed5b99f5cd8be4f2cbddefe5272ec983abd8f38480d9c2609a29447f750a3158&command=check_action_status_txnid&var1=7043873219'

Example Values:

  • var1 (request_id): 131278422
Sample response

Success Scenario

If successfully fetched:

{
  "status": 1,
  "msg": "1 out of 1 Transactions Fetched Successfully",
  "transaction_details": {
    "131278422": {
      "131278422": {
        "mihpayid": "403993715521937565",
        "bank_ref_num": "527013524405",
        "request_id": "131278422",
        "amt": "10.00",
        "mode": "CC",
        "action": "refund",
        "token": "20201105secrettokenatur",
        "status": "success",
        "bank_arn": null,
        "settlement_id": null,
        "amount_settled": null,
        "UTR_no": null,
        "value_date": null,
        "refund_mode": "Back to Source"
      }
    }
  }
}

Failure Scenarios

If mihpayid is not found:

{
  "status": 0,
  "msg": "0 out of 1 Transactions Fetched Successfully",
  "transaction_details": {
    "13127842": "No action status found"
  }
}

If mihpayid is missing:

{
  "status": 0,
  "msg": "Parameter missing"
}
Response parameters
ParameterDescription
statusIndicates the success (1) or failure (0) of the API call
msgDescriptive message about the API response status
transaction_detailsJSON object containing the transaction details for the requested action
mihpayidUnique reference number created for each transaction at PayU's end
bank_ref_numBank reference number generated by the bank for the transaction
request_idThe Request ID returned when cancel_refund_transaction API was executed
amtAmount of the transaction
modePayment method used for the transaction (CC for Credit Card, DC for Debit Card, etc.)
actionType of action performed (e.g., "refund")
tokenSecurity token associated with the transaction
statusCurrent status of the action/transaction
bank_arnBank Acquirer Reference Number (if available)
settlement_idSettlement identifier (if available)
amount_settledAmount that has been settled (if available)
UTR_noUnique Transaction Reference number (if available)
value_dateValue date of the transaction (if available)
refund_modeMode of refund processing (e.g., "Back to Source")

The transaction_details parameter of the response is in JSON format. For more information, refer to Additional Info for General APIs.

📘

Note:

The error_code value 102 should be treated as a success; the rest are failures. For the list of error codes, refer to Error Codes for Refund Initiation.

Request parameters

Additional information for request parameters

Request Parameters

Required Parameters:

  • key - Merchant key provided by PayU
  • hash - Hash value for security validation
  • command - Set to "check_action_status_txnid" for this API
  • var1 - The Request ID returned from cancel_refund_transaction API

Example Values: Use the following sample values while trying out the API:

  • var1 (request_id): 131278422

Hash Calculation: The hash should be calculated using the appropriate algorithm as specified in the PayU documentation for general APIs.

Important Notes:

  1. This API is used to check the status of refund/cancellation requests
  2. The Request ID must be obtained from a previously executed cancel_refund_transaction API call
  3. The API returns detailed transaction information including current status and settlement details
  4. Error code 102 should be treated as success - all other error codes indicate failure
Language
Click Try It! to start a request and see the response here!