• 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

      paytmPayment JS API

      Use Case


      This method can be used to invoke paytm payment option, user will be able to see all the available payment options, after successful transaction client side will receive the callback.


      Request Attributes

      Content format: JSON

      ParameterDescriptionRequiredExample Value
      amountAmount to be paid by customer in INRYes1.00
      orderIdUnique reference ID for a transaction which is generated by merchant and sent in the requestyes0071490615
      txnTokenIt is the security token generated by Initiate Transaction API for a transaction. It is valid for 15 minutes.Yesfe795335ed3049c78a57271075f2199e1526969112097
      midThis is a unique identifier provided to every merchant by PaytmYesABCdj00008000000

      Response Attributes

      Success:

      ParameterDescriptionExample Value
      ORDERIDUnique reference ID for a transaction which is generated by merchant and sent in the request0071490615
      MIDThis is a unique identifier provided to every merchant by PaytmABCdj00008000000
      TXNIDThis is a unique Paytm transaction ID that is issued by Paytm for each transaction20191001111212800110168390621570
      TXNAMOUNTAmount to be paid by customer in INR1.00
      PAYMENTMODEThe payment mode used by customer for transaction. Possible values are:CREDIT_CARD, DEBIT_CARD, NET_BANKING, BALANCE, UPI, UPI_INTENT, EMI.

      For Intelligent Router, possible values are: CREDIT_CARD, DEBIT_CARD NET_BANKING, UPI, WALLET
      UPI
      CURRENCYCurrency in which the transaction has taken place. Currently only "INR" is the supported currency of transactionINR
      TXNDATEDate and Time of transaction in the format "yyyy-MM-dd HH:mm:ss.S"Example: "2015-11- 02 11:40:46.0"2019-10-01 11:44:57.0
      STATUSThis contains the transaction status and has only three values: TXN_SUCCESS, TXN_FAILURE and PENDINGTXN_SUCCESS
      RESPCODECodes refer to a particular reason of payment failure/success.01
      RESPMSGDescription message is linked with each respcodeTxn Success
      GATEWAYNAMEGateway used by Paytm to process the transactions. By paymodes, the details are provided below
      Credit, Debit cards, UPI - Gateway used to process the transaction. For example, if HDFC gateway has been used to process SBI credit card transactions, the value will be HDFC
      Net banking - Netbanking transactions are not routed via gateway. Hence issuing bank name is passed in this field Paytm Wallet - The value will be 'WALLET' Paytm Postpaid - The value will be 'PAYTMCC'
      HDFC
      BANKTXNIDThe 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 servers92743573212
      CHECKSUMHASHSecurity parameter to avoid tampering. Verified using server side checksum utility provided by Paytm. Utilities to generate checksumhash is available here68mwQa9x8uRPPCIDyH

      Error Responses:

      ParameterDescriptionExample Value
      error.codeError code2
      error.messageError messageFailed to login

      Error Codes

      RESPCODESTATUSRESPMSG
      01TXN_SUCCESSTxn Success
      -2FAILUREFailed to login!
      2FAILUREInsufficient parameters
      227TXN_FAILUREYour payment has been declined by your bank. Please contact your bank for any queries. If money has been deducted from your account, your bank will inform us within 48 hrs and we will refund the same.
      235TXN_FAILUREWallet balance Insufficient, bankName=WALLET
      295TXN_FAILUREYour payment failed as the UPI ID entered is incorrect. Please try again by entering a valid VPA or use a different method to complete the payment.
      334TXN_FAILUREInvalid Order ID
      400PENDINGTransaction status not confirmed yet.
      401TXN_FAILUREYour payment has been declined by your bank. Please contact your bank for any queries. If money has been deducted from your account, your bank will inform us within 48 hrs and we will refund the same.
      402PENDINGLooks like the payment is not complete. Please wait while we confirm the status with your bank.
      810TXN_FAILURETxn Failed


      Request CodeResponse JSON
      
                  const requestObject={
                         "amount": 1.00,
                         "orderId": "0071490615",
                         "txnToken":    "fe795335ed3049c78a57271075f2199e1526969112097",
                         "mid": "ABCdj00008000000",
                  }
      
                  function ready (callback) {
                       // call if jsbridge is injected
                    if(window.JSBridge) {
                         callback && callback();
                         } else{
                          // listen to jsbridge ready event
                          document.addEventListener('JSBridgeReady', callback, false);
                          }}
      ready(function () {  JSBridge.call('paytmPayment',requestObject,   function(result) {    console.log(JSON.stringify(result))   }); });