This API is retrieve detailed information about a specific transaction using the merchant transaction ID. This API provides comprehensive transaction data including status, amount, settlement details, and associated metadata.
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 table below.
authorization fields description
Parameter
Description
username
Represents the username or identifier for the client or merchant, in this case, it's "smsplus".
algorithm
Use SHA512 algorithm for hashing and send this as header value.
headers
Specifies which headers have been used in generating the hash. In this case, only the "date" header is used.
signature
The actual HMAC signature generated using the specified algorithm (sha512) and includes the hashed data. For more information, refer to hashing algorithm.
hashing algorithm
You must hash the request parameters using the following hash logic:
sha512(<Body data> + '|' + date + '|' + merchant_secret}
Where, <Body data> contains the request Body posted with the request.
Sample authorization header code
var merchant_key = '<merchant_key>';
var merchant_secret = '<merchant_salt>';
// date
var date = new Date();
// var date = "Wed, 28 Jun 2023 11:25:19 GMT";
date = date.toUTCString();
// authorization
var authorization = getAuthHeader(date);
console.log(authorization);
function getAuthHeader(date) {
var AUTH_TYPE = 'sha512';
var data = isEmpty(request['data'])?"":request['data'];
var hash_string = data + '|' + date + '|' + merchant_secret;
console.log("Hash String is ", hash_string);
var hash = CryptoJS.SHA512(hash_string).toString(CryptoJS.enc.Hex);
var authHeader = 'hmac username="' + merchant_key + '", ' + 'algorithm="' + AUTH_TYPE + '", headers="date", signature="' + hash + '"'
return authHeader;
}
pm.environment.set('date', date);
pm.environment.set('authorization', authorization);
pm.environment.set('merchant_key',merchant_key);
pm.environment.set('merchant_secret',merchant_secret);
function isEmpty(obj) {
for(var key in obj) {
if(obj.hasOwnProperty(key))
return false;
}
return true;
}
Query Parameters
Parameter
Description
Example
merchantTransactionId mandatory
String The tramnsaaction ID of the transaction.
ZTDUPI2602754D96F47B
Other Header Parameters
Parameter
Description
Example
mid mandatory
String Merchant identifier that the integration was registered with
Merchant identifier assigned by PayU to uniquely identify the merchant account. This is the same ID used for authentication and API access.
merchantTransactionId
Merchant's unique transaction reference provided during the original payment request. This is the merchant-generated identifier used to track the transaction in their system.
payuId
PayU's internal unique transaction identifier. This is generated by PayU for every transaction and can be used for future transaction inquiries, refunds, or support requests.
transactionType
Type of transaction action processed. Common values include: capture (successful payment), refund, chargeback, adjustment, cancel, etc.
settlementStatus
Current settlement status of the transaction. Possible values: Settled (amount transferred to merchant), Pending (awaiting settlement), On Hold, Failed, etc. For description of the various settlement status, refer to List of Unmapped Status
settlementUTR
Unique Transaction Reference (UTR) number generated by the bank for the settlement transfer. This is the bank reference for the actual money transfer to the merchant's account.
settlementDate
Date and time when the settlement was completed. Format: YYYY-MM-DDTHH:MM:SS. Represents when the funds were actually transferred to the merchant's bank account.
settlementId
PayU's internal settlement batch identifier. This groups multiple transactions that were settled together in the same batch. Format typically includes merchant ID + date + sequence number.
settlementAmount
Final amount settled to the merchant after deducting all applicable fees, taxes, and adjustments. This is the net amount that was actually transferred to the merchant's account.
List of Unmapped Status
Unmapped Status
Status
Description
auth
Success
Auth refers to a transaction that has been authorized by the bank, where the amount is blocked on the customer's account but not yet captured by the merchant.
capture
Success
Capture refers to the transaction where the previously authorized amount is successfully collected from the customer, completing the payment.
cancel
Failure
This status is used when an authorized transaction is canceled before capture, and the blocked amount is released back to the customer.
refund
Success
Refund refers to the process where a captured (successful) transaction amount is returned back to the customer, either fully or partially.
refundreversal
Failure
Refund Reversal occurs when a previously initiated refund is canceled or fails, resulting in the amount being retained by the merchant.
chargeback
Failure
Chargeback occurs when a customer disputes a transaction with their bank, leading to the amount being debited from the merchant and returned to the customer.
chargebackreversal
Success
Chargeback Reversal occurs when the merchant successfully contests a chargeback and the disputed amount is returned back to the merchant.
Updated 18 days ago
Updated 18 days ago
Ask AI
Beta
Hi! I am an AI Assistant. Ask me about PayU and get help with your integration.