Integrate Import for PayUBiz

The cross-border payment integration for PayUBiz involves the following significant steps:

  1. Make Payment using Web Checkout Integration
  2. Update Invoice ID [Optional]
  3. Upload Invoice with PayU

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.

Environment

Parameter

Description

Example

key

mandatory

StringMerchant key provided by PayU during onboarding.

 JPg****f

txnid mandatory

StringThe transaction ID is a reference number for a specific order that is generated by the merchant.

ypl938459435

amount

StringThe transaction amount.

100.00

productinfo mandatory

StringA brief description of the product.

 iPhone

firstname mandatory

String The first name of the customer.

Ashish

lastname mandatory

String The last name of the customer.

Kumar

email mandatory

StringThe email address of the customer.

 

[email protected]

phone mandatory

StringThe phone number of the customer.

 

address1 mandatory

String The first line of the billing address. H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai

  • 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

address2 mandatory

String The second line of the billing address.

city mandatory

String The city where your customer resides as part of the billing address.

Mumbai

state mandatory

String The state where your customer resides as part of the billing address,

Maharashtra

country mandatory

String The country where your customer resides.

India

zipcode mandatory

String Billing address zip code is mandatory for the cardless EMI option. `Character Limit-20

400004

pg mandatory 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

bankcode mandatory 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

ccnum mandatory 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.

ccname mandatory for cards

String This parameter must contain the name on card – as entered by the customer for the transaction.

ccvv mandatory for cards

String Use 3-digit CVV number for credit/debit cards and 4-digit security code (4DBC/CID) for AMEX cards.

ccexpmon mandatory 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.

ccexpyr mandatory 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.

surl mandatory

String The success URL, which is the page PayU will redirect to if the transaction is successful.

furl mandatory

StringThe Failure URL, which is the page PayU will redirect to if the transaction is failed.

udf1 conditional

String The Permanent Account Number of the buyer must be collected in this field. This is required if AD bank request this detail.

AELPR****E

udf3 conditional

String The date of birth of the buyer must be collected using this field in the DD-MM-YYYY format. This is required if AD bank request this detail.

02-02-1980

udf4 mandatory for payment aggregators

String This parameter must include end merchant legal entity name.

XYZ Pvt. Ltd.

udf5 mandatory

StringThe invoice ID or invoice number must be collected using this field.

098450845

📘

Reference: For the Try It experience, refer to any of the following based on integration:

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'

Sample response

Response

mihpayid=403993715531077182&mode=CC&status=success&unmappedstatus=captured&key=JPM7Fg&txnid=ypl938459435dfdfdf&amount=1000.00&cardCategory=domestic&discount=0.00&net_amount_debit=1000&addedon=2024-02-27+15%3A11%3A37&productinfo=iPhone&firstname=Ashish+User&lastname=&address1=&address2=&city=&state=&country=&zipcode=&email=ashish%40gmail.com&phone=9876543210&udf1=&udf2=&udf3=&udf4=&udf5=&udf6=&udf7=&udf8=&udf9=&udf10=&hash=afeab9dcf4e43d47f8fbf5a6838d393c70694a58e30ada08e6cb86ac943236c05717c5f5e4872d671fe81d0d9b2d9facd44e9a061ba621aff6f20c4343ea5dfa&field1=&field2=&field3=&field4=&field5=&field6=&field7=&field8=&field9=Transaction+Completed+Successfully&payment_source=payu&PG_TYPE=CC-PG&bank_ref_num=7f0d5ada-59bb-41d7-9e41-20a6af2406c9&bankcode=CC&error=E000&error_Message=No+Error&name_on_card=test&cardnum=411111XXXXXX1111&cardhash=This+field+is+no+longer+supported+in+postback+params.

Parsed response

{
  "mihpayid": "403993715531077182",
  "mode": "CC",
  "status": "success",
  "unmappedstatus": "captured",
  "key": "JPM7Fg",
  "txnid": "ypl938459435dfdfdf",
  "amount": "1000.00",
  "cardCategory": "domestic",
  "discount": "0.00",
  "net_amount_debit": "1000",
  "addedon": "2024-02-27 15:00:42",
  "productinfo": "iPhone",
  "firstname": "Ashish",
  "lastname": "",
  "address1": "",
  "address2": "",
  "city": "",
  "state": "",
  "country": "",
  "zipcode": "",
  "email": "[email protected]",
  "phone": "9876543210",
  "udf1": "",
  "udf2": "",
  "udf3": "",
  "udf4": "",
  "udf5": "",
  "udf6": "",
  "udf7": "",
  "udf8": "",
  "udf9": "",
  "udf10": "",
  "hash": "84bbbf0fa3ba2a39942f6c3deab234c4d00bc5b6aceee5cda3c8200d6e1714e19c224d47e24d0c4a9a0cce40eddbae1dc46455c69e5e7d5dd62f6636bfab337c",
  "field1": "896193988312194700",
  "field2": "857712",
  "field3": "1000.00",
  "field4": "",
  "field5": "00",
  "field6": "02",
  "field7": "AUTHPOSITIVE",
  "field8": "AUTHORIZED",
  "field9": "Transaction is Successful",
  "payment_source": "payu",
  "PG_TYPE": "CC-PG",
  "bank_ref_num": "896193988312194700",
  "bankcode": "CC",
  "error": "E000",
  "error_Message": "No Error",
  "cardnum": "XXXXXXXXXXXX2346",
  "cardhash": "This field is no longer supported in postback params.",
  "splitInfo": "{\"splitStatus\":\"splitNotReceived\",\"splitSegments\":[]}"
}
Response parameters
ParameterDescription
mihpayidIt is a unique reference number created for each transaction at PayU's end which is used to identify a transaction in case of a refund.
modeThis parameter describes the payment category by which the transaction was completed/attempted by the customer. The values are: • Credit Card – CC • Debit Card – DC • Net Banking – NB • Cash Card – CASH • EMI – EMI • Cardless EMI – CLEMI • Buy Now Pay Later - BNPL
bankcodeThis parameter contains the code indicating the payment option used for the transaction. For example, Visa Debit Card – VISA, Master Debit Card – MAST.
statusThis parameter returns the status of the transaction and must be used to map the order status. Possible values are success, failure, or pending. The significance of the values for these values are: • Success: If the value of status parameter is 'success', the transaction is successful. • Failed: If the value of status parameter is 'failure' or 'pending', must only be treated as a failed transaction.
unmappedstatusThis parameter holds the status of a transaction in PayU's internal database, which can include intermediate states. Possible values include: dropped, bounced, captured, auth, failed, usercancelled, or pending. For information on status description, refer to Payment State Explanations.
keyThis parameter contains the merchant key.
errorFor the failed transactions, this parameter provides the reason for failure.
error_messageThis parameter contains the error message. For the list of error message, refer to Error Codes.
bank_ref_numFor each successful transaction – this parameter contains the bank reference number generated by the bank.
txnidThis parameter contains the transaction ID value posted by the merchant during the transaction request.
amountThis parameter contains the original amount which was sent in the transaction request by the merchant.
cardCategoryThis parameter contains the card category to indicate whether it is domestic or international.
discountThis parameter contains the discount amount by the merchant.
net_amount_debitThis parameter contains the net amount debited.
addedonThe transaction date and time of the transaction.
productinfoThis parameter contains the same value of product information which was sent in the transaction request from the merchant's end to PayU.
firstnameThis parameter contains the same value of first name which was sent in the transaction request from the merchant's end to PayU.
lastnameThis parameter contains the same value of last name which was sent in the transaction request from the merchant's end to PayU.
emailThis parameter contains the same value of email which was sent in the transaction request from the merchant's end to PayU.
phoneThis parameter contains the same value of phone which was sent in the transaction request from the merchant's end to PayU.
hashThis parameter is crucial and is similar to the hash parameter used in the transaction request. For more information, refer to Generate Hash.
PG_TYPEThis parameter gives information on the payment gateway used for the transaction.
udf1This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf2This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf3This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5 which was sent in the transaction request from the merchant's end to PayU.
udf4This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf5This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf6This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf7This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf8This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf9This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
field1
field2
field3
field4
field5
field6
field7
field8
field9
success_atThis parameter contains the date and timestamp when the transaction was successful.
cardnumThe parameter contains the card number masked and only last 4 digits are returned.
issuing_bankThe parameters contains the card issuing bank.

Step 2: Update Invoice ID [Conditional]

Case: 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>
Request parameters
Parameter Description Example
key Merchant key provided by PayU. For more information on checking your key and Salt, refer to Generate Merchant Key and Salt on PayUBiz Dashboard. Your Test Key
command The API command for this API, that is, opgsp_upload_invoice_awb must be specified for this parameter. opgsp_upload_invoice_awb
var1
(primaryKey)
mandatory
The PayU ID (mihpayuid) of the transaction must be specified in this field. The Invoice or AWB will be uploaded basis of the PayU ID. 403993715521937565
var2
(uniqueNumber)
mandatory
The invoice ID or AWB ID is specified in this parameter. Alphanumeric with special characters is allowed. 9eec02ac9e2efc335bdda2d7486121ce03de24c2fa7d32d17462ad5a6a9058db
var3
(uploadType)
mandatory
The type of document to be uploaded is specified in this field, and it can be any of the following:
  • Invoice
  • AWB
AWB
file
(attachment)
mandatory
The absolute path of the file to be uploaded is specified in this parameter. The maximum size supported is 2 MB and the following formats are supported:
  • PDF (.pdf)
  • Document (.doc or .docx)
  • Image (.jpg, .jpeg)
Note: The Merchant Dashboard supports only the .pdf and .docx formats.
C:invoice.docx
hash The hash is generated in the following format:
sha512(key|command|var1|salt) sha512
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

Refer to Response Code and Description - Invoice Upload API.

📘

Reference: For Try It experience of UDF Update API, refer to UDF Update API.

Step 3: Upload the Invoices

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.

Sample request for Cards
  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 request for 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_64240"' \
  --form 'var2="AAAPZ1234C||22/08/1972"' \
  --form 'var4="INV-123_1231||MerchantName"' \
  --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."
}
📘

Reference: For Invoice Upload API reference, refer to Invoice Upload API.


Ask AI Beta

Hi! I am an AI Assistant. Ask me about PayU and get help with your integration.
Responses are generated by AI, may contain some mistakes.

EXAMPLE QUESTIONS