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
Environment | URL |
---|---|
Test Environment | https://test.payu.in/merchant/postservice.php?form=2 |
Production Environment | https://info.payu.in/merchant/postservice.php?form=2 |
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
Parameter | Description |
---|---|
status | Indicates the success (1) or failure (0) of the API call |
msg | Descriptive message about the API response status |
transaction_details | JSON object containing the transaction details for the requested action |
mihpayid | Unique reference number created for each transaction at PayU's end |
bank_ref_num | Bank reference number generated by the bank for the transaction |
request_id | The Request ID returned when cancel_refund_transaction API was executed |
amt | Amount of the transaction |
mode | Payment method used for the transaction (CC for Credit Card, DC for Debit Card, etc.) |
action | Type of action performed (e.g., "refund") |
token | Security token associated with the transaction |
status | Current status of the action/transaction |
bank_arn | Bank Acquirer Reference Number (if available) |
settlement_id | Settlement identifier (if available) |
amount_settled | Amount that has been settled (if available) |
UTR_no | Unique Transaction Reference number (if available) |
value_date | Value date of the transaction (if available) |
refund_mode | Mode 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 PayUhash
- Hash value for security validationcommand
- Set to "check_action_status_txnid" for this APIvar1
- 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:
- This API is used to check the status of refund/cancellation requests
- The Request ID must be obtained from a previously executed cancel_refund_transaction API call
- The API returns detailed transaction information including current status and settlement details
- Error code 102 should be treated as success - all other error codes indicate failure