Get Transaction Details API

The Get Transaction Details (get_Transaction_Details) API works based on input as two dates (initial and final), between which the transaction details are needed. The output consists of the status of the API (success or failure) and all the transaction details in an array format.

Environment

Environment

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=get_Transaction_Details&var1=2020-10-20&var2=2020-10-27&hash=0545c11641bd91ed7ba2b5c937480b0f8737962ccc4959994f2aa950ca16212283e7c440a4251ffebd725e0c2c2c03701186eec82c8dd667e75dfbb3cba8e634"
Sample response
  • Success scenario
{
      "status": 1,
      "msg": "Transaction Fetched Successfully",
      "Transaction_details": [
            {
                  "id": "403993715521889443",
                  "status": "captured",
                  "key": "JPM7Fg",
                  "merchantname": "demo",
                  "txnid": "02fdb4f0a0decd1e4937",
                  "firstname": "Ashish",
                  "lastname": "Kumar",
                  "addedon": "2020-10-26 13:54:52",
                  "bank_name": "Credit Card",
                  "payment_gateway": "AXISPG",
                  "phone": "9876543210",
                  "email": "[email protected]",
                  "transaction_fee": "10.00",
                  "amount": "10.00",
                  "discount": "0.00",
                  "additional_charges": "0.00",
                  "productinfo": "iPhone",
                  "error_code": "E000",
                  "bank_ref_no": "895255",
                  "ibibo_code": "CC",
                  "mode": "CC",
                  "ip": "106.202.49.52",
                  "card_no": "512345XXXXXX2346",
                  "cardtype": "domestic",
                  "offer_key": "",
                  "field2": "171519",
                  "udf1": "",
                  "pg_mid": null,
                  "offer_type": null,
                  "failure_reason": null,
                  "mer_service_fee": "0.00",
                  "mer_service_tax": "0.00"
            },
            {
                  "id": "403993715521889519",
                  "status": "failed",
                  "key": "JPM7Fg",
                  "merchantname": "demo",
                  "txnid": "4c5355da12224188d0ff",
                  "firstname": "K",
                  "lastname": "K",
                  "addedon": "2020-10-26 14:10:02",
                  "bank_name": "Credit Card",
                  "payment_gateway": "AXISPG",
                  "phone": "09599736876",
                  "email": "[email protected]",
                  "transaction_fee": "10.00",
                  "amount": "10.00",
                  "discount": "0.00",
                  "additional_charges": "0.00",
                  "productinfo": "i Phone",
                  "error_code": null,
                  "bank_ref_no": "372218",
                  "ibibo_code": "CC",
                  "mode": "CC",
                  "ip": "106.202.49.52",
                  "card_no": "512345XXXXXX2346",
                  "cardtype": "domestic",
                  "offer_key": "",
                  "field2": "603129",
                  "udf1": "",
                  "pg_mid": null,
                  "offer_type": null,
                  "failure_reason": null,
                  "mer_service_fee": null,
                  "mer_service_tax": null
            },
            {
                  "id": "403993715521891555",
                  "status": "captured",
                  "key": "JPM7Fg",
                  "merchantname": "demo",
                  "txnid": "e3bb0408ef94af722de5",
                  "firstname": "Ashish",
                  "lastname": "Kumar",
                  "addedon": "2020-10-26 20:59:41",
                  "bank_name": "Credit Card",
                  "payment_gateway": "AXISPG",
                  "phone": "0987654321",
                  "email": "[email protected]",
                  "transaction_fee": "10.00",
                  "amount": "10.00",
                  "discount": "0.00",
                  "additional_charges": "0.00",
                  "productinfo": "iPhone",
                  "error_code": "E000",
                  "bank_ref_no": "734154",
                  "ibibo_code": "CC",
                  "mode": "CC",
                  "ip": "106.202.39.89",
                  "card_no": "512345XXXXXX2346",
                  "cardtype": "domestic",
                  "offer_key": "",
                  "field2": "157887",
                  "udf1": "",
                  "pg_mid": null,
                  "offer_type": null,
                  "failure_reason": null,
                  "mer_service_fee": "0.00",
                  "mer_service_tax": "0.00"
            }
      ]
}
  • Failure scenario

If transaction is not found, the response is similar to the following:

{
      "status": 1,
      "msg": "Transaction Fetched Successfully",
      "Transaction_details": []
}

If invalid date is posted, the response is similar to the following:

{
      "status": 0,
      "msg": "Invalid Date Entered. Date format should be yyyy-mm-dd"
}
Response parameters

Transaction_details parameter of the response is in the JSON format. For the details of the fields in the JSON format, refer to Additional Info for General APIs.

To learn more about the possible error codes and their description, refer to Error Codes.

Request parameters

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 values

Use the following sample values while trying out the API:

  • var1: 2020-10-20
  • var2: 2020-10-27
Language
Click Try It! to start a request and see the response here!