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.

Postman Collection

Accelerate your integration workflow with our Postman collection for PayU Hosted Checkout. Click the Download Postman Collection button below to download and get started.



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":"[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] =>
  )

Request parameters

📘

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.

Form Data
string
required
Defaults to JPM7Fg

Merchant key provided by PayU during onboarding.

string
required

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

integer
required

The payment amount for the transaction.

string
required

A brief description of the product.

string
required

The first name of the customer.

string
required

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

string
required

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

string
required

The email address of the customer.

string
required

The pg parameter determines which payment tabs will be displayed on the PayU page. For Buy Now Pay Later, use BNPL.

const
enum
required

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.

Allowed:
string
required

Use 13-19 digit card number for credit/debit cards (15 digits for AMEX, 13-19 for Maestro) and validate with LUHN algorithm. Use only test cards as in the example or that is listed in Test Cards, UPI ID and Wallets section..

string
required

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

string
required

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

string
required

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.

string
required

This parameter must contain the card’s expiry year – as entered by the customer for the transaction. It must be of four digits. Use 2025 in this field for Test environment.

string
required

It is used to avoid the possibility of transaction tampering. Hash formula: sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||

number

The phone number of the customer.

string

The last name of the customer.

string

This parameter is used to identify whether it is a B2B transaction. If 1 is posted, it is a B2B transaction.

string

The Cancel URL, which is the page PayU will redirect to if the transaction is cancelled by customer.

string

User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5.

string

User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5.

string

User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5.

string

User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5.

string

User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5.

Response

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain