Fetch Recommendation Engine API

Use this API to fetch the Recommendation Engine.

Endpoints


Request headers

FieldDescriptionExample
Date
mandatory
The date and time should be in the GMT time conversion(not the IST). For example, current time in India is 18:00:00 IST, the time in the date header should be 12:30:00 GMT.Thu, 17 Feb 2022 08:17:59 GMT
Digest
mandatory
Base 64 encode of (sha256 hash of the JSON data (post to server).vpGay5D/dmfoDupALPplYGucJAln9gS29g5Orn+8TC0=
Authorization
mandatory
This field is in the following format:
hmac username="smsplus", algorithm="hmac-sha256", headers="date digest", signature="CkGfgbho69uTMMOGU0mHWf+1CUAlIp3AjvsON9n9/E4="
Where the above format includes the following:

username: The merchant key of the merchant.

algorithm: This must have the value as hmac-sha256 that is used for this API

headers: This must have the value as date digest

signature: This must contain the hmacsha256 of (signing_string, merchant_secret), where:

signing_string: This is in the "Date"+"\n"+"Digest" format. Here, the Date and Digest is the same values in the fields listed in this table For example, "Thu, 17 Feb 2022 08:17:59 GMT""\n"+“vpGay5D/dmfoDupALPplYGucJAln9gS29g5Orn+8TC0=“

merchant_secret: The merchant Salt of the merchant. For more information on getting the merchant Salt, refer to Generate Merchant Key and Salt.
hmac username="smsplus", algorithm="hmac-sha256", headers="date digest", signature="zGmP5Zeqm1pxNa+d68DWfQFXhxoqf3st353SkYvX8HI="

Sample request

curl --location 'https://api.payu.in/recommendation/v1/fetch'\
--header 'Authorization: {{authorization}}' \ 
--header 'Date: {{date}}' \ 
--header 'Digest: {{digest}}' \ 
--header 'Content-Type: application/json' \ 
--data '{
        "amount":1000.50, \\ Mandatory - Transaction amount
        "phone":"8167585681", \\ Optional - Phone number of the user
        "transactionId":"ho8yihilu76rtgj", \\ Optional - Transaction ID
        "mode":null, \\ Optional - If you need recommendations at a mode level (Comma separated)
        "ibiboCode":null \\ Optional - If you need recommendations at an IBIBO code (Comma separated)
}'

Request parameters

ParameterDescriptionExample
amount
mandatory
Double The transaction amount.5000
userToken
mandatory
String Long This parameter is used to uniquely identify a user for a client/merchant.
phone
optional
String The phone number of the customer.8167580000
transactionId
optional
String The Unique payment ID for a transaction which is generated by merchant and sent in the request.
mode
optional
String Pass the payment mode as the value of this parameter if you need recommendations at payment mode level. See Supported payment modes.emi
ibiboCode
optional
String Pass the ibibo code as the value of this parameter if you need recommendations at ibibo code level.MOBIZIP

Response parameters

ParameterDescription
codeThis parameter returns the HTTP status code of the request.
messageThis parameter is the result message which contains information about the result.
statusThis parameter returns the status of web service call. The status can be any of the following:

0 - If web service call failed.

1 - If web service call succeeded.
resultJSON Object This parameter gives the information about the result of the API response in a JSON format.
result.savedPaymentOptionsThis field contains saved options corresponding to phone number
result.paymentOptionsThis field contains the payment options and corresponding Ibibo codes mapping sorted on merchant goals

Sample response

Merchant goal — Affordability

