UPI Omnichannel S2S Integration

Steps to Integrate

  1. Initiate Payment
  2. Check UPI Transaction Status
  3. PayU Sends S2S Call Back Response

👍

Before you begin:

Register for a account with PayU before you start integration. For more information, refer to Register for a Merchant Account.

Step 1: Initiate payment

Environment

The Omni Channel API allows you to call the service request using the specific bank codes.

Post the initiatePayment API to initiate payment with all the required parameters as in the following Parameters table.

Request parameters

For the complete list of parameters, refer to Collect Payment API - Server-to-Server.

ParameterDescriptionExample
key
mandatory
String The merchant key is provided by PayU and acts as a unique identifier for a specific merchant account in PayU’s database.
Reference: For more information on how to generate the Key and Salt, refer to any of the following:

Production: Generate Production Merchant Key and Sat.

Test: Generate Test Merchant Key and Salt.
Your Test Key
api_version
optional
String The API version for this API.1
txnid
mandatory
String The transaction ID is the order reference number generated by the merchant to track a particular order. It can be used only once and PayU’s system does not accept a duplicate Transaction ID.s7hhDQVWvbhBdN
amount
mandatory
float It should contain the payment amount of the particular transaction. The amount must be greater than Rs. 8000 for the cardless EMI option.10.00
productinfo
mandatory
String It should be a string containing a brief description of the product.iPhone
email
mandatory
String The email of the customer.[email protected]
phone
mandatory
String The phone number of the customer.9876543210
surl
mandatory
String Success URL(surl) – It must contain the URL on which PayU will redirect the final response if the transaction is successful.https://apiplayground-response.herokuapp.com/
furl
mandatory
String Failure URL (furl) – It must contain the URL on which PayU will redirect the final response in case of failure.https://apiplayground-response.herokuapp.com/
pg
mandatory
String The payment method is specified in this field. For UPI INTENT, specify parameter as UPI.UPI
bankcode
mandatory
String Each payment option is identified with a unique bank code at PayU. For UPI Intent, specify the values as INTENT.INTENT
txn_s2s_flowenumm The type of transaction flow. This field is mandatory for all types of S2S flows that drive the response types of transactions. For POS, specify the value as 4.4
firstname
mandatory
String The first name of the customer.Ashish
lastname
mandatory
String The last name of the customer.Verma
address1
optional
String The first line of the billing address.H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai
address2
optional
String The second line of the billing address.34 Saikripa-Estate, Tilak Nagar
city
optional
String The city where your customer resides as part of the billing address.Mumbai
state
optional
String The state where your customer resides as part of the billing address.Maharashtra
country
optional
String The country where your customer resides.India
zipcode
optional
String Billing address zip code is mandatory for the cardless EMI option.
Character Limit-20
400004
hash
mandatory
String It is used to avoid the possibility of transaction tampering. For more information, refer to Generate Hash.eabec285da28fd
0e3054d41a4d24fe
9f7599c9d0b6664
6f7a9984303fd612
4044b6206daf831
e9a8bda28a6200d
318293a13d6c193
109b60bd4b4f8b09
c90972
udf1
optional
String User-defined fields(udf) are used to store any information corresponding to a particular transaction. Merchants can use up to 5 udfs in the post designated as udf1, udf2, udf3, udf4, udf5. For example, you can store customer's preferred paymentPayment Preference
udf2
optional
String User-defined fields(udf) are used to store any information corresponding to a particular transaction. Merchants can use up to 5 udfs in the post designated as udf1, udf2, udf3, udf4, udf5. For example, you can store customer's preferred payment.Shipping Method
udf3
optional
String User-defined fields(udf) are used to store any information corresponding to a particular transaction. Merchants can use up to 5 udfs in the post designated as udf1, udf2, udf3, udf4, udf5. For example, you can store customer's preferred payment.Shipping Address1
udf4
optional
String User-defined fields(udf) are used to store any information corresponding to a particular transaction. Merchants can use up to 5 udfs in the post designated as udf1, udf2, udf3, udf4, udf5. For example, you can store customer's preferred payment.Shipping City
udf5
optional
String User-defined fields(udf) are used to store any information corresponding to a particular transaction. Merchants can use up to 5 udfs in the post designated as udf1, udf2, udf3, udf4, udf5. For example, you can store customer's preferred payment.Shipping Zip Code
s2s_client_ip
mandatory
String This parameter must have the source IP of the user's device.
Note: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information.
s2s_device_info
mandatory
varchar This parameter must have the user agent of device.
Note: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information.
upiAppName
mandatory
For Specific Intent, merchant should share the app name which is selected by customer on the merchant check-out page. The following are the enum’s expected for major apps:
- phonepe
- googlepay
- paytm
- bhim
- cred
- amazonpay
- whatsapp
- genericintent – For any other app apart from
above
vpa
mandatory
String Virtual Private Address. VPA can first be validated using VPA validate web service. Also, add regex where ‘@’ exists. Example: 8800411088@upi This needs to be passed in case of collect flow of UPI only. 8800411088@upi

