• Callback Response
  • Getting Started
    • Mobile Integration (Android/IOS)
      Enterprise Solutions
      Retail Solutions
      Accept Payments
      Process Payments
      Paytm Payouts
      API References
      Refunds
      Guides
      Other links
      Mini Apps Platform
  • Features for Investments PG
  • post Auto Debit API

    Use Case


    This API is used to debit the amount from the Paytm proprietary instrument, provided the sso token is valid and the user has sufficient balance in his Paytm account

    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.
    ReqType string
    mandatory
    This parameter is used to identify the transaction flow. Its value shall be as mentioned below:
    “WITHDRAW” for debit transaction
    TxnAmount float(2 decimal)
    mandatory
    Transaction amount, total amount including subwallet amounts
    AppIP string
    127.0.0.1
    mandatory
    IP of the device by which call is initiated.
    OrderId string(50)
    mandatory
    Unique reference ID for an Order request which is generated by merchant and sent in the transaction request payload. Duplicate order request are rejected by Paytm. It's alphanumeric and special character allowed are “@” “-” “_” “.”.
    DeviceId string
    mandatory
    Unique identification no of the Device like customer's phone number
    Currency string(3)
    mandatory
    Currency in which the transaction has taken place. Currently only "INR" is the supported currency of transaction.
    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.
    Note: Create the signature using all the request parameters.
    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.
    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
    subwalletAmount object
    optional
    This parameter is required to limit the maximum amount that could be deducted from a particular subwallet. This parameter is only used for payMode PPI (Paytm Wallet)

    Possible keys include: FOOD, GIFT, MULTI_PURPOSE_GIFT, TOLL, CLOSED_LOOP_WALLET, CLOSED_LOOP_SUB_WALLET, FUEL, INTERNATIONAL_FUNDS_TRANSFER, CASHBACK, GIFT_VOUCHER. e.g. "subwalletAmount":{ "FOOD": "2"}

    NOTE:
    Exclude parameter subwalletAmount and checkSum while creating checksum for the request.

    Response Attributes


    API Content Type: JSON

    ATTRIBUTE DESCRIPTION
    TxnId string(64) This is a unique Paytm transaction ID that is issued by Paytm for each transaction
    MIDstring(20) 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.
    OrderIdstring(50) Unique reference ID for an Order request which is generated by merchant and sent in the transaction request payload. Duplicate order request are rejected by Paytm. It's alphanumeric and special character allowed are “@” “-” “_” “.”.
    TxnAmountNumeric The amount that the Merchant needs to withdraw.
    BankTxnIdNumeric(eg, 01) 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
    PaymentModestring(15) The payment mode used by customer for transaction
    Paytm wallet - PPI
    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.
    CheckSumstring Signature encryption for validation. It's value to be sent should be the checksum string created by using Paytm checksum library.
    Note: Create the signature using all the request parameters.
    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.
    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.
    StatusCodestring status of the Txn; not mandatorarily present all the time.

    Response Codes and Messages


    ResponseCodeStatusResponseMessage
    01TXN_SUCCESSTxn Successful.
    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
    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
    305TXN_FAILUREMerchant Id not registered.
    325TXN_FAILUREDuplicate order id
    327TXN_FAILUREChannel is not associated
    330TXN_FAILUREPaytm checksum mismatch
    334TXN_FAILUREInvalid Order Id.
    343TXN_FAILUREInvalid Token
    344TXN_FAILUREInvalid wallet type
    345TXN_FAILURERequest not unique
    501TXN_FAILURESystem Error
    712TXN_FAILUREApplying Promo Code Failed
    StagingProduction
    REQUESTRESPONSE
    curl -X POST 'https://securegw-stage.paytm.in/order/directPay' \
    --header 'Content-Type: application/json' \
    --data '{"ReqType":"WITHDRAW","SSOToken":"eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..xxxxxxxxxxx.9iHTtWbCZ0I6qbn2sUnyz5siw1fqbmtEnFMFE7nSIX-yrwCkiGfAC6QmPr9q-tw8LMPOh5-3UXRbpeVZEupQd3wNyaArWybRX2HAxJDRD8mxJ_wxzJM6GZ1ov4O3EIsx2Y_Zr0aHCd3VbnTjRUnlVdxXJPFG8QZs0b_2TVdoAX3_QjZS8_dwcmIWoH8ebDzOIs7MJacETfMtyFGAo8Xc0LjznToUWvTsTbIXQoF1yB0.1fZFAYJVsY61BTv2htLcXQ8800","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}"}'