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

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.

Use Cases

a) 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

b) Execute the verify_payment API with the necessary input parameters. The output would return you the transaction status and various other parameters also.

c) 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.

d) 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.

Request Parameters

ParameterDescriptionSample Value
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

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

Response Body

a. 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"
            }
      }
}

b. If txnID not found:

{
      "status": 0,
      "msg": "0 out of 1 Transactions Fetched Successfully",
      "transaction_details": {
            "7fa6c4783a363b3da57": {
                  "mihpayid": "Not Found",
                  "status": "Not Found"
            }
      }
}

Response Parameters Description

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