Refund

To use this API on production environment, send a request to devsupport@paytm.com with your production MID. Whitelisting is required to use this API due to security reasons

Use Case


To initiate partial or complete refund to source account from which the transaction was done

Request Attributes:

MID String(20) MandatoryThis is a unique identifier provided to every merchant by Paytm. MID is part of your account credentials and is different on staging and production environment. Your staging MIDs is available here & production MID will be available once your activation is complete
REFID String(50) MandatoryUnique reference ID for refund transaction which is generated by merchant . Duplicate REFID will be rejected by the Paytm gateway
TXNID String(64) MandatoryTXNID is Paytm payment transaction ID against which the refund transaction is being placed. TXNID is provided in response payload for every payment transaction
ORDERID String(50) MandatoryOrder ID is merchant’s unique reference ID against which the refund transaction is being placed. OrderID is provided by merchant in transaction request payload
REFUNDAMOUNT String(10) MandatoryAmount for which refund is supposed to be made. It can be equal to or lesser than the transaction amount. It should be upto two decimal place. Only special character allowed is (“.”)
TXNTYPE String MandatoryThis has fixed value for refund transaction - "REFUND"
CHECKSUM String(108) MandatorySignature to avoid tampering. Generated using server side checksum utility available here
COMMENTS String(50) OptionalComments can be given by merchant citing the reason for refund

Response Attributes:

MID String(20)This is a unique identifier provided to every merchant by Paytm
TXNID String(64)TXNID is Paytm payment transaction ID against which the refund transaction is being placed
ORDERID String(50)Order ID is merchant’s unique reference ID against which the refund transaction is being placed
REFUNDAMOUNT String(10)Amount for which refund is supposed to be made
TXNAMOUNT String(10)Order value of the transaction in INR
REFID String(50)Unique reference ID for refund transaction which is generated by merchant and sent in the request
STATUS String(20)This contains the status of refunds. It has following values: TXN_SUCCESS, TXN_FAILURE & PENDING
RESPCODE String(10)Codes refer to a particular reason of refund failure. These are detailed in the list provided below
RESPMSG String(500)Description message attached with each respcode. These are detailed in the list provided below
TXNDATE DateTimeDate of payment transaction in the format "yyyy-MM-dd HH:mm:ss.S"
Format - “2015-11-02 11:40:46.0”
CARD_ISSUER String(20)Name of issuing bank of the payment instrument used by customer. By paymodes, the details are provided below
Credit, debit cards, UPI - Name of the issuing bank. Example in case customer uses SBI's credit card, the value will be "SBI"
NB - empty string
Paytm Wallet - empty string
PAYMENTMODE String(15)The payment mode used by customer for transaction
Credit card – CC
Debit card - DC
Net banking - NB
UPI - UPI
Paytm wallet – PPI
REFUNDDATE DateTimeDate and timeof REFUND in the format "yyyy-MM-dd HH:mm:ss.S"
EX- “2015-11- 02 11:40:46.0”
REFUNDID String(64)This is a unique Paytm refund ID that is issued by Paytm for each refund request
BANKTXNID String(100)The transaction ID sent by the bank In case of Paytm proprietary instruments too, there is unique reference number generated by Paytm's system. In case the transaction does not reach the bank, this will be NULL or empty string. Primary reason for this is user dropping out of the payment flow before the transaction reaches to bank to servers
TOTALREFUNDAMT String(10)Total cummulative refund amount against this transaction. For example for a transaction with order value as INR 100, there has been two refunds of INR 20 & INR 30 historically, then TOTALREFUNDAMT will be INR 50

Refund Response Codes, Messages and Status

10Refund successfulTXN_SUCCESS
600Invalid refund requestTXN_FAILURE
501System errorTXN_FAILURE
607Order not exist for current requestTXN_FAILURE
640Order is frozenTXN_FAILURE
620Refund failedTXN_FAILURE
501System errorTXN_FAILURE
700Invalid consult requestTXN_FAILURE
328Currency not sameTXN_FAILURE
619Invalid refund amountTXN_FAILURE
622No_token-transcation_limitedTXN_FAILURE
617Refund already raisedTXN_FAILURE
612This is a valid authorized transactionTXN_FAILURE
606Checksum generated by Paytm payment gateway does not match checksum expected by bankTXN_FAILURE
609Refund initiated for a rejected transactionTXN_FAILURE
701Refund already raised with same refidTXN_FAILURE
702Not allowed to reprocess refund requestTXN_FAILURE
703Refund is already success or in pending state. Please check status query for final resultTXN_FAILURE
704Balance not enoughTXN_FAILURE

Checksum Generation Utility

For Web:

For App:

Endpoints

Staging: https://securegw-stage.paytm.in/refund/HANDLER_INTERNAL/REFUND

Production: https://securegw.paytm.in/refund/HANDLER_INTERNAL/REFUND

Request CodeResponse JSON
curl -X 
POST https://securegw-stage.paytm.in/refund/HANDLER_INTERNAL/REFUND -H
'content-type: application/json' -d 
'JsonData={"MID":"rxazcv89315285244163",
"ORDERID":"order1",
"TXNTYPE":"REFUND",
"REFUNDAMOUNT":"100.12",
"TXNID":"20180613111212800110168032128074895",
"REFID":"reforder1","CHECKSUM":"4xWjvYndYjRGwwFlzx7QvfeZhkOX3MN7o1pHvoGIjroKaaok/isIQWmo2aNYAs/vVLZ3t54wCVZ3+SKtiw17BHhtze8wfHDOIVwEp7bOf5g="}'