This needs to be a server-to-server curl call request. This API is used for both Cards and UPI for generating a new transaction. 

If specific intent has to be opened instead of Generic Intent, the bankcode values will change accordingly as listed in the following table: 

App/Modebankcode
Omnichannel FlowTEZOMNI
Generic IntentINTENT
GPayTEZ
PhonePePPINTENT

📘

Note:

User VPA is not required for this flow. The different parameters and their descriptions are in the following table.

Collect the response in the Collect Payment API - Server-to-Server under API Reference. The response for the S2S payment request is not similar to Merchant Hosted or PayU Hosted Checkout. For description of response parameters, refer to Additional Info for Payment APIs.

Step 2: Check UPI transaction status

After receiving a successful response from the above API, the need to check the status of the transaction using the Verify Payment API. Web services can be accessed by making a server to server call on the following PayU URLs. For a sample request or response, refer to Verify Payment API under API Reference.

Step 3: PayU sends S2S callback response

PayU can also send a server-to-server callback response whenever the transaction status gets updated.

Implementation

The server to server response would be sent by PayU on a pre-set URL, which has to be provided by the merchant.  PayU will configure it at the back-end for the merchant.

This response would be sent in key/value pair separated by the ampersand (&) character. In case any parameter is empty or not used, PayU will send it back to the merchant with an empty string.

Sample response

unmappedstatus=success&phone=9999999999&txnid=FCDA1R100870163781&hash=84e3 35094bbcb2ddaa0f9a488eb338e143b273765d89c9dfa502402562d0b6f3c7935e28194ca92f7 380be7c84c3695415b106dcf52cb016a15fcf6adc98d724&status=success&curl=https://www. abc.in/payment/handlepayuresposne&firstname=NA&card_no=519619XXXXXX5049&furl= https://www.abc.in/payment/handlepayuresposne&productinfo=2&mode=DC&amount=800.  00&field4=6807112311042810&field3=6807112311042810&field2=838264&field9=SUCC ESS&email=NA&mihpayid=175477248&surl=https://www.ABC.in/payment/handlepayuresp osne&card_hash=9e88cb0573d4a826b61d808c0a870ed4a990682459b0ec9e95ea421e8e47b e8c&field1=42812 

The parameter list includes:

mihpayid, mode, status, key, txnid, amount, productinfo, firstname, lastname, address1, address2, cit y, state, country, zipcode, email, phone, udf1, udf2, udf3, udf4, udf5, udf6, udf7, udf8, udf9, udf10, car d_token,card_no, field0, field1, field2, field3, field4, field5, field6, field7, field8, field9, offer, discou nt, offer_availed,unmappedstatus, hash, bank_ref_no, surl, curl, furl, and card_hash

Whitelisting required

Whitelisting is required at both merchant’s and PayU’s end to establish this connection.

  • You need to white list the following IP address on your Firewall:
    • 180.179.174.1
    • 180.179.174.2
  • PayU will white list merchant server side IP address that you have provided to PayU.