Welcome to the API Playground
https://test.payu.in/merchant/postservice?form=2
PayU APIs provide a simple and flexible way to initiate, authorise and complete online payments.This API playground provides information on available endpoints and how to interact with them in real time and integrate with your products. Please select API category/name for more.
PayU Hosted
This flow allows you to hand over the entire control of the checkout process to PayU's inbuilt UIs for payments.

Merchant Hosted
Merchant needs to collect the payment details on their own platform and post them to PayU.

Server-to-Server
Merchant needs to collect the payment details on their platform & decode base64 for bank page.
Parameters
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=
&command=
&var1=
&hash=
"
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=
gtKFFx
&command=
&var1=
&var2=
&var3=
&var4=
&var5=
&hash=
"
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=
&command=
&var1=
&var2=
&var3=
&var4=
&var5=
&var6=
&var7=
&var8=
&var9=
&hash=
"
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=
&command=
&var1=
&var2=
&var3=
&var4=
&var5=
&var6=
&var7=
&var8=
&hash=
"
import requests
url = "https://test.payu.in/merchant/postservice?form=2"
payload =
"key=
&command=
&var1=
&var2=
&var3=
&var4=
&var5=
&var6=
&var7=
&var8=
&var9=
&hash=
"
headers = {
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
import requests
url = "https://test.payu.in/_payment"
payload =
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&ccnum=
&ccexpmon=
&ccexpyr=
&ccvv=
&ccname=
&txn_s2s_flow=
&hash=
"
headers = {
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
$url = "https://test.payu.in/merchant/postservice?form=2-H";
$req = req_init($url);
req_setopt($req, CURLOPT_URL, $url);
req_setopt($req, CURLOPT_POST, true);
req_setopt($req, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Content-Type: application/x-www-form-urlencoded",
);
req_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data =
"key=
&command=
&var1=
&var2=
&var3=
&var4=
&var5=
&var6=
&var7=
&var8=
&var9=
&hash=
"
req_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = req_exec($req);
req_close($req);
var_dump($resp);
$url = "https://test.payu.in/_payment";
$req = req_init($url);
req_setopt($req, CURLOPT_URL, $url);
req_setopt($req, CURLOPT_POST, true);
req_setopt($req, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Content-Type: application/x-www-form-urlencoded",
);
req_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data =
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&ccnum=
&ccexpmon=
&ccexpyr=
&ccvv=
&ccname=
&txn_s2s_flow=
&hash=
"
req_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = req_exec($req);
req_close($req);
var_dump($resp);
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://test.payu.in/merchant/postservice?form=2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body =
"key=
&command=
&var1=
&var2=
&var3=
&var4=
&var5=
&var6=
&var7=
&var8=
&var9=
&hash=
"
response = http.request(request)
puts response.read_body
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://test.payu.in/_payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body =
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&ccnum=
&ccexpmon=
&ccexpyr=
&ccvv=
&ccname=
&txn_s2s_flow=
&hash=
"
response = http.request(request)
puts response.read_body
params := url.Values{}
params.Add
("key",
`
`)
params.Add
("command",
`
`)
params.Add
("var1",
`
`)
params.Add
("var2",
`
`)
params.Add
("var3",
`
`)
params.Add
("var4",
`
`)
params.Add
("var5",
`
`)
params.Add
("var6",
`
`)
params.Add
("var7",
`
`)
params.Add
("var8",
`
`)
params.Add
("var9",
`
`)
params.Add
("hash",
`
`)
body := strings.NewReader(params.Encode())
req, err := http.NewRequest("POST", "https://test.payu.in/merchant/postservice?form=2-H", body)
if err != nil {
// handle err
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := http.DefaultClient.Do(req)
if err != nil {
// handle err
}
defer resp.Body.Close()
params := url.Values{}
params.Add
("key",
`
`)
params.Add
("amount",
`
`)
params.Add
("txnid",
`
`)
params.Add
("firstname",
`
`)
params.Add
("email",
`
`)
params.Add
("phone",
`
`)
params.Add
("productinfo",
`
`)
params.Add
("surl",
`
`)
params.Add
("furl",
`
`)
params.Add
("pg",
`
`)
params.Add
("bankcode",
`
`)
params.Add
("ccnum",
`
`)
params.Add
("ccexpmon",
`
`)
params.Add
("ccexpyr",
`
`)
params.Add
("ccvv",
`
`)
params.Add
("ccname",
`
`)
params.Add
("txn_s2s_flow",
`
`)
params.Add
("hash",
`
`)
body := strings.NewReader(params.Encode())
req, err := http.NewRequest("POST", "https://test.payu.in/_payment -H", body)
if err != nil {
// handle err
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := http.DefaultClient.Do(req)
if err != nil {
// handle err
}
defer resp.Body.Close()
Request request = Request.Post("https://test.payu.in/merchant/postservice?form=2 -H");
String body =
"key=
&command=
&var1=
&var2=
&var3=
&var4=
&var5=
&var6=
&var7=
&var8=
&var9=
&hash=
"
request.bodyString(body,ContentType.APPLICATION_FORM_URLENCODED);
request.setHeader("Content-Type", "application/x-www-form-urlencoded");
HttpResponse httpResponse = request.execute().returnResponse();
System.out.println(httpResponse.getStatusLine());
if (httpResponse.getEntity() != null) {
String html = EntityUtils.toString(httpResponse.getEntity());
System.out.println(html);
}
Request request = Request.Post("https://test.payu.in/_payment -H");
String body =
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&ccnum=
&ccexpmon=
&ccexpyr=
&ccvv=
&ccname=
&txn_s2s_flow=
&hash=
"
request.bodyString(body,ContentType.APPLICATION_FORM_URLENCODED);
request.setHeader("Content-Type", "application/x-www-form-urlencoded");
HttpResponse httpResponse = request.execute().returnResponse();
System.out.println(httpResponse.getStatusLine());
if (httpResponse.getEntity() != null) {
String html = EntityUtils.toString(httpResponse.getEntity());
System.out.println(html);
}
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set
('key',
'
');
encodedParams.set
('command',
'
');
encodedParams.set
('var1',
'
');
encodedParams.set
('var2',
'
');
encodedParams.set
('var3',
'
');
encodedParams.set
('var4',
'
');
encodedParams.set
('var5',
'
');
encodedParams.set
('var6',
'
');
encodedParams.set
('var7',
'
');
encodedParams.set
('var8',
'
');
encodedParams.set
('var9',
'
');
encodedParams.set
('hash',
'
');
const url = 'https://test.payu.in/merchant/postservice?form=2';
const options = {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: encodedParams
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
const { URLSearchParams } = require('url');
const fetch = require('node-fetch');
const encodedParams = new URLSearchParams();
encodedParams.set
('key',
'
');
encodedParams.set
('amount',
'
');
encodedParams.set
('txnid',
'
');
encodedParams.set
('firstname',
'
');
encodedParams.set
('email',
'
');
encodedParams.set
('phone',
'
');
encodedParams.set
('productinfo',
'
');
encodedParams.set
('surl',
'
');
encodedParams.set
('furl',
'
');
encodedParams.set
('pg',
'
');
encodedParams.set
('bankcode',
'
');
encodedParams.set
('ccnum',
'
');
encodedParams.set
('ccexpmon',
'
');
encodedParams.set
('ccexpyr',
'
');
encodedParams.set
('ccvv',
'
');
encodedParams.set
('ccname',
'
');
encodedParams.set
('txn_s2s_flow',
'
');
encodedParams.set
('hash',
'
');
const url = 'https://test.payu.in/merchant/_payment';
const options = {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: encodedParams
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
curl -X POST "https://test.payu.in/_payment"
-H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&surl=
&furl=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&ccnum=
&ccexpmon=
&ccexpyr=
&ccvv=
&ccname=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&txn_s2s_flow=
&surl=
&furl=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&txn_s2s_flow=
&bankcode=
&surl=
&furl=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&ccnum=
&ccexpmon=
&ccexpyr=
&ccvv=
&ccname=
&txn_s2s_flow=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&ccnum=
&ccexpmon=
&ccexpyr=
&ccvv=
&ccname=
&txn_s2s_flow=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&vpa=
&surl=
&furl=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&vpa=
&txn_s2s_flow=
&surl=
&furl=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&api_version=
&beneficiarydetail=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&api_version=
&beneficiarydetail=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&api_version=
&beneficiarydetail=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&api_version=
&beneficiarydetail=
&hash=
"
curl -X POST "https://test.payu.in/_payment
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
"key=
&txnid=
&amount=
&firstname=
&email=
&phone=
&productinfo=
&pg=
&bankcode=
&surl=
&furl=
&api_version=
&beneficiarydetail=
&hash=
"