Instant Discount or Cashback using Merchant Hosted Checkout

With the Merchant Hosted Checkout integration, the entire payment experience can be controlled by merchants and PayU provides APIs to power this checkout experience. This section describes how PayU will help you to discover Offer (not only on Checkout page but anywhere on the merchant app/website), validate Offer & apply Offer (along with payment). ##

Customer journey on Merchant Hosted Checkout

The following video walks through the customer journey:

The steps involves in the customer journey are:

  1. User logs in to the merchant’s app/website.
  2. User chooses the product(s)/service(s) he/she wishes to purchase.

  1. User reaches the checkout page. The merchant can use the Fetch offers API to display all the live applicable offers for this transaction. As part of this API the merchant would get all the necessary information to display to the user regarding the offer include Offer Title, description, terms and conditions, applicable payment modes & the offer value.

  1. User would make his/her decision and pay through a specific payment option. After the customer has entered all the required details, the merchant can use the Validate Offer API to check whether the offer would be applied to the transaction or not.

  1. The merchant would initiate the payment along with the offer using the _payment API
  2. In case of Instant discount, the amount would be reduced on application of offer, in case of cashback the amount would not be charged.
  3. User would complete the 2FA (2 Form Authentication) payment on the adjusted amount.

  1. User would be redirected back to the merchant app/website.

The merchant can use the Fetch offers API to display the offers on Product Display Page & Cart screens or in case merchant wishes to have a separate Offers section on their website/app

Integration steps

To integrate offers using Merchant Hosted Checkout integration:

πŸ“˜

Reference:

For the Merchant Hosted Checkout workflow, refer Merchant Hosted Checkout

  1. On the checkout page (or earlier on PDP, Cart, Offers) use the Fetch Offers API to get the offers and display all the offers. For more information, refer to Fetch Offers API.
  2. Use the Validate Offer API to validate if the offer will be applied on this transaction or not. For more information, refer to Validate Offer API.
  3. Make the payment request using the _payment API using the following additional parameters for Offers. For more information on the complete list of parameters to be posted, refer to Collect Payment API - Merchant Hosted Checkout
ParameterDescriptionExample
api_version
mandatory
The API version of the _payment API must be specified as 14.14
user_token
mandatory for UPI, NB, Wallet
The use for this param is to allow the offer engine to apply velocity rules at a user level.

- Card Based Offers (CC, DC, EMI): In case of card payment mode offers, if this parameter is passed the velocity rules would be applied on this token, if not passed the same would be applied on the card number.
- UPI, NB, Wallet: It is mandatory for UPI, NB, and Wallet payment modes. If not passed the validation rules would not apply.
hash
mandatory
It is used to avoid the possibility of transaction tampering.
Note: The following order must be used for hashing:
key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10|offer_key|offer_auto_apply|SALT
For more information on hash generation process, refer to Generate Hash .

Notes: Β 

  • The following order must be used for hashing:
    key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10|offer_key|offer_auto_apply|SALT
    For more information on hash generation process, refer to Hashing Request and Response.
  • If any of the keys is null/not configured, "|" character must be concatenated.
  • The above hash logic is for _payment API version 10 or later
  1. Check the following response parameters (for Offers) from PayU to handle the payment response, as the net amount debit may be different from the amount sent by you in the request.
ParameterDescriptionExample
discountThis will specify the offer value provided to the user.10.00
net_amount_debitThis will specify the actual amount deducted from the customer’s payment instrument. In case of Instant discount this amount would be lesser than the amount passed by you in the request.100.00
offerThis parameter is used to post the offer key.newoffer1@5686
offer_typeThis parameter is used to post any of the following offer_type:
- instant

- cashback
instant

For a sample response, refer to the Additional Info for Payment APIs.

  1. Verify the payment.

Similar to the payment response, same params can be handled as part of the Verify Payment API. For more information, For API reference, refer to Verify Payment API. For the sample response using the Verify Payment API from PayU involving offers, refer to Additional Info for General APIsI.

ParameterDescriptionExample
transaction_amountThis parameter contains the total transaction amount before discount.50000.00
net_amount_debitThis parameter contains the actual amount deducted from the customer’s payment instrument. In case of Instant discount this amount would be lesser than the amount passed by you in the request.47500.00
discountThis parameter contains the offer value provided to the user. This value will specify the offer amount for both Instant discount and Cashback offers.2500.00

PayU would refund the exact amount passed by you in the Refund request. For more information, refer to Refunds for Offers

πŸ“˜

Note:

You can enable the Enforce Offer flag by requesting your PayU Key Account Manager. If you enable the Enforce Offer flag, the best offer out of the all the offers passed will be applied for the customer.