Integrate Cross-Border Payments with PayU
The cross-border payment integration for PayU involves the following steps:
1. Make Payment Using Web Checkout Integration
Complete the payment process using PayU's web checkout integration
2. Update Invoice ID (Optional)
Optionally update the invoice ID associated with the transaction
3. Upload the Invoices
Upload invoice documents related to the completed transaction
Step 1: Make Payment using Web Checkout Integration
The following parameters (mandatory) must be posted using any of the following Web Checkout integration and refer to the corresponding section of Web Checkout Integration documentation for the complete list of parameters to be posted:
Request parameters
The following are the additional request parameter required for cross-border payments with all of the above integrations.
` EnvironmentTest Environment https://test.payu.in/_payment Production Environment https://secure.payu.in/_payment
| Parameter | Description | Example |
|---|---|---|
key mandatory |
String Merchant key provided by PayU during onboarding. |
JPg****f |
txnid mandatory |
String The transaction ID is a reference number for a specific order that is generated by the merchant. |
ypl938459435 |
amountmandatory |
String The payment amount for the transaction. |
10.00 |
productinfomandatory |
String A brief description of the product. |
iPhone |
firstnamemandatory |
String The first name of the customer. |
Ashish |
lastnamemandatory |
String The last name of the customer. |
Kumar |
emailmandatory |
String The email address of the customer. |
[email protected] |
phonemandatory |
String The phone number of the customer. |
9876543210 |
address1mandatory |
String The first line of the billing address.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. |
34 Saikripa-Estate, Tilak Nagar |
address2mandatory |
String The second line of the billing address. |
Near Metro Station |
citymandatory |
String The city where your customer resides as part of the billing address. |
Mumbai |
statemandatory |
String The state where your customer resides as part of the billing address. |
Maharashtra |
countrymandatory |
String The country where your customer resides. |
India |
zipcodemandatory |
String Billing address zip code is mandatory for the cardless EMI option.Character Limit: 20 |
400004 |
pgmandatory for seamless/s2s flow |
String It defines the payment category that the merchant wants the customer to see by default on the PayU's payment page. If this field is empty, the system assumes the credit card payment option by default. |
CC, NB or UPI |
bankcodemandatory for seamless/s2s flow |
String Each payment option is identified with a unique bank code at PayU. The merchant must post this parameter with the corresponding payment option's bank code value in it. |
AMEX |
ccnummandatory for cards |
String Use 13-19 digit card number for credit/debit cards (15 digits for AMEX, 13-19 for Maestro) and validate with LUHN algorithm. Refer to Card Number Formats and display error message on invalid input. |
5506900480000008 |
ccnamemandatory for cards |
String This parameter must contain the name on card – as entered by the customer for the transaction. |
John Doe |
ccvv mandatory for cards |
String Use 3-digit CVV number for credit/debit cards and 4-digit security code (4DBC/CID) for AMEX cards. |
123 |
ccexpmonmandatory for cards |
String This parameter must contain the card's expiry month – as entered by the user for the transaction. It must always be in 2 digits or in MM format. For months 1-9, this parameter must be appended with 0 – like 01, 02…09. For months 10-12, this parameter must not be appended – It should be 10,11 and 12 respectively. |
09 |
ccexpyrmandatory for cards |
String This parameter must contain the card's expiry year – as entered by the customer for the transaction. It must be of four digits. |
2025 |
surlmandatory |
String The success URL, which is the page PayU will redirect to if the transaction is successful. |
https://test.payu.in/admin/test_response |
furlmandatory |
String The Failure URL, which is the page PayU will redirect to if the transaction is failed. |
https://test.payu.in/admin/test_response |
udf1mandatory if AD bank request this detail |
String The Permanent Account Number of the buyer must be collected in this field. |
AELPR****E |
udf3 mandatory if AD bank request this detail |
String The date of birth of the buyer must be collected using this field in the DD-MM-YYYY format. |
02-02-1980 |
udf4mandatory for payment aggregators |
String This parameter must include end merchant legal entity name. |
XYZ Pvt. Ltd. |
udf5mandatory |
String The invoice ID or invoice number must be collected using this field. |
098450845 |
Sample request
curl --location 'https://test.payu.in/_payment' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'key=PRiQvJ' --data-urlencode 'txnid=my_order_64240' --data-urlencode 'amount=5' --data-urlencode 'productinfo=asfas' --data-urlencode '[email protected]' --data-urlencode 'phone=8688359250' --data-urlencode 'txn_s2s_flow=4' --data-urlencode 'hash={{hash}}' --data-urlencode 'pg=CC' --data-urlencode 'bankcode=CC' --data-urlencode 'surl=https://test.payu.in/admin/test_response' --data-urlencode 'furl=https://test.payu.in/admin/test_response' --data-urlencode 'udf1=' --data-urlencode 'udf2=' --data-urlencode 'udf3=' --data-urlencode 'udf4=' --data-urlencode 'udf5=' --data-urlencode 'ccnum=5506900480000008' --data-urlencode 'ccexpyr=2025' --data-urlencode 'ccexpmon=09' --data-urlencode 'ccvv=123' --data-urlencode 'ccname=test' --data-urlencode 'si_details={"billingAmount":"10.00","billingCurrency":"INR","billingCycle":"ADHOC","billingInterval": 1,"paymentStartDate":"2024-11-19","paymentEndDate":"2025-12-01"}' --data-urlencode 'api_version=7' --data-urlencode 'si=1' --data-urlencode 'firstname=sudhanshu' --data-urlencode 'user_credentials=T58CQx:sudhanshu' --data-urlencode 'lastname=kr' --data-urlencode 'address1=308,third floor' --data-urlencode 'address2=testing' --data-urlencode 'city=ggn' --data-urlencode 'state=UP' --data-urlencode 'country=IND' --data-urlencode 'zipcode=122018'Step 2: Update Invoice ID [Conditional]
If the Invoice ID value was unavailable when posting the transaction at Step 1, it can be updated using the UDF Update API by posting it in the UDF5 parameter.
Environment
| Test Environment | <https://test.payu.in/merchant/postservice.php?form=2> |
| Production Environment | <https://info.payu.in/merchant/postservice.php?form=2> |
Sample request other then UPI AutoPay
curl --location --globoff 'https://test.payu.in/merchant/postservice.php?form=2' \
--form 'key="PRiQvJ"' \
--form 'command="udf_update"' \
--form 'var1="my_order_642"' \
--form 'var2="AAAPZ1234C"' \
--form 'var4="22/08/1972"' \
--form 'var5="SellerName"' \
--form 'var6="INV000000005"' \
--form 'hash="{{hash}}"'Sample response
Success Scenario
- If successfully updated for cards
{
"status": "UDF values updated",
"transaction_id": "my_order_64240",
"udf1": "AAAPZ1234C",
"udf2": "",
"udf3": "22/08/1972",
"udf4": "SellerName",
"udf5": "INV000000005"
}- If successfully updated for UPI autopay:
{
"status": "UDF values updated",
"transaction_id": "my_order_64240",
"udf1": "AAAPZ1234C",
"udf2": "",
"udf3": "22/08/1972",
"udf4": "SellerName",
"udf5": "INV000000005"
}Failure Scenarios
- If the transaction ID is empty
(
[status] => 0
[msg] => Parameter missing
) - If the transaction ID is invalid
(
[status] => 0
[msg] => Invalid TXN ID
) - If Hash is invalid:
{
"status": 0,
"msg": "Invalid Hash."
}- If the merchant is not enabled for UDF updates:
{
"status": "0",
"msg": "Update not allowed on provided Field"
}- If no data found in the transaction ID:
{
"status": "0",
"msg": "No Data Found for txnid: 3424"
}- If the merchant is inactive:
{
"msg": "Merchant is not authorized to use PayU API",
"status": 0
}Step 3: Upload the Invoices [Optional]
According to the RBI guidelines, the invoice file must be shared with PayU within 10 days of the transaction. The invoices can be uploaded using the Invoice Upload API.
Environment
| Test Environment | <https://test.payu.in/merchant/postservice.php?form=2> |
| Production Environment | <https://info.payu.in/merchant/postservice.php?form=2> |
Sample request
curl --location -g --request POST '{{baseUrl}}/merchant/postservice?form=2' \
--form 'key="{{merchantKey}}"' \
--form 'command="opgsp_upload_invoice_awb"' \
--form 'var1="403993715525825059"' \ - PayuId
--form 'var2="TestInv0001234568"' \ - invoice Id
--form 'var3="Invoice"' \ - type of upload - Invoice/AWB
--form 'file=@"/path/to/file"' \ - file
--form 'hash="{{hash}}"' Sample response
Success Scenario
- When a file is uploaded successfully:
{
"responseCode":"00",
"responseMsg":"File Uploaded Successfully"
}Failure Scenarios
- When there is an error in uploading the file:
{
"responseCode": "103",
"responseMsg": "Failed to Upload"
} - When the file format is not supported:
{
"responseCode": "105",
"responseMsg": "Not an PACB merchant, contact KAM"
} - When the payuid is invalid:
{
"responseCode":"107",
"responseMsg":"The PayuID in request is invalid"
}- When a mandatory field is missing:
{
"responseCode":"109",
"responseMsg":"All fields are mandatory, please check!"
} Response Code and Description
Updated 1 day ago
