search

POSTSubscription PreNotify API

Use Case

This is an asynchronous API to pre-notify user about the debit of the subscription.
Also, when successful notification has been sent to the user, a callback would be there to notify the same to the merchant as well.

Request Attributes

Content Type : JSON

Head

AttributeDescription
clientId
string
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

tokenType
string
mandatory

This parameter identifies whether the API works on checksum authentication.

The value to be sent in tokenType is 'AES' for this API.

signature
string
mandatory

Paytm validates the request and ensures that parameters are not tempered by verifying the signature in the request. For creating the checksum (signature) refer to the steps given in Checksum Logic.
Note: Create the signature using the body parameter of the request.

timestamp
string
optional

EPOCH timestamp of the time at which request is being sent.
Example: 1588402269

Body

AttributeDescription
mid
string
mandatory

Paytm provides MID as a unique identifier to each merchant.

Example: INTEGR7769XXXXXX93833

subsId
string
mandatory

Subscription ID - Only Subscription Flow

txnAmount
string
mandatory

Order value of the transaction in INR.

Example: 1.00

txnDate
string
mandatory

Date on which the debit is intended to happen
Format DD-MM-YYYY

Example: 06-11-2020

txnMessage
string
mandatory

Reason for debit, with length between 1 to 50 alphanumeric characters.

referenceId
string
mandatory

Unique reference number, Length <= 50

invoiceDisplayNo
alphanumeric
optional

 Invoice number for Subscription on cards, Length <= 15 characters

Response Attributes

Content Type : JSON

Head

AttributeDescription
clientId
string

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

Version of the API passed in the request.
Example: v1

timestamp
string

EPOCH timestamp of the time at which response is being sent.
Example: 1588402269

Body

AttributeDescription
resultInfo
object

This parameter gives the information about the result of the API response

ResultInfo
+
AttributeDescription
code
string

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

status
string

This parameter indicates the status of API call.

Possible Values: SUCCESS, FAILURE

message
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.

paytmReferenceId
string

Reference Id

Response Codes & Messages

code status message
3006 SUCCESS SUCCESS
400 FAILURE

• txnAmount can not be greater than max amount
• The request cannot be validated. Please refer to the doc and try again.
• Subscription is in paused/suspended state.

401 FAILURE Authentication Failure.
500 FAILURE System Error
3000 FAILURE MERCHANT_NOT_FOUND
3004 FAILURE Subscription Not Found.
3005 FAILURE Some error occured.
3008 FAILURE Invalid Subscription Amount
3046 FAILURE Notification has already been sent.
3047 FAILURE Invalid Debit Date.
3049 FAILURE Duplicate Reference Id.
3065 FAILURE Pre-debit retry in progress. Please try after sometime
INT-4056 FAILURE Scheduled payment has already expired. You can't perform any action on it
INT-6018 FAILURE Invalid mandate execution number
INT-6024 FAILURE Execution date for Scheduled payment is not valid
INT-6023 FAILURE Scheduled payment is in paused state. Please try later.
INT-1058 FAILURE Your request was unsuccessful. Please try again
⇾
Staging
Production
https://securegw-stage.paytm.in/subscription/preNotifycopy icon
REQUEST
RESPONSE
CURL
JAVA
NODE
PHP
PYTHON
DOTNET
curl -X POST 'https://securegw-stage.paytm.in/subscription/preNotify' \
-H 'Content-Type: application/json' \
--data-raw '{"head":{"signature" : "aesdg123456789jhdfgrtyuaaaa=","tokenType" : "AES" },"body":{"subsId" : "7271","mid" : "{mid}","txnAmount":"2000","txnDate":"06-11-2020","txnMessage" :"subscription for postpaid mobile bill" ,"referenceId" : "NspPa6464ndCre985T5998985456"}}'
copy icon