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

      post Capture API

      Use Case


      The Capture API is used when merchant actually captures the fund.

      Order id sent in pre-auth and order_id sent in capture request should be same as both these requests belong to same merchant order.

      We have PENDING status for capture transaction other than SUCCESS and FAILED which is returned when the system is not sure whether money has been debited from customer wallet or not.


      It happens when there are some system errors between two Paytm systems. We have internal reconciliation between systems after which this PENDING transaction moves to either SUCCESS or FAILED state.


      To verify the final Status of transaction Merchant can call Transaction Status API and Merchant has to send txn type in the request of Transaction Status API to know the current status of txn.


      Txn Type valid values will be PREAUTH,RELEASE,CAPTURE for preauth, release and capture txn respectively.

      In case final status is FAILED, Merchant can call capture again with same order id and Paytm will honor that capture if pre-auth is still valid.


      99% of PENDING STATUS will be converted into final status with in 10 min.

      Request Attributes


      API Content Type: JSON

      ATTRIBUTE DESCRIPTION
      MID string(20)
      mandatory
      This 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 MID is available here & production MID will be available once your activation is complete.
      PREAUTH_ID mandatory The Unique ID generated for the blocked amount by Paytm
      ReqType string
      mandatory
      his parameter is used to identify the transaction flow. Its value shall be as mentioned below:
      “CAPTURE” for amount to be captured.
      TxnAmount float(2 decimal)
      mandatory
      This is the “Transaction Amount” that is to be charged to the customer’s credit/debit card. Only numeric values are allowed. Please ensure that the amount is in the same currency as defined for the Merchant ID being used.
      AppIP string
      127.0.0.1
      mandatory
      IP of the device by which call is initiated.
      OrderId string(50)
      mandatory
      The “Order ID” is of Merchant’s.In case of capture same as Preauth Order Id
      Currency string(3)
      mandatory
      Currency in which the transaction has taken place. Currently only "INR" is the supported currency of transaction.
      DeviceId string
      mandatory
      Unique identification no of the Device like customer's phone number
      SSOToken string
      mandatory
      This is a unique token linked with user's Paytm wallet and is provided in the response while linking user's Paytm wallet.
      PaymentMode string(3)
      mandatory
      The payment mode used for transaction. PPI for Wallet transaction.
      CustId string
      mandatory
      This parameter is the unique reference ID for every customer and is generated by the merchant. The allowed special characters for this parameter are @, ! ,_ ,$, .
      IndustryType string(16 char)
      mandatory
      Industry type should pass here. This will be provided by Paytm. Ex: “Retail”
      Channel string
      mandatory
      Channel through which API call is initiated.
      For websites, the value to be passed should be "WEB" and for Mobile websites/App, the value to be passed should be "WAP"
      This parameter is used to control the theme of the payment page. Based on the channel passed, Paytm will render the layout suitable for that specific platform.
      AuthMode string
      mandatory
      Possible values of this parameter:
      USRPWD – for Net banking payment mode/Wallet.
      CheckSum string
      mandatory
      Signature encryption for validation. It's value to be sent should be the checksum string created by using Paytm checksum library.
      PROMO_CAMP_ID string(128)
      optional
      This parameter is required to pass when merchant is running any promotional campaign and it is configured at paytm payment gateway.Merchant will get in contact with Paytm to launch any promocode campaign
      MercUnqRef string(128)
      optional
      This parameter accepts merchant defined value. In transaction request, merchant can send his choice of value and Paytm payment gateway shall return the same value in transaction response.


      Response Attributes


      API Content Type: JSON

      ATTRIBUTE DESCRIPTION
      TxnID string(64) A unique ID generated by Paytm for each txn.
      MIDstring(20) This is a unique identifier provided to every merchant by Paytm.
      TxnAmountfloat(2 decimal) The amount that the Merchant needs to withdraw.
      BankTxnIdstring A unique ID generated for each txn by the Paytm Wallet
      ResponseCodestring This is the ResponseCode corresponding to a particular message and is returned to the merchant. It's maximum length is 64. The different response codes corresponding to this API are mentioned below.
      ResponseMessagestring This parameter is the result message which contains information about the response.
      Statusstring(20) This parameter indicates the status of API call. It's possible values are:
      1. TXN_SUCCESS - Success
      2. TXN_FAILURE- Failure
      3. PENDING- Pending
      PaymentModestring(15) The payment mode used by customer for transaction
      Paytm wallet - PPI
      BankNamestring The bank that was used for this txn e.g. WALLET
      CustIdstring This parameter is the unique reference ID for every customer and is generated by the merchant. The allowed special characters for this parameter are @, ! ,_ ,$, .
      MBIDstring A unique ID generated by the bank for each merchant.
      CheckSumstring Signature encryption for validation. It's value to be sent should be the checksum string created by using Paytm checksum library.
      PROMO_CAMP_IDstring Promo code if sent in request
      PROMO_STATUSstring This paremeter will indicate if Promo is successfully applied or failed. Below are values which may return in this parameter. PROMO_SUCCESS,PROMO_FAILURE.
      Optional (if merchant has not requested for any promo campaign)
      PROMO_RESPCODEstring This is a numeric response code. “01” implies promo applied successfully. All other codes refer that promo code has not been applied. Each code representing a different reason for failures.
      Optional if merchant has not requested for any promo campaign.
      MercUnqRefstring This parameter accepts merchant defined value. In transaction request, merchant can send his choice of value and Paytm payment gateway shall return the same value in transaction response.

      Constraints

      Cases of Capture:

          Pre-Auth Amount (P), Capture Amount (C), Balance (B)
          P < C
      If user’s token is valid then
          If [B+ P] >= C, then C is Dr.
          If [B+P] < C, then capture request fails
      If user’s token is invalid then capture request fails
          P >= C
      C is Dr. irrespective of validity of token


      Response Codes and Messages


      ResponseCodeStatusResponseMessage
      01Txn SuccessfulTXN_SUCCESS
      228PENDINGCould not complete request. Please retry again.
      100TXN_FAILUREPaytm has classified this transaction as suspicious
      118TXN_FAILUREThe transaction amount specified by the user exceeds the per transaction limit for this merchant
      130TXN_FAILUREThis user is blocked at Paytm end
      151TXN_FAILURETransaction with the same order Id already exists
      156TXN_FAILUREPerday Txn amount is crossed for Paytm
      158TXN_FAILUREPerMonth Txn amount is crossed for Paytm
      159TXN_FAILUREPerday Txn count is crossed for Paytm
      161TXN_FAILUREPerMonth Txn count is crossed for Paytm
      165TXN_FAILUREUser has crossed the monthly debit limit prescribed by RBI
      227TXN_FAILURETransaction failed
      235TXN_FAILUREYou don't have sufficient balance in your account. Please try with a different account
      237TXN_FAILURECould not complete request. Please retry again.
      239TXN_FAILUREMerchant does not exist
      240TXN_FAILUREInvalid total amount
      243TXN_FAILUREWallet not exist for the user
      260TXN_FAILUREMaximum allowed amount in Wallet exceeds limit
      267TXN_FAILUREUser does not exist
      274TXN_FAILUREUser not verified
      302TXN_FAILUREInvalid Request type
      327TXN_FAILUREChannel is not associated
      334TXN_FAILUREDuplicate order id
      343TXN_FAILUREInvalid Token
      344TXN_FAILUREInvalid wallet type
      345TXN_FAILURERequest not unique
      355TXN_FAILUREPreauth and capture id is not same
      411TXN_FAILUREInvalid Amount sent to Paytm
      712TXN_FAILUREApplying Promo Code Failed

      Capture Error Codes and Messages


      ErrorCodeErrorMessage
      140Invalid Input Parameter from Merchant
      238Invalid currency code
      240Invalid total amount
      303Merchant Id can not be blank
      304App IP is blank
      305Merchant Id not registered
      311Invalid device id
      317Invalid payment mode
      318Invalid customer id
      319Invalid industry type
      325Duplicate order id
      327Channel is not associated
      330Paytm checksum mismatch
      332Order id can't be greater than 50 characters
      333Customer id can't be greater than 50 characters
      343Invalid Token
      357Invalid order Id
      501System Error
      VAER-PID101PreAuth Id is required
      StagingProduction
      REQUESTRESPONSE
      curl -X POST 'https://securegw-stage.paytm.in/order/capture' \
      --header 'Content-Type: application/json' \
      --data '{"ReqType":"CAPTURE","PREAUTH_ID":"2020052711121XXXXXXXX68304901660306","SSOToken":"ae74f8b5-be5f-4503-XXXX-a60c9dcd3300","MID":"{mid}","TxnAmount":"1.00","AppIP":"45.251.51.117","OrderId":"ORDERID_98765","Currency":"INR","DeviceId":"7777777777","PaymentMode":"PPI","CustId":"CUST_001","IndustryType":"Retail","Channel":"WEB","AuthMode":"USRPWD","CheckSum":"{checksum}"}'