Receive a static QR payment result for a merchant VPA.
Use this endpoint to receive a static QR payment result. A blank field4 (merchant VPA) or a blank key is rejected, and a blank txnid is not. The hash is the standard PayU response hash checked with the merchant salt.
Method
POST
Endpoint
/partner/staticQrCallback
Environment
| Environment | URL |
|---|---|
| Test Environment | https://test-partnerapilayer.payu.in/apilayer/partner/staticQrCallback |
| Production Environment | https://api.payu.in/partner/staticQrCallback |
Sample Request
curl -X POST https://test-partnerapilayer.payu.in/apilayer/partner/staticQrCallback \
-H "Content-Type: application/json" \
-d '{
"txnid": "TXN1001",
"field4": "merchant@payu",
"key": "smsPlusDemo",
"mihpayid": "403993715521855092",
"amount": "1000.00",
"status": "success",
"mode": "CC",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"bank_ref_num": "1234567890"
}'import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class PartnerRequest {
public static void main(String[] args) throws Exception {
String body = "{\"txnid\": \"TXN1001\", \"field4\": \"merchant@payu\", \"key\": \"smsPlusDemo\", \"mihpayid\": \"403993715521855092\", \"amount\": \"1000.00\", \"status\": \"success\", \"mode\": \"CC\", \"hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", \"bank_ref_num\": \"1234567890\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://test-partnerapilayer.payu.in/apilayer/partner/staticQrCallback"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}import requests
url = "https://test-partnerapilayer.payu.in/apilayer/partner/staticQrCallback"
headers = {
"Content-Type": "application/json"
}
payload = {
"txnid": "TXN1001",
"field4": "merchant@payu",
"key": "smsPlusDemo",
"mihpayid": "403993715521855092",
"amount": "1000.00",
"status": "success",
"mode": "CC",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"bank_ref_num": "1234567890"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-partnerapilayer.payu.in/apilayer/partner/staticQrCallback",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"txnid\": \"TXN1001\", \"field4\": \"merchant@payu\", \"key\": \"smsPlusDemo\", \"mihpayid\": \"403993715521855092\", \"amount\": \"1000.00\", \"status\": \"success\", \"mode\": \"CC\", \"hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", \"bank_ref_num\": \"1234567890\"}",
CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($curl);
curl_close($curl);const response = await fetch("https://test-partnerapilayer.payu.in/apilayer/partner/staticQrCallback", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"txnid": "TXN1001",
"field4": "merchant@payu",
"key": "smsPlusDemo",
"mihpayid": "403993715521855092",
"amount": "1000.00",
"status": "success",
"mode": "CC",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"bank_ref_num": "1234567890"
})
});
console.log(await response.text());using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://test-partnerapilayer.payu.in/apilayer/partner/staticQrCallback");
request.Content = new StringContent("{\"txnid\": \"TXN1001\", \"field4\": \"merchant@payu\", \"key\": \"smsPlusDemo\", \"mihpayid\": \"403993715521855092\", \"amount\": \"1000.00\", \"status\": \"success\", \"mode\": \"CC\", \"hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", \"bank_ref_num\": \"1234567890\"}", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());require "net/http"
require "json"
uri = URI("https://test-partnerapilayer.payu.in/apilayer/partner/staticQrCallback")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request.body = {"txnid": "TXN1001", "field4": "merchant@payu", "key": "smsPlusDemo", "mihpayid": "403993715521855092", "amount": "1000.00", "status": "success", "mode": "CC", "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "bank_ref_num": "1234567890"}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
Mandatory ParametersParameters marked with * are mandatory.
| Parameter | Description |
|---|---|
Content-Type* | string Send the body as application/json. |
txnid | string Used to detect a duplicate callback. A blank value is not rejected. |
field4* | string Merchant VPA. The handler rejects the call when this is blank. |
key* | string Merchant key used to load the salt for hash verification. |
mihpayid | string Mihpayid. |
amount | string Amount. |
status | string Status. |
mode | string Mode. |
hash | string Hash. The hash is the standard PayU response hash checked with validatePayUBizResponseHash and the merchant salt. |
bank_ref_num | string Bank ref num. |
Sample Response
Empty HTTP 200. PayU returns no response body after it accepts the callback.Errors
Below are the failure scenarios.
field4 (merchantVpa) is required
field4 (merchantVpa) is requiredReason: This error occurs when field4, the merchant VPA, is not included.
Recommended Fix: Include field4 with the merchant VPA and retry.