{
    "status": 1,
    "message": "payment options fetched successfully",
    "result": {
        "savedPaymentOptions": {
            "upi": [
                {
                    "pgId": 1,
                    "pgTitle": "PhonePe-98482xxxxx@ybl",
                    "pgDetails": "98482xxxxx@ybl",
                    "ibiboCode": "UPI",
                    "pgDisplay": true,
                    "userCredentials": null,
                    "pgUP": true,
                    "paymentMode": "upi"
                },
                {
                    "pgId": 4,
                    "pgTitle": "GooglePay-kxxxxxxxxxh@okhdfcbank",
                    "pgDetails": "kxxxxxxxxxh@okhdfcbank",
                    "ibiboCode": "UPI",
                    "pgDisplay": true,
                    "userCredentials": null,
                    "pgUP": true,
                    "paymentMode": "upi"
                }
            ],
            "nb": [],
            "cashcard": [],
            "pg_recency": [
                1,
                4
            ]
        },
        "paymentOptions": {
            "emi": [
                {
                    "cc": [
                        "KKBK",
                        "UTIB",
                        "BARB",
                        "CITI",
                        "HSBC",
                        "ICIC",
                        "INDB",
                        "RATN",
                        "SCBL",
                        "YESB",
                        "SBIN",
                        "AUSF",
                        "IDBI",
                        "IDFC",
                        "ONEC",
                        "HDFCDC"
                    ],
                    "dc": [
                        "KKBK",
                        "ICIC",
                        "SBIN",
                        "UTIB"
                    ],
                    "cardless": [
                        "HDFC_CL",
                        "ICICI_CL",
                        "ZESTMON"
                    ]
                }
            ],
            "bnpl": [
                "HDFCF15",
                "HDFCF30",
                "HDFCF60",
                "HDFCF90",
                "LAZYPAY"
            ],
            "upi": [
                "googlepay",
                "phonepe",
                "bhim",
                "paytm",
                "cred",
                "amazonpay",
                "whatsapp",
                "fimoney",
                "jupiter",
                "bajaj"
            ],
            "nb": [
                "HDFB",
                "ICIB",
                "AXIB",
                "YESB",
                "INIB",
                "SBIB",
                "FEDB",
                "CUBB",
                "CBIB",
                "KRVB",
                "OBCB",
                "PNBB",
                "UBIB",
                "IDBICORP",
                "IDBB",
                "KRKB",
                "SOIB",
                "JAKB",
                "DCBB",
                "INOB",
                "BOIB",
                "BOMB",
                "CSBN",
                "DSHB",
                "CABB",
                "SYNDB",
                "KRVBC",
                "INDB",
                "DLSB",
                "SRSWT",
                "UNIB",
                "CPNB",
                "UCOB",
                "TMBB",
                "LVRB",
                "CSMSNB",
                "JSBNB",
                "SVCNB",
                "TBON",
                "IDFCNB",
                "IDFNBTPV",
                "AIRNB",
                "RBLNB",
                "BBRB",
                "SCBNB",
                "ADBB",
                "CRPB",
                "UBIBC",
                "AUSFCNB"
            ],
            "cc": [
                "AMEX",
                "DINR",
                "CC",
                "RUPAYCC"
            ],
            "dc": [
                "MAST",
                "VISA",
                "RUPAY",
                "CITD",
                "MAES",
                "SMAE",
                "SMAST"
            ],
            "cashcard": [
                "AMON",
                "OLAM"
            ]
        }
    }
}
{
  "status": 1,
  "message": "payment options fetched successfully",
  "result": {
    "savedPaymentOptions": {
      "upi": [
        {
          "pgId": 1,
          "pgTitle": "PhonePe-98482xxxxx@ybl",
          "pgDetails": "98482xxxxx@ybl",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        },
        {
          "pgId": 4,
          "pgTitle": "GooglePay-kxxxxxxxxxh@okhdfcbank",
          "pgDetails": "kxxxxxxxxxh@okhdfcbank",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        }
      ],
      "cashcard": [],
      "nb": [],
      "pg_recency": [
        1,
        4
      ]
    },
    "paymentOptions": {
      "bnpl": [
        "LAZYPAY",
        "HDFCF30",
        "HDFCF15",
        "HDFCF60",
        "HDFCF90"
      ],
      "emi": [
        {
          "cc": [
            "KKBK",
            "ICIC",
            "YESB",
            "AUSF",
            "BARB",
            "CITI",
            "UTIB",
            "HSBC",
            "INDB",
            "RATN",
            "SCBL",
            "IDBI",
            "IDFC",
            "ONEC",
            "SBIN",
            "HDFCDC"
          ],
          "dc": [
            "UTIB",
            "ICIC",
            "KKBK",
            "SBIN"
          ],
          "cardless": [
            "ZESTMON",
            "HDFC_CL",
            "ICICI_CL"
          ]
        }
      ],
      "upi": [
                "googlepay",
                "phonepe",
                "bhim",
                "paytm",
                "cred",
                "amazonpay",
                "whatsapp",
                "fimoney",
                "jupiter",
                "bajaj"
            ],
      "cc": [
        "CC",
        "AMEX",
        "RUPAYCC",
        "DINR"
      ],
      "dc": [
        "MAST",
        "VISA",
        "RUPAY",
        "CITD",
        "MAES",
        "SMAE",
        "SMAST"
      ],
      "cashcard": [
        "OLAM",
        "AMON"
      ],
      "nb": [
        "RBLNB",
        "ICIB",
        "AXIB",
        "SOIB",
        "SBIB",
        "INOB",
        "HDFB",
        "BOMB",
        "INDB",
        "TMBB",
        "SVCNB",
        "BBRB",
        "SCBNB",
        "YESB",
        "INIB",
        "IDBB",
        "KRKB",
        "JAKB",
        "DCBB",
        "BOIB",
        "FEDB",
        "CSBN",
        "DSHB",
        "CUBB",
        "CBIB",
        "CABB",
        "SYNDB",
        "KRVB",
        "KRVBC",
        "DLSB",
        "SRSWT",
        "OBCB",
        "PNBB",
        "UNIB",
        "CPNB",
        "UCOB",
        "LVRB",
        "CSMSNB",
        "JSBNB",
        "TBON",
        "IDFCNB",
        "IDFNBTPV",
        "AIRNB",
        "ADBB",
        "CRPB",
        "UBIB",
        "UBIBC",
        "IDBICORP",
        "AUSFCNB"
      ]
    }
  }
}
{
  "status": 1,
  "message": "payment options fetched successfully",
  "result": {
    "savedPaymentOptions": {
      "upi": [
        {
          "pgId": 1,
          "pgTitle": "PhonePe-98482xxxxx@ybl",
          "pgDetails": "98482xxxxx@ybl",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        },
        {
          "pgId": 4,
          "pgTitle": "GooglePay-kxxxxxxxxxh@okhdfcbank",
          "pgDetails": "kxxxxxxxxxh@okhdfcbank",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        }
      ],
      "cashcard": [],
      "nb": [],
      "pg_recency": [
        1,
        4
      ]
    },
    "paymentOptions": {
      "bnpl": [
        "LAZYPAY",
        "HDFCF30",
        "HDFCF15",
        "HDFCF60",
        "HDFCF90"
      ],
      "upi": [
                "googlepay",
                "phonepe",
                "bhim",
                "paytm",
                "cred",
                "amazonpay",
                "whatsapp",
                "fimoney",
                "jupiter",
                "bajaj"
            ],
      "cc": [
        "CC",
        "AMEX",
        "RUPAYCC",
        "DINR"
      ],
      "dc": [
        "MAST",
        "VISA",
        "RUPAY",
        "CITD",
        "MAES",
        "SMAE",
        "SMAST"
      ],
      "emi": [
        {
          "cc": [
            "ICIC",
            "KKBK",
            "YESB",
            "AUSF",
            "BARB",
            "CITI",
            "UTIB",
            "HSBC",
            "INDB",
            "RATN",
            "SCBL",
            "IDBI",
            "IDFC",
            "ONEC",
            "SBIN",
            "HDFCDC"
          ],
          "dc": [
            "UTIB",
            "ICIC",
            "KKBK",
            "SBIN"
          ],
          "cardless": [
            "ZESTMON",
            "HDFC_CL",
            "ICICI_CL"
          ]
        }
      ],
      "cashcard": [
        "OLAM",
        "AMON"
      ],
      "nb": [
        "RBLNB",
        "ICIB",
        "AXIB",
        "SOIB",
        "SBIB",
        "INOB",
        "HDFB",
        "BOMB",
        "INDB",
        "TMBB",
        "SVCNB",
        "BBRB",
        "SCBNB",
        "YESB",
        "INIB",
        "IDBB",
        "KRKB",
        "JAKB",
        "DCBB",
        "BOIB",
        "FEDB",
        "CSBN",
        "DSHB",
        "CUBB",
        "CBIB",
        "CABB",
        "SYNDB",
        "KRVB",
        "KRVBC",
        "DLSB",
        "SRSWT",
        "OBCB",
        "PNBB",
        "UNIB",
        "CPNB",
        "UCOB",
        "LVRB",
        "CSMSNB",
        "JSBNB",
        "TBON",
        "IDFCNB",
        "IDFNBTPV",
        "AIRNB",
        "ADBB",
        "CRPB",
        "UBIB",
        "UBIBC",
        "IDBICORP",
        "AUSFCNB"
      ]
    }
  }
}

