search

POSTAuto 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 and PAYTM_DIGITAL_CREDIT for Paytm Postpaid 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:
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: 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: As per compliance rules, you need to send the Food item amount separately to Paytm.

NOTE: Exclude parameter subwalletAmount 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

MID

string(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.

OrderId

string(50)

Unique reference ID for an Order request which is generated by merchant and sent in the transaction request payload. Duplicate order request is rejected by Paytm. It's alphanumeric and special character allowed are “@” “-” “_” “.”.

TxnAmount

Numeric

The amount that the Merchant needs to withdraw

BankTxnId

Numeric(eg, 01)

A unique ID generated for each txn by the Paytm Wallet

ResponseCode

string

This is the ResponseCode corresponding to a particular message and is returned to the merchant. Its maximum length is 64. The different response codes corresponding to this API are mentioned below.

ResponseMessage

string

This parameter is the result message which contains information about the response

Status

string(20)

This parameter indicates the status of the API call. It's possible values are:
  • TXN_SUCCESS - Success
  • TXN_FAILURE- Failure

PaymentMode

string(15)

The payment mode used by the customer for the transaction.
Paytm wallet - PPI

PROMO_CAMP_ID

string

Promo code, if sent in the request.

PROMO_STATUS

string

This parameter will indicate if the Promo is successfully applied or failed. Below are values which may return in this parameter. PROMO_SUCCESS,PROMO_FAILURE.
Optional (if a merchant has not requested for any promo campaign)

PROMO_RESPCODE

string

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 a merchant has not requested for any promo campaign.

CheckSum

string

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

This parameter accepts merchant defined value. In transaction request, the merchant can send his choice of value and Paytm payment gateway shall return the same value in the transaction response.

BankName

string

The bank that was used for this txn e.g. WALLET.

CustId

string

This parameter is a unique reference ID for every customer and is generated by the merchant. The allowed special characters for this parameter are @, ! ,_ ,$, .

MBID

string

A unique ID generated by the bank for each merchant

StatusCode

string

Status of the Txn; not mandatorily present all the time

Response Codes & Messages

resultCoderesultStatusresultMsg
01 TXN_SUCCESS Txn Successful.
118 TXN_FAILUREThe transaction amount specified by the user exceeds the per transaction limit for this merchant.
130 TXN_FAILURE This user is blocked at Paytm end
151 TXN_FAILURE Transaction with the same order Id already exists
227 TXN_FAILURE Transaction failed
235 TXN_FAILUREYou don't have sufficient balance in your account. Please try with a different account.
237 TXN_FAILURE Could not complete request. Please retry again.
239 TXN_FAILURE Merchant does not exist
240 TXN_FAILURE Invalid total amount
243 TXN_FAILURE Wallet not exist for the user
260 TXN_FAILURE Maximum allowed amount in Wallet exceeds limit
267 TXN_FAILURE User does not exist
274 TXN_FAILURE User not verified
305 TXN_FAILURE Merchant Id not registered.
325 TXN_FAILURE Duplicate order id
327 TXN_FAILURE Channel is not associated
330 TXN_FAILURE Paytm checksum mismatch
334 TXN_FAILURE Invalid Order Id.
343 TXN_FAILURE Invalid Token
344 TXN_FAILURE Invalid wallet type
345 TXN_FAILURE Request not unique
501 TXN_FAILURE System Error
712 TXN_FAILURE Applying Promo Code Failed
⇾
Staging
Production
https://securegw-stage.paytm.in/order/directPaycopy icon
REQUEST
RESPONSE
CURL
JAVA
NODE
PHP
PYTHON
DOTNET
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}"}'
copy icon