The Payment Initiation API is used to initiate payment towards an Integrated Static QR.
Environment | URI |
---|---|
Production | https://secure.payu.in/QrPayment |
Request parameters
Parameter | Description | Example |
---|---|---|
key
| string This parameter must contain the merchant key for the merchant’s account at PayU. | Your Test Key |
txnid |
| f7f48de5853f4ebdacef |
amount |
| 10 |
qrId |
| STQI-test-2 |
productinfo |
| Integrated Static QR |
expirytime |
| 3600 |
udf3 |
| |
udf4 |
| |
udf5 |
| |
firstname |
| Ravi |
lastname |
| |
email |
| |
phone |
| 1234567890 |
hash |
|
|
Sample request
curl --location --request POST 'https://secure.payu.in/QrPayment' \
--data-urlencode 'key=J****g' \
--data-urlencode 'txnid=txn1234' \
--data-urlencode 'amount=100' \
--data-urlencode 'qrId=qr123' \
--data-urlencode 'productinfo=Integrated Static QR' \
--data-urlencode 'expirytime=3600' \
--data-urlencode 'UDF3=Gurgaon' \
--data-urlencode 'UDF4=120001' \
--data-urlencode 'UDF5=India' \
--data-urlencode 'firstname=Payu' \
--data-urlencode 'lastname=user' \
--data-urlencode '[email protected]' \
--data-urlencode 'phone=1234567890' \
--data-urlencode 'hash=5606747fec73bd7a271748f13c06626d6520b5ba1af9db7338b9a1d2d9d6da77c9291304f7a78fe4bf02319702f56131c868306a5280daf18038a1d8bdbdef21'
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "key=J****g&txnid=txn1234&amount=100&qrId=qr123&productinfo=Integrated Static QR&expirytime=3600&UDF3=Gurgaon&UDF4=120001&UDF5=India&firstname=Payu&lastname=user&[email protected]&phone=1234567890&hash=5606747fec73bd7a271748f13c06626d6520b5ba1af9db7338b9a1d2d9d6da77c9291304f7a78fe4bf02319702f56131c868306a5280daf18038a1d8bdbdef21");
Request request = new Request.Builder()
.url("https://secure.payu.in/QrPayment")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://secure.payu.in/QrPayment"
payload='key=J****g&txnid=txn1234&amount=100&qrId=qr123&productinfo=Integrated%20Static%20QR&expirytime=3600&UDF3=Gurgaon&UDF4=120001&UDF5=India&firstname=Payu&lastname=user&email=test%40payu.in&phone=1234567890&hash=5606747fec73bd7a271748f13c06626d6520b5ba1af9db7338b9a1d2d9d6da77c9291304f7a78fe4bf02319702f56131c868306a5280daf18038a1d8bdbdef21'
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://secure.payu.in/QrPayment',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'key=J****g&txnid=txn1234&amount=100&qrId=qr123&productinfo=Integrated%20Static%20QR&expirytime=3600&UDF3=Gurgaon&UDF4=120001&UDF5=India&firstname=Payu&lastname=user&email=test%40payu.in&phone=1234567890&hash=5606747fec73bd7a271748f13c06626d6520b5ba1af9db7338b9a1d2d9d6da77c9291304f7a78fe4bf02319702f56131c868306a5280daf18038a1d8bdbdef21',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require "uri"
require "net/http"
url = URI("https://secure.payu.in/QrPayment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request.body = "key=J****g&txnid=txn1234&amount=100&qrId=qr123&productinfo=Integrated%20Static%20QR&expirytime=3600&UDF3=Gurgaon&UDF4=120001&UDF5=India&firstname=Payu&lastname=user&email=test%40payu.in&phone=1234567890&hash=5606747fec73bd7a271748f13c06626d6520b5ba1af9db7338b9a1d2d9d6da77c9291304f7a78fe4bf02319702f56131c868306a5280daf18038a1d8bdbdef21"
response = https.request(request)
puts response.read_body