Merchant goal — Success rate

{
  "status": 1,
  "message": "payment options fetched successfully",
  "result": {
    "savedPaymentOptions": {
      "upi": [
        {
          "pgId": 1,
          "pgTitle": "PhonePe-98482xxxxx@ybl",
          "pgDetails": "98482xxxxx@ybl",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        },
        {
          "pgId": 4,
          "pgTitle": "GooglePay-kxxxxxxxxxh@okhdfcbank",
          "pgDetails": "kxxxxxxxxxh@okhdfcbank",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        }
      ],
      "nb": [],
      "cashcard": [
        {
          "pgId": 16,
          "pgTitle": "Paytm",
          "pgDetails": "-",
          "ibiboCode": "PAYTM",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "cashcard",
          "phoneNumber": "9848250640"
        }
      ],
      "pg_recency": [
        1,
        4,
        16
      ]
    },
    "paymentOptions": {
      "upi": [
                "googlepay",
                "phonepe",
                "bhim",
                "paytm",
                "cred",
                "amazonpay",
                "whatsapp",
                "fimoney",
                "jupiter",
                "bajaj"
            ],
      "cc": [
        "CC",
        "AMEX",
        "RUPAYCC",
        "DINR"
      ],
      "dbqr": [
        "UPIDBQR",
        "MCCDBQR",
        "MDCDBQR",
        "RCCDBQR",
        "RDCDBQR",
        "VCCDBQR",
        "VDCDBQR"
      ],
      "dc": [
        "VISA",
        "MAST",
        "RUPAY",
        "MAES"
      ],
      "nb": [
        "SBIB",
        "ICIB",
        "AXIB",
        "YESB",
        "SRSWT",
        "INDB",
        "HDFB",
        "162B",
        "FEDB",
        "UBIB",
        "IDBB",
        "IDFCNB",
        "INIB",
        "KRKB",
        "SVCNB",
        "UBIBC",
        "PNBB",
        "CPNB",
        "INOB",
        "BBRB",
        "CBIB",
        "DSHB",
        "CABB",
        "CUBB",
        "AIRNB",
        "KRVB",
        "DCBB",
        "CSBN",
        "JAKB",
        "SOIB",
        "IDBICORP",
        "CSMSNB",
        "UCOB",
        "BOMB",
        "TMBB",
        "BOIB",
        "KRVBC",
        "KTKBCORP",
        "SYNDB",
        "DLSB",
        "OBCB",
        "UNIB",
        "LVRB",
        "JSBNB",
        "TBON",
        "SCBNB",
        "ADBB",
        "CRPB"
      ],
      "cashcard": [
        "PHONEPE",
        "PAYTM",
        "AMZPAY",
        "MOBIKWIK",
        "AMON",
        "YESW",
        "FREC",
        "JIOM",
        "OLAM"
      ],
      "bnpl": [
        "MOBIZIP",
        "HDFCF15",
        "HDFCF30",
        "HDFCF60",
        "HDFCF90"
      ]
    }
  }
}
{
  "status": 1,
  "message": "payment options fetched successfully",
  "result": {
    "savedPaymentOptions": {
      "upi": [
        {
          "pgId": 1,
          "pgTitle": "PhonePe-98482xxxxx@ybl",
          "pgDetails": "98482xxxxx@ybl",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        },
        {
          "pgId": 4,
          "pgTitle": "GooglePay-kxxxxxxxxxh@okhdfcbank",
          "pgDetails": "kxxxxxxxxxh@okhdfcbank",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        }
      ],
      "nb": [],
      "cashcard": [
        {
          "pgId": 16,
          "pgTitle": "Paytm",
          "pgDetails": "-",
          "ibiboCode": "PAYTM",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "cashcard",
          "phoneNumber": "9848250640"
        }
      ],
      "pg_recency": [
        1,
        4,
        16
      ]
    },
    "paymentOptions": {
      "dbqr": [
        "UPIDBQR",
        "MCCDBQR",
        "MDCDBQR",
        "RCCDBQR",
        "RDCDBQR",
        "VCCDBQR",
        "VDCDBQR"
      ],
      "upi": [
                "googlepay",
                "phonepe",
                "bhim",
                "paytm",
                "cred",
                "amazonpay",
                "whatsapp",
                "fimoney",
                "jupiter",
                "bajaj"
            ],
      "cc": [
        "CC",
        "AMEX",
        "DINR",
        "RUPAYCC"
      ],
      "dc": [
        "RUPAY",
        "MAST",
        "VISA",
        "MAES"
      ],
      "bnpl": [
        "MOBIZIP",
        "HDFCF15",
        "HDFCF30",
        "HDFCF60",
        "HDFCF90"
      ],
      "nb": [
        "INOB",
        "CUBB",
        "SBIB",
        "UBIB",
        "TMBB",
        "SVCNB",
        "AIRNB",
        "SOIB",
        "DSHB",
        "SCBNB",
        "AXIB",
        "IDBB",
        "HDFB",
        "CBIB",
        "CABB",
        "162B",
        "PNBB",
        "IDFCNB",
        "CSBN",
        "DLSB",
        "OBCB",
        "UNIB",
        "CPNB",
        "CSMSNB",
        "KRKB",
        "KRVB",
        "CRPB",
        "KRVBC",
        "SRSWT",
        "KTKBCORP",
        "IDBICORP",
        "ICIB",
        "YESB",
        "INIB",
        "JAKB",
        "DCBB",
        "BOIB",
        "BOMB",
        "FEDB",
        "SYNDB",
        "INDB",
        "UCOB",
        "LVRB",
        "JSBNB",
        "TBON",
        "BBRB",
        "ADBB",
        "UBIBC"
      ],
      "cashcard": [
        "AMZPAY",
        "MOBIKWIK",
        "AMON",
        "PHONEPE",
        "OLAM",
        "YESW",
        "FREC",
        "JIOM",
        "PAYTM"
      ]
    }
  }
}
{
  "status": 1,
  "message": "payment options fetched successfully",
  "result": {
    "savedPaymentOptions": {
      "upi": [
        {
          "pgId": 1,
          "pgTitle": "PhonePe-98482xxxxx@ybl",
          "pgDetails": "98482xxxxx@ybl",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        },
        {
          "pgId": 4,
          "pgTitle": "GooglePay-kxxxxxxxxxh@okhdfcbank",
          "pgDetails": "kxxxxxxxxxh@okhdfcbank",
          "ibiboCode": "UPI",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "upi"
        }
      ],
      "nb": [],
      "cashcard": [
        {
          "pgId": 16,
          "pgTitle": "Paytm",
          "pgDetails": "-",
          "ibiboCode": "PAYTM",
          "pgDisplay": true,
          "userCredentials": null,
          "pgUP": true,
          "paymentMode": "cashcard",
          "phoneNumber": "9848250640"
        }
      ],
      "pg_recency": [
        1,
        4,
        16
      ]
    },
    "paymentOptions": {
      "dbqr": [
        "UPIDBQR",
        "MCCDBQR",
        "MDCDBQR",
        "RCCDBQR",
        "RDCDBQR",
        "VCCDBQR",
        "VDCDBQR"
      ],
      "upi": [
                "googlepay",
                "phonepe",
                "bhim",
                "paytm",
                "cred",
                "amazonpay",
                "whatsapp",
                "fimoney",
                "jupiter",
                "bajaj"
            ],
      "cc": [
        "CC",
        "AMEX",
        "DINR",
        "RUPAYCC"
      ],
      "dc": [
        "RUPAY",
        "MAST",
        "VISA",
        "MAES"
      ],
      "bnpl": [
        "MOBIZIP",
        "HDFCF15",
        "HDFCF30",
        "HDFCF60",
        "HDFCF90"
      ],
      "nb": [
        "INOB",
        "CUBB",
        "SBIB",
        "UBIB",
        "TMBB",
        "SVCNB",
        "AIRNB",
        "SOIB",
        "DSHB",
        "SCBNB",
        "AXIB",
        "IDBB",
        "HDFB",
        "CBIB",
        "CABB",
        "162B",
        "PNBB",
        "IDFCNB",
        "CSBN",
        "DLSB",
        "OBCB",
        "UNIB",
        "CPNB",
        "CSMSNB",
        "KRKB",
        "KRVB",
        "CRPB",
        "KRVBC",
        "SRSWT",
        "KTKBCORP",
        "IDBICORP",
        "ICIB",
        "YESB",
        "INIB",
        "JAKB",
        "DCBB",
        "BOIB",
        "BOMB",
        "FEDB",
        "SYNDB",
        "INDB",
        "UCOB",
        "LVRB",
        "JSBNB",
        "TBON",
        "BBRB",
        "ADBB",
        "UBIBC"
      ],
      "cashcard": [
        "AMZPAY",
        "MOBIKWIK",
        "AMON",
        "PHONEPE",
        "OLAM",
        "YESW",
        "FREC",
        "JIOM",
        "PAYTM"
      ]
    }
  }
}

Supported payment modes

  • netbanking
  • debitcard
  • creditcard
  • emi
  • upi
  • bnpl
  • cashcard {For wallet}