Get Checkout Details API

The Get Checkout Details (get_checkout_details) API is a generic API using which they can get information when you create the custom checkout pages, that will contain the payment options, offers, recommendations, and downtime details. The API provides the following details:

  • Payment option details: The extended details for each payment option are available for the merchant.
  • Additional charges: The additional charges are configured for all payment options.
    eligibility details
  • Downtime details: The downtime status of the payment options.

Environment

Request headers

ParameterDescription
dateThe current date and time. For example, format of the date is Wed, 28 Jun 2023 11:25:19 GMT.
authorizationThe actual HMAC signature generated using the specified algorithm (sha512) and includes the hashed data. For more information, refer to authorization fields description.

authorization fields description

FieldDescription
usernameRepresents the username or identifier for the client or merchant, for example smsplus.
algorithmUse SHA512 algorithm for hashing and send this as header value.
headersSpecifies which headers have been used in generating the hash, for example date.
signatureThe HMAC signature generated using the specified algorithm. For more information, refer to hashing algorithm.

hashing algorithm

You must hash the request parameters using the following hash logic:

Hash logic: sha512(<Body data> + '|' + date + '|' + merchant_secret)

Where <Body data> contains the request body posted with the request.

Sample header code
var merchant_key = 'smsplus';
var merchant_secret = 'izF09TlpX4ZOwmf9MvXijwYsBPUmxYHD';
// date
var date = new Date();
date = date.toUTCString();

// authorization
var authorization = getAuthHeader(date);

function getAuthHeader(date) {
    var AUTH_TYPE = 'sha512';
    var data = isEmpty(request['data']) ? "" : request['data'];
    var hash_string = data + '|' + date + '|' + merchant_secret;
    var hash = CryptoJS.SHA512(hash_string).toString(CryptoJS.enc.Hex);
    return `hmac username="${merchant_key}", algorithm="${AUTH_TYPE}", headers="date", signature="${hash}"`;
}

Request parameters

ParameterDescriptionExample
key
mandatory
String The merchant key provided by PayU.JPM7Fg
requestData
mandatory
JSON Object A JSON object containing detailed request information.See JSON fields table below

requestData JSON Fields

FieldDescriptionExample
requestId
mandatory
String A unique identifier for the request.12345678
transactionDetails
mandatory
JSON Object Details about the transaction.See sub-fields below
transactionDetails.amount
mandatory
Number The transaction amount.12345.12
useCase
optional
JSON Object Specific use cases for the API.See sub-fields below
useCase.getExtendedPaymentDetails
optional
Boolean Whether to fetch extended payment details.true
useCase.checkCustomerEligibility
optional
Boolean Whether to check customer eligibility for payment options.true
customerDetails
optional
JSON Object Details about the customer.See sub-fields below
customerDetails.mobile
optional
String Mobile number of the customer.9098765432
filters
optional
JSON Object Filters to apply on the payment options.See sub-fields below
filters.paymentOptions
optional
JSON Object Filters for specific payment options.See sub-fields below
filters.paymentOptions.emi
optional
JSON Object Filters for EMI options.See sub-fields below
filters.paymentOptions.emi.dc
optional
String Comma-separated list of bank codes for debit card EMI.SBIN,KKBK,ICIC

Sample Request (cURL)

curl --location 'https://info.payu.in/v3/checkout/details' \
--header 'Content-Type: application/json' \
--header 'date: {{date}}' \
--header 'Authorization: {{authorization}}' \
--data '{
  "requestId": "12345678",
  "transactionDetails": {
    "amount": 12345.12
  },
  "useCase": {
    "getExtendedPaymentDetails": true,
    "checkCustomerEligibility": true
  },
  "customerDetails": {
    "mobile": "9098765432"
  },
  "filters": {
    "paymentOptions": {
      "emi": {
        "dc": "SBIN,KKBK,ICIC"
      }
    }
  }
}'

Sample Response

Success Response

{
  "status": 1,
  "message": "Success",
  "result": {
    "requestId": "12345678",
    "paymentOptions": {
      "cards": {
        "status": true,
        "credit": {
          "status": true,
          "details": [
            {
              "bankCode": "HDFC",
              "bankName": "HDFC Bank",
              "isDown": false,
              "downSince": "",
              "expectedUpTime": "",
              "downMessage": ""
            }
          ]
        },
        "debit": {
          "status": true,
          "details": [
            {
              "bankCode": "SBIN",
              "bankName": "State Bank of India",
              "isDown": false,
              "downSince": "",
              "expectedUpTime": "",
              "downMessage": ""
            }
          ]
        }
      },
      "netBanking": {
        "status": true,
        "details": [
          {
            "bankCode": "HDFC",
            "bankName": "HDFC Bank",
            "isDown": false,
            "downSince": "",
            "expectedUpTime": "",
            "downMessage": ""
          }
        ]
      },
      "emi": {
        "status": true,
        "credit": {
          "status": true,
          "details": [
            {
              "bankCode": "ICIC",
              "bankName": "ICICI Bank",
              "isDown": false,
              "tenures": [3, 6, 9, 12],
              "minAmount": 3000
            }
          ]
        },
        "debit": {
          "status": true,
          "details": [
            {
              "bankCode": "SBIN",
              "bankName": "State Bank of India",
              "isDown": false,
              "tenures": [3, 6, 9],
              "minAmount": 5000
            }
          ]
        }
      },
      "upi": {
        "status": true,
        "isDown": false
      },
      "wallet": {
        "status": true,
        "details": [
          {
            "walletCode": "PAYZ",
            "walletName": "Payzapp",
            "isDown": false
          }
        ]
      }
    }
  }
}

Error Response

{
  "status": 0,
  "message": "Invalid request parameters",
  "error_code": "E1001"
}

Response Parameters

ParameterDescriptionExample
statusStatus of the API call. 1 for success, 0 for failure.1
messageStatus message of the API call.Success
resultJSON object containing the checkout details.See JSON fields table below
error_codeError code in case of failure.E1001

result JSON Fields

FieldDescriptionExample
requestIdThe request ID provided in the request.12345678
paymentOptionsJSON object containing various payment options available.See sub-fields below
paymentOptions.cardsDetails about card payment options.See sub-fields below
paymentOptions.netBankingDetails about net banking payment options.See sub-fields below
paymentOptions.emiDetails about EMI payment options.See sub-fields below
paymentOptions.upiDetails about UPI payment options.See sub-fields below
paymentOptions.walletDetails about wallet payment options.See sub-fields below