BNPL

Buy Now Pay Later (BNPL) allows your customers to spread their payments over a relatively short period instead of paying upfront. You can collect payments from customers with BNPL using the Merchant Hosted Checkout integration.

You can collect payments from customers in EMI using the Merchant Hosted integration. You need to ensure that BNPL for the pg parameter and BNPL code based on the provider and tenure for the bankcode parameter is posted.

Environment

Environment

Sample request
curl -X POST "https://test.payu.in/_payment" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "key=J****g&txnid=5jJ9xYceXX1ydT&amount=1000.00&firstname=Ashish&[email protected]&phone=9876543210&productinfo=iPhone&pg=BNPL&bankcode=LAZYPAY&surl=https://apiplayground-response.herokuapp.com/&furl=https://apiplayground-response.herokuapp.com/&hash=6840ba0d1a14554f7ee5d20966dfbac6b221718e72dd823f05b6da01420286315b4956c28325898b66520b111604020ea2c547608606674766eb7e4164dc0baa"
Sample response
Array
(
    [mihpayid] => 403993715523409521
    [mode] => BNPL
    [status] => success
    [unmappedstatus] => captured
    [key] => J****g
    [txnid] => 5jJ9xYceXX1ydT
    [amount] => 1000.00
    [discount] => 0.00
    [net_amount_debit] => 1000
    [addedon] => 2021-07-02 15:03:50
    [productinfo] => iPhone
    [firstname] => PayU User
    [lastname] => 
    [address1] => 
    [address2] => 
    [city] => 
    [state] => 
    [country] => 
    [zipcode] => 
    [email] => [email protected]
    [phone] => 9876543210
    [udf1] => 
    [udf2] => 
    [udf3] => 
    [udf4] => 
    [udf5] => 
    [udf6] => 
    [udf7] => 
    [udf8] => 
    [udf9] => 
    [udf10] => 
    [hash] => 716f92a6452adadba68d133ba7f5ca3f3403f03f554e3ef850911f3e6727ee73402b249054170ad276c8b55ca12368a5e27cc69ffb0642ef6403dae9a5708794
    [field1] => 9876543210
    [field2] => 5jJ9xRceXX1ydT
    [field3] => 
    [field4] => PayU User
    [field5] => AXIhh4ExnaJ9dKiJvPxsewHwxMMmT3ba7UY
    [field6] => 
    [field7] => Transaction completed successfully
    [field8] => 
    [field9] => Transaction completed successfully
    [payment_source] => payu
    [PG_TYPE] => BNPL-PG
    [bank_ref_num] => 5jJ9xRceXX1ydT
    [bankcode] => LAZYPAY
    [error] => E000
    [error_Message] => No Error
)
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.
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.

Request parameters

Additional info for request parameters
ParameterReference
keyFor more information on how to generate the Key and Salt, refer to any of the following:

- Production: Generate Merchant Key and Salt

- Test: Generate Test Merchant Key and Salt
hashHash logic for _payment API is:
sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT)
For more information about the hash generation process, refer to Generate Hash.

📘

Reference

For the character limit of each parameter and detailed description, refer to Additional Info for Payment APIs.

🚧

🚧

Values to be used in Test environment

  • To use your mobile number for testing with Lazypay as bankcode, contact PayU Support to whitelist your mobile number.
  • Use the following values with HDFC as BNPL provider:
    • Card number: 4234567890056334
    • Phone number: 9123412345
    • OTP: 123456
  • For the complete test credentials, refer to Test Cards.

❗️

Error handling

If any error message is displayed with an error code, refer to the Error Codes section to understand the reason for these error codes.

Language
Click Try It! to start a request and see the response here!