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.
🦉CURL WalkthroughOpen Recipe
URLs for Test and Production environment
Base URLs
Test | https://test.payu.in/merchant/postservice.php?form=2 |
Production | https://info.payu.in/merchant/postservice.php?form=2 |
Request format
Parameter | Description | Sample Value |
---|---|---|
key | Merchant key provided by PayU. For more information on checking your key and Salt, refer to Generate Merchant Key and Salt on PayU Dashboard. | Ibibo |
command | This parameter must have name of the web-service. | save_card |
hash | 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 | ajh84ba8abvav |
var1, var2, var3 ... up to var15 | These 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
Parameter | Description | Example |
---|---|---|
status | This 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 |
msg | Reason String | Parameter missing or token is empty or amount is empty or transaction not exists |
transaction_details | This parameter may or may not be return response depending on the web service being called. | mihpayid,request_id, bank_ref_num etc |
request_id | PayU Request ID for a request in a Transaction. eg. A transaction can have a refund request. | 7800456 |
bank_ref_num | Bank Reference Number. If bank provides after a successful action. | 204519474956 |
Updated 12 months ago