Check Refund Status API with PayU ID

API Command: check_action_status

The check_action_status API has another usage too. For a particular PayUID, it returns the status of the following requests:

  • capture
  • refund
  • cancel

To learn more about different payment states, refer to Payment States Explanations.

Environment

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
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=check_action_status&var1=403993715521937565&var2=payuid&hash=81bdb5b8e625f254398d744269844fc6b9d87b3782670331c2a6b856f42f315b9898f397df7292cfd33a6153abf4acac58ce3ac671e41999ff81d98ce432f48e"

Failure scenarios

  • If mihpayid is not found, the response is similar to the following:
{
      "status": 0,
      "msg": "0 out of 1 Transactions Fetched Successfully",
      "transaction_details": {
            "13127842": "No action status found"
      }
}
  • If mihpayid is missing, the response is similar to the following:
{
      "status": 0,
      "msg": "Parameter missing"
}
Sample response

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

{
      "status": 1,
      "msg": "1 out of 1 Transactions Fetched Successfully",
      "transaction_details": {
            "403993715521937565": {
                  "131278418": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "399900",
                        "request_id": "131278418",
                        "amt": "100.00",
                        "mode": "CC",
                        "action": "capture",
                        "token": "",
                        "status": "SUCCESS",
                        "bank_arn": null,
                        "settlement_id": null,
                        "amount_settled": null,
                        "UTR_no": null,
                        "value_date": null,
                        "refund_mode": "-"
                  },
                  "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"
                  },
                  "131278430": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131278430",
                        "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"
                  },
                  "131278458": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131278458",
                        "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"
                  },
                  "131278471": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131278471",
                        "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"
                  },
                  "131278484": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131278484",
                        "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"
                  },
                  "131278499": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131278499",
                        "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"
                  },
                  "131278515": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131278515",
                        "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"
                  },
                  "131287648": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131287648",
                        "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"
                  },
                  "131295795": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131295795",
                        "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"
                  },
                  "131297379": {
                        "mihpayid": "403993715521937565",
                        "bank_ref_num": "527013524405",
                        "request_id": "131297379",
                        "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"
                  }
            }
      }
}
Next Steps
Response parameters

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

Request parameters

Example values

Use the following sample values while trying out the API:

  • var1 (mihpayid): 403993715521937565
  • var2: payuid
Language
Click Try It! to start a request and see the response here!