post https://test.payu.in/merchant/postservice.php
The Get TDR API (get_TDR API) is used to get the Transaction Discount Rate (TDR) value of a transaction with PayU. It is a simple API for which you need to provide the PayU ID of the transaction as input and the TDR value is returned in the output, var1 is Payu id (mihpayid) of the transaction.
Environment
Test Environment | https://test.payu.in/merchant/postservice.php?form=2 |
Production Environment | https://info.payu.in/merchant/postservice.php?form=2 |
Sample request
curl -X POST "https://test.payu.in/merchant/postservice?form=2" \
-H "accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=JP***g&command=get_TDR&var1=403993715521891555&hash=a0cf2d4ed3fb551388bd9e078f7ace8fb565d3240e06735cfc83330bb604b0f97a26a31160f1987af4ba5f78e126f400826a62d71337395e6e127b28a62b860d"
Sample response
Success scenario
{
"status": 1,
"msg": "Transaction Fetched Successfully",
"TDR_details": {
"TDR": 0
}
}
Failure scenario
If mihpayid is not found:
{
"status": 0,
"msg": "Invalid PayU ID"
}
Response parameters
Parameter | Description | Example |
---|---|---|
status |
This parameter returns the status of web service call. The status can be any of the following:
|
0 |
msg | This parameter returns the reason string. |
For example, any of the following messages are displayed:
|
TDR_details | This parameter contains the TDR information in JSON format. | {"TDR": 0} |
TDR_details.TDR | The Transaction Discount Rate value for the given transaction. | 0 |
Request parameters
Sample values
Use the following sample values while trying out the API:
- var1 (Payu ID/mihpayid): 403993715521891555