1. Home
  2. Docs
  3. Developers Guide
  4. Integration APIs
  5. Verify APIs

Verify APIs

  • This web-service is used to reconcile the transaction with PayU. When we post back the final response to you (merchant)
  • We provide a list of parameters (including the status of the transaction – For example, success, failed etc).
  • On a few occasions, the transaction response is initiated from our end, but it doesn’t reach you due to network issues or user activity (like refreshing the browser etc).

There are two types of Verify API , where request can be made with different parameters

A. verify_payment

This API gives you the status of the transaction.We recommend that this API is used to reconcile with PayU’s database once you receive the response, var1 is your transaction id.

B. check_payment

This API gives you the status of the transaction similar to verify_payment API. The only difference is that the input parameter in this API (i.e. var1) is the PayUID (MihpayID) generated at PayU’s end whereas the input parameter in verify_payment API is the TxnID (Transaction ID generated at your end).

Use Cases

  • This API is helpful to tackle such cases – where you can execute it to get the status of the transaction. Since you already have the txnID (Order ID generated at your end) value for such cases
  • Execute the verify_payment API with the necessary input parameters. The output would return you the transaction status and various other parameters also.
  • Another usage of this API is to provide an additional layer of verification of the transaction (in addition to checksum). You can verify the status and other parameters received in the post response via this API.
  • We strongly recommend that this API is used to reconcile with PayU’s database once you receive the response. This will protect you from any tampering by the user and help in ensuring a safe and secure transaction experience.

The return parameters are MIHPayID, Amount, Discount, Mode, and Status of transaction.

A. verify_payment

Input Variable

ParameterDescriptionValue
keyMerchant key provided by PayU. Please refer to the first entry in the Post Parameters table for detailed description of this parameter JPTXg
command This parameter must have name of the web-service. verify_payment
var1 In this parameter, you can put all the txnid(Your transaction ID/order ID) values in a pipe-separated form. 100123|100124|100125|100126
hashThis parameter must contain the hash value to be calculated at your end. The string used for calculating the hash is mentioned below:
sha512(key|command|var1|salt)
sha512 is the encryption method used here
c24ee06c7cf40314ede424
b1fcc2b97a12f97a7d3dd2
06876eef16660eb09fd374
fd82861f66d8152e72d1c9
e3ee37fc691d47d6a38750
2872b03c7338a50880

Resuest Body

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=verify_payment&var1=7fa6c4783a363b3da573&hash=c24ee06c7cf40314ede424b1fcc2b97a12f97a7d3dd206876eef16660eb09fd374fd82861f66d8152e72d1c9e3ee37fc691d47d6a387502872b03c7338a50880"

Response Body

  • If successfully fetched
{
      "status": 1,
      "msg": "1 out of 1 Transactions Fetched Successfully",
      "transaction_details": {
            "7fa6c4783a363b3da573": {
                  "mihpayid": "403993715521889530",
                  "request_id": "",
                  "bank_ref_num": "721522",
                  "amt": "10.00",
                  "transaction_amount": "10.00",
                  "txnid": "7fa6c4783a363b3da573",
                  "additional_charges": "0.00",
                  "productinfo": "Test",
                  "firstname": "K",
                  "bankcode": "CC",
                  "udf1": "",
                  "udf3": "",
                  "udf4": "",
                  "udf5": "",
                  "field2": "177047",
                  "field9": "No Error",
                  "error_code": "E000",
                  "addedon": "2020-10-26 14:12:13",
                  "payment_source": "payu",
                  "card_type": "MAST",
                  "error_Message": "NO ERROR",
                  "net_amount_debit": 10,
                  "disc": "0.00",
                  "mode": "CC",
                  "PG_TYPE": "CC-PG",
                  "card_no": "512345XXXXXX2346",
                  "name_on_card": "Test",
                  "udf2": "",
                  "field5": "211939174867",
                  "field7": "AUTHPOSITIVE",
                  "status": "success",
                  "unmappedstatus": "captured",
                  "Merchant_UTR": null,
                  "Settled_At": "0000-00-00 00:00:00"
            }
      }
}
  • If txnID not found
{
      "status": 0,
      "msg": "0 out of 1 Transactions Fetched Successfully",
      "transaction_details": {
            "7fa6c4783a363b3da57": {
                  "mihpayid": "Not Found",
                  "status": "Not Found"
            }
      }
}

Response Values

ParameterDescriptionSample Value
statusStatus of web service call 0 if web service call failed
1 if web service call succeeded
msgReason String Parameter missing or token is empty or amount is empty or transaction not exists
transaction_details May or may not be returned depending on the web service being called mihpayid,request_id, bank_ref_num etc
request_id PayU Request ID for a request in a Transaction. eg. A transaction can have a refund request. 7800456
bank_ref_num Bank Reference Number. If bank provides after a successful action. 204519474956

B. check_payment

Input Parameters

ParameterDescriptionValue
keyMerchant key provided by PayU. Please refer to the first entry in the Post Parameters table for detailed description of this parameter JPTXg
command This parameter must have name of the web-service. check_payment
var1 In this parameter, you need to pass the Payu id (mihpayid) of the transaction 403993715521889530
hashThis parameter must contain the hash value to be calculated at your end. The string used for calculating the hash is mentioned below:
sha512(key|command|var1|salt)
sha512 is the encryption method used here
c24ee06c7cf40314ede424
b1fcc2b97a12f97a7d3dd2
06876eef16660eb09fd374
fd82861f66d8152e72d1c9
e3ee37fc691d47d6a38750
2872b03c7338a50880

Request Body

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_payment &var1= 403993715521889530 &hash= a63cb64b86afebfbbb4e586bd834ae1784f82d33533706b00d19dfcc2cc54a30379ccebd38c159259a3db3a8e636d4c9d5012d79bfafd91fe616686ef847bbd4 "

Response Parameters

  • If successfully fetched
{
      "status": 1,
      "msg": "Transaction Fetched Successfully",
      "transaction_details": {
            "request_id": "131242054",
            "bank_ref_num": "721522",
            "net_amount": null,
            "mihpayid": 403993715521889540,
            "amt": "10.00",
            "disc": "0.00",
            "mode": "CC",
            "txnid": "7fa6c4783a363b3da573",
            "amount": "10.00",
            "amount_paid": "10.00",
            "discount": "0.00",
            "additional_charges": "0.00",
            "udf1": "",
            "udf2": "",
            "udf3": "",
            "udf4": "",
            "udf5": "",
            "field1": "721522",
            "field2": "177047",
            "field3": "2056",
            "field4": "0",
            "field5": "211939174867",
            "field6": "00",
            "field7": "AUTHPOSITIVE",
            "field8": "Approved or completed successfully",
            "field9": "No Error",
            "addedon": "2020-10-26 14:12:13",
            "status": "success",
            "net_amount_debit": 10,
            "unmappedstatus": "captured",
            "firstname": "K",
            "bankcode": "CC",
            "productinfo": "Test",
            "name_on_card": "Test",
            "card_no": "512345XXXXXX2346",
            "PG_TYPE": "AXISPG",
            "Merchant_UTR": null,
            "Settled_At": null
      }
}
  • If mihpayid is missing
{
      "status": 0,
      "msg": "Invalid Merchant Key"
}