Transaction Status Check API

The Transaction Status Check API is used to check the status of the transaction based on the status of the transaction in PayU system further course of action is determined. If the transaction status is pending in PayU then we hit bank API to get the transaction’s status. Based on the bank response, we mark transaction success, fail, or pending in our system and provide a response.

Request parameters

ParameterDescriptionSample Value
key
mandatory
string This parameter must include the Merchant key that was provided by PayU.
Reference: For more information on how to generate the Key and Salt, refer to any of the following:
Production: Generate Production Merchant Key and Sat.
Test: Generate Test Merchant Key and Salt.
Your Test Key
command
mandatory
string The parameter must contain the name of the web service.check_bqr_txn_status
hash
mandatory
string This 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.
ajh84babvav
var1: transactionId
mandatory
string (alphanumeric) This parameter will include the transaction Identifier of the transaction for which the status is being checked.1234abcd
var2: paymentmode
optional
string This parameter will include any of the following values to specify the mode of transaction:

CARD: Debit/Credit Card

UPI: UPI
CARD
var3: productype
optional
string This parameter will include any of the following values to specify the product type:
‘’ or ‘’.

DBQR: DBQR
ISBQR: ISBQR
DBQR

Sample request

import http.client

conn = http.client.HTTPSConnection("info.payu.in")
payload = 'key=vDy3i7&command=check_bqr_txn_status&hash=8bb33d0ed43485019eab261cc5f73838149e3bbc1d253e63ca829ff05975c173ec9f308bafe022605aa7fce31821ea3b18df3752accd8a7f50658a96552a0860&var1=980&var2=UPI&var3=Optional'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/merchant/postservice.php", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location --request POST 'https://info.payu.in/merchant/postservice.php' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=vDy3i7' \
--data-urlencode 'command=check_bqr_txn_status' \
--data-urlencode 'hash=8bb33d0ed43485019eab261cc5f73838149e3bbc1d253e63ca829ff05975c173ec9f308bafe022605aa7fce31821ea3b18df3752accd8a7f50658a96552a0860' \
--data-urlencode 'var1=980' \
--data-urlencode 'var2=UPI' \
--data-urlencode 'var3=Optional'
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "key=vDy3i7&command=check_bqr_txn_status&hash=8bb33d0ed43485019eab261cc5f73838149e3bbc1d253e63ca829ff05975c173ec9f308bafe022605aa7fce31821ea3b18df3752accd8a7f50658a96552a0860&var1=980&var2=UPI&var3=Optional");
Request request = new Request.Builder()
  .url("https://info.payu.in/merchant/postservice.php")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();

Response parmeters

ParameterDescription
statusThis parameter returns the status of web service call. The status can be any of the following:

0 - If web service call failed.
1 - If web service call succeeded
msgThis parameter returns the following message if the SMS was sent successfully:
sms request successful
result
resultThe QR image is sent in an encoded format.

Sample response

  • Success
{
  "status": 1,
  "msg": "Transaction has been already\nCompleted.",
  "result": "eyJtaWhwYXlpZCI6NDAzOTkzNzE1NTExODQxNjcwLCJtb2RlIjoiREJRUiIsInN0YXR1cyI6InN1Y2Nlc3MiLCJrZXkiOiJ2RHkzaTciLCJ0eG5pZCI6Ijk4MCIsImFtb3VudCI6IjEuMDAiLCJhZGRlZG9uIjoiMjAxOS0wNS0yMyAxODoyMzozMiIsInByb2R1Y3RpbmZvIjoiT2ZmbGluZSBEeW5hbWljIFFSIiwiZmlyc3RuYW1lIjoicm9uYWxkbyIsImxhc3RuYW1lIjoiIiwiYWRkcmVzczEiOiJiZXN0ZWNoIGJ1c2luZXNzIHRvd2VyICBzb2huYSByb2FkICBzZWN0b3IgNDggIGd1cmdhb24gMTIyMDAxIiwiYWRkcmVzczIiOiIiLCJjaXR5IjoiaHlkZXJhYmFkIiwic3RhdGUiOiIiLCJjb3VudHJ5IjoiIiwiemlwY29kZSI6IjUwMDA3MiIsImVtYWlsIjoibW52c2s5N0BnbWFpbC5jb20iLCJwaG9uZSI6IjcwNjAzMzQ1MDEiLCJ1ZGYxI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XNudCBtYXRjaCIsInBheW1lbnRfc291cmNlIjoicGF5dSIsIlBHX1RZUEUiOiJCUVIiLCJlcnJvciI6IkUyMjAiLCJlcnJvcl9NZXNzYWdlIjoiQW1vdW50IG9yIHRyYW5zYWN0aW9uIGRvZXNudCBtYXRjaCIsIm5ldF9hbW91bnRfZGViaXQiOjAsInVubWFwcGVkc3RhdHVzIjoiZmFpbGVkIiwiaGFzaCI6ImQ0OTc5MDdmZjFlZjY5ODg2NTlkZWUzMDA2M2UyMWVlZWVhYTNlOTJlZTZiMWM0MzdmMmU2ZDhjODZhNzliZDJjYTg4Njk5ODgxOTIwOWRmNWZlMzA3YjdlMjJmNjFiNDc1ODE2ZWExYmNlN2U3ZDBjNGZkYmJhNDZjMDZlZTg0IiwiYmFua19yZWZfbm8iOiI5MTM3Mzk5NTMyMTYiLCJiYW5rX3JlZl9udW0iOiI5MTM3Mzk5NTMyMTYiLCJiYW5rY29kZSI6IlVQSUJRUiIsInN1cmwiOiJodHRwOlwvXC8xMC41MC4yMy4zNSIsImN1cmwiOiJodHRwOlwvXC8xMC41MC4yMy4zNSIsImZ1cmwiOiJodHRwOlwvXC8xMC41MC4yMy4zNSJ9"
}
  • Pending Status at PayU but Success at Backend
{
  "status": 1,
  "msg": "Transaction is Successful",
  "result": "eyJtaWhwYXlpZCI6NDAzOTkzNzE1NTExODQxNjcwLCJtb2RlIjoiREJRUiIsInN0YXR1cyI6InN1Y2Nlc3MiLCJrZXkiOiJ2RHkzaTciLCJ0eG5pZCI6Ijk4MCIsImFtb3VudCI6IjEuMDAiLCJhZGRlZG9uIjoiMjAxOS0wNS0yMyAxODoyMzozMiIsInByb2R1Y3RpbmZvIjoiT2ZmbGluZSBEeW5hbWljIFFSIiwiZmlyc3RuYW1lIjoicm9uYWxkbyIsImxhc3RuYW1lIjoiIiwiYWRkcmVzczEiOiJiZXN0ZWNoIGJ1c2luZXNzIHRvd2VyICBzb2huYSByb2FkICBzZWN0b3IgNDggIGd1cmdhb24gMTI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