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.
The current date and time. For example, format of the date is Wed, 28 Jun 2023 11:25:19 GMT.
authorization
The 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
Field
Description
username
Represents the username or identifier for the client or merchant, for example smsplus.
algorithm
Use SHA512 algorithm for hashing and send this as header value.
headers
Specifies which headers have been used in generating the hash, for example date.
signature
The 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:
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
Parameter
Description
Example
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
Field
Description
Example
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.