UPI Omnichannel S2S Integration
Steps to Integrate
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
Production | https://secure.payu.in/_payment |
Test | Β https://test.payu.in/_payment |
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 UPI Collection - S2S.
Parameter | Description | Example |
---|---|---|
keymandatory | 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_versionoptional | String The API version for this API. | 1 |
txnidmandatory | 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 |
amountmandatory | 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 |
productinfomandatory | String It should be a string containing a brief description of the product. | iPhone |
emailmandatory | String The email of the customer. | [email protected] |
phonemandatory | String The phone number of the customer. | 9876543210 |
surlmandatory | 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/ |
furlmandatory | 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/ |
pgmandatory | String The payment method is specified in this field. For UPI INTENT, specify parameter as UPI. | UPI |
bankcodemandatory | String Each payment option is identified with a unique bank code at PayU. For UPI Intent, specify the values as INTENT. | INTENT |
txn_s2s_flow | enumm 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 |
firstnamemandatory | String The first name of the customer. | Ashish |
lastnamemandatory | String The last name of the customer. | Verma |
address1optional | String The first line of the billing address. | H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai |
address2optional | 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 |
stateoptional | String The state where your customer resides as part of the billing address. | Maharashtra |
countryoptional | String The country where your customer resides. | India |
zipcodeoptional | String Billing address zip code is mandatory for the cardless EMI option.Character Limit-20 | 400004 |
hashmandatory | 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 |
udf1optional | 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 | Payment Preference |
udf2optional | 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 |
udf3optional | 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 |
udf4optional | 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 |
udf5optional | 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_ipmandatory | 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_infomandatory | 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. | |
upiAppNamemandatory | 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 - genericintent β For any other app apart from above | |
vpamandatory | 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/Mode | bankcode |
---|---|
Omnichannel Flow | TEZOMNI |
Generic Intent | INTENT |
GPay | TEZ |
PhonePe | PPINTENT |
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 UPI Collection - S2S. 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.
Updated 23 days ago