• Getting Started
    • Mobile Integration (Android/IOS)
      Enterprise Solutions
      Accept Payments
      Process Payments
      Disbursals
      API References
      Webhooks
      Testing
      Refunds
      Guides
      Other Processes
      Mini Program Platform
        Website Integration

      post Refund API

      Use Case


      To initiate partial or complete refund of transaction done on Paytm payment gateway

      Request Attributes


      API Content Type: JSON

      Head1

      Head

      ATTRIBUTEDESCRIPTION
      clientId string(3)
      optional
      Paytm use the merchant key on the basis of clientId parameter value. It requires only if the merchant has more than one key.
      Example: C11
      version string(4)
      optional
      Version of the API.
      Example: v1
      requestTimestamp string(15)
      optional
      EPOCH timestamp of the time at which request is being sent.
      Example: 1588402269
      channelId string(3)
      optional
      The parameter value identifies the Channel for which API call is initiated.
      Possible Values: WEBFor websites, the value to be passed should be "WEB", WAPFor Mobile websites/App, the value to be passed should be "WAP"
      signature string(108)
      mandatory
      Paytm validates the parameter values by verifying the signature comes in the request. It ensures that parameter values are not tempered. Signature string can be created by using Paytm checksum library
      Body1

      Body

      ATTRIBUTEDESCRIPTION
      mid string(20)
      mandatory
      Paytm provides MID as a unique identifier to each merchant. For your staging MID, click here. You get the production MID post the account activation.
      Example: INTEGR7769XXXXXX9383
      orderId string(50)
      mandatory
      It is unique reference ID for a transaction passed in the transaction request. Order ID should be pass to raise the refund
      Example: OREDRID_98765
      refId string(50)
      mandatory
      Unique Reference Id for refund transaction which is generated by merchant. Duplicate REFID will be rejected by the Paytm gateway.
      Example: REFUNDID_98765
      txnId string(64)
      mandatory
      TXNID is Paytm payment Transaction Id against which the refund transaction is being placed. TXNID is provided in response payload for every payment transaction.
      Example: 202005081112128XXXXXX68470101509706
      refundAmount string
      mandatory
      Amount for which refund is to be made. It can be equal to or less than the transaction amount and should be upto two decimal places. Only special character allowed is (".")
      Example: 1.00
      txnType string
      mandatory
      Request type
      Possible Values: REFUND
      comments string(500)
      optional
      Comments can be given by merchant citing the reason for refund.
      preferredDestination string
      optional
      Merchant wants to take instant refund solution from Paytm
      Possible Values: TO_INSTANT

      Response Attributes


      API Content Type: JSON

      Head2

      Head

      ATTRIBUTEDESCRIPTION
      clientId string(3)
      Paytm use the merchant key on the basis of clientId parameter value. It requires only if the merchant has more than one key.
      Example: C11
      version string(2)
      Version of the API passed in the request.
      Example: v1
      responseTimestamp string(15)
      EPOCH timestamp of the time at which response is being sent.
      Example: 1588402269
      channelId string(3)
      The parameter value identifies the Channel for which API call is initiated.
      Possible Values: WEBFor websites, the value to be passed should be "WEB", WAPFor Mobile websites/App, the value to be passed should be "WAP"
      signature string(108)
      You should validate the parameter values by verifying the signature comes in the response. It ensures that parameter values not tempered. Signature string can be verified by using Paytm checksum library
      Body2

      Body

      ATTRIBUTEDESCRIPTION
      resultInfo object
      This parameter gives the information about the result of the API response
      ResultInfo +
      AttributeDescription
      resultCode string
      This is the resultCode corresponding to a particular message and is returned to the merchant. It's maximum length is 64. The different result codes corresponding to this API are mentioned below
      resultStatus string
      This parameter indicates the status of API call.
      Possible Values: TXN_FAILURE, PENDING
      resultMsg string(256)
      This parameter is the result message which contains information about the result.The different result messages corresponding to this API are mentioned below
      mid string(20)
      Paytm provides MID as a unique identifier to each merchant. For your staging MID, click here. You get the production MID post the account activation.
      Example: INTEGR7769XXXXXX9383
      orderId string(50)
      Order ID is merchant’s unique reference ID for a transaction that has sent in request.
      Example: OREDRID_98765
      refId string(50)
      Merchant's Reference Id unique for every refund transaction. This is REFID for which refund status is being inquired.
      Example: REFUNDID_98765
      refundAmount string
      Amount for which refund is to be made. It can be equal to or less than the transaction amount and should be upto two decimal places. Only special character allowed is (".")
      Example: 1.00
      refundId string(64)
      This is a unique Paytm Refund Id that is issued by Paytm for each refund request.
      Example: 123455081112128XXXXXX68470101509706
      txnId string(64)
      TXNID is Paytm payment Transaction Id against which the refund transaction is being placed.
      Example: 202005081112128XXXXXX68470101509706
      txnTimestamp string(20)
      Timestamp of payment transaction.
      Example: 2020-05-02 12:24:25.0

      Response Codes and Messages


      resultCoderesultStatusresultMsg
      501PENDINGSystem Error
      601PENDINGRefund request was raised for this transaction. But it is pending state.
      330TXN_FAILUREChecksum provided is invalid
      335TXN_FAILUREMid is invalid
      600TXN_FAILUREInvalid refund request.
      607TXN_FAILURERefund can not be initiated for a cancelled transaction.
      617TXN_FAILURERefund Already Raised (If merchant repeated their request within the 10 minutes after initiate the first refund request)
      619TXN_FAILUREInvalid refund amount
      626TXN_FAILUREAnother Refund on same order is already in Progress, please retry after few minutes
      627TXN_FAILUREOrder Details Mismatch
      628TXN_FAILURERefund request was raised to respective bank. But it is in pending state from bank side.
      629TXN_FAILURERefund is already Successful
      635TXN_FAILUREPartial Refund under Rupee 1 is not allowed
      StagingProduction
      REQUESTRESPONSE
      curl -X POST 'https://securegw-stage.paytm.in/refund/apply' \
      --header 'Content-Type: application/json' \
      --data '{"body":{"mid":"{mid}","txnType":"REFUND","orderId":"ORDERID_98765","txnId":"202005081112128XXXXXX68470101509706","refId":"REFUNDID_98765","refundAmount":"1.00"},"head":{"signature":"{signature}"}}'