REST API Format

PayU has created many REST APIs and each REST API has a specific function. You can use them to automate different features. The basic format and execution of all web services remain the same. Each REST API is a server-to-server call from your server to PayU’s server.

REST API can be accessed by making a server-to-server call on the following PayU URLs:

📘

Reference:

Refer to the following recipe for a walkthrough of a cURL request for a REST API.

URLs for Test and Production environment

Base URLs

Testhttps://test.payu.in/merchant/postservice.php?form=2 
Productionhttps://info.payu.in/merchant/postservice.php?form=2

Request format

ParameterDescriptionSample Value
keyMerchant key provided by PayU. For more information on checking your key and Salt, refer to Generate Merchant Key and Salt on PayU Dashboard.Ibibo
commandThis parameter must have name of the web-service. save_card
hashThis 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
ajh84ba8abvav
var1, var2, var3 ... up to var15These are the variable parameters, whose values depend on the particular web-service. The definition of these parameters will be covered in the (Read command explanations mentioned later - separate for all the actions/commands.)Read specific commands.

Response format

📘

Note:

To get the response in JSON, you need to append form=2 along with the endpoint similar to the following:

https://test.payu.in/merchant/postservice.php?form=2

ParameterDescriptionExample
statusThis parameter returns the any of the following status of web service call:
1 - If web service call succeeded
0 - if web service call failed
0
msgReason StringParameter missing or token is empty or amount is empty or transaction not exists
transaction_detailsThis parameter may or may not be return response depending on the web service being called.mihpayid,request_id, bank_ref_num etc
request_idPayU Request ID for a request in a Transaction. eg. A transaction can have a refund request.7800456
bank_ref_numBank Reference Number. If bank provides after a successful action.204519474956